Skip to content

Commit 5fd7c80

Browse files
authored
Add ActionSelectionMode and SizeSemantics to ActionProfileActionSet in P4Runtime. (#560)
* Add BucketSelectionMode and SizeSemantics to ActionProfileActionSet in P4Runtime. Signed-off-by: Angela Zhang <[email protected]> * Add comments Signed-off-by: Angela Zhang <[email protected]> * update docs + run ./codegen/update.sh Signed-off-by: Angela Zhang <[email protected]> * address comments Signed-off-by: Angela Zhang <[email protected]> * address comments Signed-off-by: Angela Zhang <[email protected]> * address comments Signed-off-by: Angela Zhang <[email protected]> * change desc for HASH mode Signed-off-by: Angela Zhang <[email protected]> * (proto change) Add ActionSelectionMode and SizeSemantics to ActionProfileActionSet in P4Runtime. (#561) * Create a separate PR for just the P4Runtime proto changes. Signed-off-by: Angela Zhang <[email protected]> * address comments --------- Signed-off-by: Angela Zhang <[email protected]> * address comments Signed-off-by: Angela Zhang <[email protected]> * update file Signed-off-by: Angela Zhang <[email protected]> * (proto change) Add ActionSelectionMode and SizeSemantics to ActionProfileActionSet in P4Runtime. (#561) * Create a separate PR for just the P4Runtime proto changes. Signed-off-by: Angela Zhang <[email protected]> * address comments --------- Signed-off-by: Angela Zhang <[email protected]> * run codegen/update.sh Signed-off-by: Angela Zhang <[email protected]> --------- Signed-off-by: Angela Zhang <[email protected]>
1 parent b039cc0 commit 5fd7c80

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

docs/v1/P4Runtime-Spec.adoc

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,10 +3872,14 @@ does not need to keep track of group ids and member ids.
38723872

38733873
One shots are programmed by choosing the `ActionProfileActionSet` message as the
38743874
`TableAction`. The `ActionProfileActionSet` message consists of a set of
3875-
`ActionProfileAction` messages. This set should have cardinality no greater than
3875+
`ActionProfileAction` messages, a `ActionSelectionMode` enum, and a
3876+
`SizeSemantics` enum. The `ActionSelectionMode` and `SizeSemantics` enums
3877+
override the existing action selector settings.
3878+
3879+
The `ActionProfileAction` set should have cardinality no greater than
38763880
`max_group_size` (if `max_group_size` is nonzero) if `selector_size_semantics`
3877-
is `sum_of_members`, or else the server must return `INVALID_ARGUMENT`. Each
3878-
`ActionProfileAction` message has the following fields:
3881+
is `sum_of_members`, or else the server must return `INVALID_ARGUMENT`.
3882+
Each `ActionProfileAction` message has the following fields:
38793883

38803884
* `action` is one of the actions specified by the table that is being
38813885
programmed.
@@ -3897,6 +3901,43 @@ is `sum_of_members`, or else the server must return `INVALID_ARGUMENT`. Each
38973901
on the `watch_port` field, which also apply for one shot action selector
38983902
programming.
38993903

3904+
Each `ActionSelectionMode` enum can take on the following values:
3905+
3906+
* `DEFAULT_MODE_DETERMINED_BY_ACTION_SELECTOR`: uses the action specified by the
3907+
action selector, ensuring backward compatibility. In a
3908+
[SAI-based](https://github.com/opencomputeproject/SAI/blob/master/inc/sainexthopgroup.h#L291)
3909+
switch, this would correspond to setting the per-group
3910+
`SAI_NEXT_HOP_GROUP_ATTR_HASH_ALGORITHM` attribute to
3911+
`SAI_HASH_ALGORITHM_NONE`, using the default action selector mode.
3912+
3913+
* `HASH`: selects an action based on the default hashing algorithm used by the
3914+
switch.
3915+
3916+
* `RANDOM`: selects an action at random. In a SAI-based switch, this would
3917+
correspond to setting the per-group `SAI_NEXT_HOP_GROUP_ATTR_HASH_ALGORITHM`
3918+
attribute to `SAI_HASH_ALGORITHM_RANDOM`.
3919+
3920+
Each `SizeSemantics` enum can take on the following values:
3921+
3922+
* `DEFAULT_SIZE_DETERMINED_BY_ACTION_SELECTOR`: uses the size semantics
3923+
specified by the action selector, ensuring backward compatibility.
3924+
3925+
* `SUM_OF_WEIGHTS`: the group's size is the sum of the individual weights of
3926+
all its members. In a
3927+
[SAI-based](https://github.com/opencomputeproject/SAI/blob/master/inc/sainexthopgroup.h#L350)
3928+
switch, this would correspond to setting the per-group
3929+
`SAI_NEXT_HOP_GROUP_MEMBER_ATTR_WEIGHT` attribute.
3930+
3931+
* `SUM_OF_MEMBERS`: the group's size is the total count of its members.
3932+
3933+
All servers and targets must support the
3934+
`DEFAULT_MODE_DETERMINED_BY_ACTION_SELECTOR` and
3935+
`DEFAULT_SIZE_DETERMINED_BY_ACTION_SELECTOR` values for `ActionSelectionMode`
3936+
and `SizeSemantics` respectively. Servers must also support the specific value
3937+
combination that corresponds to that default. Otherwise, if the target does not
3938+
support per-group hash settings for this action profile, the server should
3939+
return `UNIMPLEMENTED`. If the target supports per-group hash settings, but not
3940+
the specific combination given, the server should return `INVALID_ARGUMENT`.
39003941

39013942
Semantically, one shots are equivalent to programming the table entry, group,
39023943
and members individually; with the necessary group id and member ids bound to

0 commit comments

Comments
 (0)