Skip to content

Change PER_GROUP_ONLY to PER_GROUP and update P4Runtime spec#604

Open
matthewtlam wants to merge 1 commit intop4lang:mainfrom
matthewtlam:matthewtlam
Open

Change PER_GROUP_ONLY to PER_GROUP and update P4Runtime spec#604
matthewtlam wants to merge 1 commit intop4lang:mainfrom
matthewtlam:matthewtlam

Conversation

@matthewtlam
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Matthew Lam <matthew.lam.qwerty@gmail.com>
** `id`, the `uint32` identifier of the action.
** `scope`, an enum value which can take one of four values:
`TABLE_AND_DEFAULT`, `TABLE_ONLY`, `PER_GROUP_ONLY` and `DEFAULT_ONLY`. The
`TABLE_AND_DEFAULT`, `TABLE_ONLY`, `PER_GROUP` and `DEFAULT_ONLY`. The
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not GROUP_ACTION?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, it seems sorta nice that they are the same...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that if @groupaction is the annotation, then GROUP_ACTION as the value of the enum would be nice to keep it similar to existing corresponding attribute/enum-value-names:

  • @defaultonly -> DEFAULT_ONLY
  • @tableonly -> TABLE_ONLY
  • @groupaction -> GROUP_ACTION

@kheradmandG
Copy link
Copy Markdown

kheradmandG commented Mar 31, 2026

@matthewtlam could you update the description on why we are proposing this change?

This is to avoid the confusion regarding the expected semantics of the @groupaction annotation.
The @tableonly and @defaultonly are defined in a way that if an action has no annotation, that means that can be used for both table and default).
But our semantics of @groupaction (previously @pergrouponly) is inconsistent with that, in the sense that if the annotation is present on an action, it can be used as a group action (and nothing else) and if the annotation is absent, the action cannot be used as a group action.
The drop of "only" postfix in @groupaction is meant to indicate that there is a difference between how @groupaction annotation vs. @tableonly and @defaultonly annotations work.

Also it seems there is consensus on @groupaction / GROUP_ACTION. Could you please update the PR.

@kheradmandG
Copy link
Copy Markdown

@jafingerhut @jonathan-dilorenzo @smolkaj if everyone happy with the idea, let's get this in soon before we have developments with the older annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants