p4lang / p4runtime

Specification documents for the P4Runtime control-plane API
Apache License 2.0
142 stars 88 forks source link

Add max_num_members to Action Profiles. #369

Closed jonathan-dilorenzo closed 2 years ago

jonathan-dilorenzo commented 2 years ago

See issue #364 for more information.

It is a bit unnatural for a proto field to default to the same value as another field, but it seems like the right thing to do if we want the semantics to be the same for standard Action Profiles. WDYT @antoninbas and @smolkaj?

jonathan-dilorenzo commented 2 years ago

The build error seems to be due to the Go version being outdated. Unfortunately, I can't easily get docker on my work computer. If someone else could run the codegen/update.sh that is suggested (well, update_go.sh is suggested, but it doesn't exist), and update the PR, that'd be fantastic.

jonathan-dilorenzo commented 2 years ago

Excellent questions that I should perhaps clarify.

  1. if the same member is added to 2 different groups, it still counts as only 1 against the max_num_members limit? Yes, that is exactly my intention.

  2. We would count every individual action as being a member since this is a conservative approach that should be a lower-bound regardless of how clever the switch is (unless the current definition of 'size' is a better abstraction for its resource constraints than the max_num_members is e.g. because it uses X weight 1 members to represent a single weight X action).

antoninbas commented 2 years ago

@jonathan-dilorenzo sounds good to me. I think your changes to the spec should explicitly cover my 2nd question (one-shot programming) as it is not obvious.

I can help with Go files generation, but I will either need write access to your fork or you will need to reopen this PR from a branch in this repository (instead of from your fork).