Skip to content

psa: document @groupaction annotation for ActionSelector groups - #1417

Merged
jafingerhut merged 2 commits into
p4lang:mainfrom
sanket-jadhav-cse:docs/groupaction-psa-spec
Jul 21, 2026
Merged

psa: document @groupaction annotation for ActionSelector groups#1417
jafingerhut merged 2 commits into
p4lang:mainfrom
sanket-jadhav-cse:docs/groupaction-psa-spec

Conversation

@sanket-jadhav-cse

Copy link
Copy Markdown

Summary

Documents the @groupaction annotation in the PSA specification for use with ActionSelector group actions in P4Runtime one-shot action selector programming.

The feature was added to P4Runtime, and the follow-up discussion concluded that this annotation is architecture-specific and should be documented in the PSA specification rather than the base P4 language specification.

Changes

  • Adds a Group Actions subsection to PSA Section 8.12, Action Selector.
  • Documents that group actions execute logically before the selected member action.
  • Defines @groupaction as required for group actions and restricts it to group-action use only.
  • Documents that @groupaction cannot be combined with @tableonly or @defaultonly.
  • Documents the one-shot P4Runtime limitation.
  • Adds a PSA Reserved Annotations appendix entry for @groupaction.

Validation

  • git diff --check
  • make -C p4-16/psa

The build completed successfully. The environment emitted optional dependency warnings for rouge and prawn-gmagick; these do not affect this documentation change.

Related

Signed-off-by: Sanketjadhav31 <sj546400@gmail.com>

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for a nice first attempt @Sanketjadhav31. The language and semantics of this is a bit tricky

Comment thread p4-16/psa/PSA.adoc
This feature is currently supported only for P4Runtime{P4RuntimeAPI}
one-shot action selector programming.

A group may be configured with a _group action_ that executes logically before

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is _group action_ a formatting thing?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

According to AsciiDoc documentation, it is used to make the enclosed text italic: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/

Comment thread p4-16/psa/PSA.adoc Outdated
with `@groupaction`.

An action annotated with `@groupaction` may only be used as a group action. It
must not be used as a table entry action or as a table default action.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe we should make it explicit since english is not an obvious language. But we would say it cannot be used as a table entry and cannot be used a a table default action. The other way could be misinterpreted depending on the brackets or how the user reads it

@jafingerhut jafingerhut Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps the following might be more explicit, as a suggested replacement for the last sentence in the paragraph above?

As specified in the P4Runtime specification, attempting to use an action annotated with @groupaction as a table entry action or as a table default action must fail and return an appropriate error status.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 to what the suggestion replacement

Comment thread p4-16/psa/PSA.adoc Outdated
or `@defaultonly`. (For the semantics of `@tableonly` and `@defaultonly`,
see the P4 language specification.)

Because a single named action cannot be used both as a group action and as

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

single named --> non-group

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It also seems clear to simply say "Because an action ..." with no adjectives before "action"

@matthewtlam

Copy link
Copy Markdown

@jfingerh PTAL to see if we have the same understanding

Signed-off-by: Sanketjadhav31 <sj546400@gmail.com>

@jafingerhut jafingerhut left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me.

@jafingerhut

Copy link
Copy Markdown
Collaborator

@matthewtlam Please take a look at the most recent version to see if you approve.

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @Sanketjadhav31. LGTM!

@jafingerhut
jafingerhut merged commit ebfc6aa into p4lang:main Jul 21, 2026
4 checks passed
@sanket-jadhav-cse
sanket-jadhav-cse deleted the docs/groupaction-psa-spec branch July 22, 2026 02:40
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.

3 participants