Closed jonathan-dilorenzo closed 2 years ago
This sounds good to me. As I mentioned in today's meeting, having max_group_size
be the cumulative sum of member weights was implementation-driven when we first added support for ActionSelector
in P4Runtime (the implementation was replicating members according to their weight to achieve the desired load-balancing behavior). If an implementation can benefit from having this new piece of information, it is reasonable to add it.
@jonathan-dilorenzo could you submit a PR with this change (the non-breaking one).
I would recommend that for an ActionProfile
, we define max_num_members
to be the same as size
. Also, I assume we need a PSA annotation so that this value can be set from the P4 program for Action Selector extern instances?
Currently, Action Selectors can only specify the maximum weight of members within a group and the maximum total weight of all members (see image below). It would be useful to be able to specify the maximum number of members for Action Selectors as well (much like for Action Profiles).
Non-breaking change suggestion:
max_num_members
field, which specifies the maximum number of total members for Action Selectors.Breaking change suggestions:
Replace
size
with themax_num_members
field from the above suggestion, unifying the semantics for Action Selectors and Action Profiles and clarifying the meaning of the name in the presence of both weight and member number. Then, add amax_total_weight
field which has the semantics thatsize
currently has for Action Selectors (i.e. maximum total weight) and should be0
for Action Profiles.Instead of combining Action Profiles and Action Selectors into one message
ActionProfile
, separate them out. This simplifiesActionProfile
since it only needspreamble
,table_ids
, andsize
(ideally renamed for clarity). Action selectors can then use the suggestion from just above, co-opting all but thewith_selector
field from the currentActionProfile
message and adding themax_total_weight
field (and ideally renamingsize
).