-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action profile and selector specification #410
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a diagram would be very useful to explain how action profiles / action selectors work. It is hard to convey by text alone.
p4-16/psa/PSA.mdk
Outdated
instance. | ||
|
||
An action profile instance contains member entries consisting of action | ||
specifications. Member entries are indexed by controller-assigned integer ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is relevant to dataplane behavior. This is one possible runtime API, but there are many others. Member entries can be identified by switch-assigned handles for example. I would also not mention any "controller" entity as it ties PSA to a SDN deployment.
p4-16/psa/PSA.mdk
Outdated
across multiple tables only if all such tables define the same set of actions | ||
in their `actions` attribute. | ||
|
||
When a packet matches a table entry at runtime, the controller-assigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "controller-assigned id" is an abstract entity that may completely ignored by the dataplane
specifications. Additionally, it may contain group entries that are defined | ||
as a collection of member entries. Both action selector member and group entries | ||
are indexed by controller-assigned integer ids. Member and group entries share | ||
the id space. Action selector members may only specify action types defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also very implementation-specific
Figures sound like a good idea to me, if they can clearly show what is going on. Would anyone besides me find it clarifying to have an explanation like the one at the link below for how action_profile's can be implemented, and used as a mental model for how they work? I can try writing a similar one for action selectors, too. |
@samar-abdi It isn't clear to me whether your additions cover the ability for an action_selector to 'point at' a group, and also optionally to directly 'point at' a member, without going through a group. See this issue for an example: p4lang/behavioral-model#438 |
I think this sentence clarifies this capability: "An action selector instance contains member entries consisting of action I will add figures to clarify this further. |
Also, the subsequent para clarifies the "pointing" capability: "When a packet matches a table entry at runtime, the controller-assigned |
In addition to a proposed 'specification' for forwarding behavior of a PSA table with implementation action_profile(), I have added to the document at the link I gave earlier a proposed way of specifying the forwarding behavior of a PSA table with implementation action_selector(). You can follow the link in an earlier comment and scroll down to the 'action_selector' section, or use the link below to go straight to that part of the document: @antoninbas @samar-abdi @jnfoster I would appreciate any corrections or comments on that description, if you have a chance to read it over. In particular, it seems to be the case that the implementation action_profile() and action_selector() tables in both P4_14 and P4_16 PSA are not features that one cannot implement without them, but are simply a shorter way to specify a particular kind of forwarding behavior. Does that sound correct? |
Thanks @jafingerhut for putting this together. Your interpretation looks right. Here is my input on some of your notes: Note 3: TBD: What should the size of table T_group_to_member_id be? The same value N as for table T_member_id_to_action? Note 5: TBD: Are there any other ways intended to be implemented for calculating 'T_member_of_group' other than as a deterministic function of values of the fields of T's key with match_kind 'selector'? |
Action profiles do not add functionality to the language, but they impact resource consumption and the control-plane. For example, with action profiles you can atomically change multiple actions in a table. |
@mbudiu-vmw The implementation of action profiles that I wrote, using two P4 tables, also reduces resource consumption (vs. having many table entries with duplicated storage of the same action + action parameters). It also enables a single member to be modified atomically, shared by all of the keys that 'point to it'. I would bet $1 that it is probably exactly what some implementation use 'under the hood' for a table with implementation action_profile(). I am not proposing that we eliminate action_profile() and action_selector() from the PSA spec. I am trying to make them less mysterious to a newcomer. |
Yes, but you still have to update two tables when you insert or delete entries, which you can do atomically to in the case of real action selectors. This is a control-plane difference. |
@mbudiu-vmw Can you give an example of the kind of control plane operation that is possible to make atomic with real action selectors, that you believe cannot be done atomically with the multi-table implementation? |
I don't know what the control-plane operations are for action selectors; it is part of a separate spec, which I don't know if it is final. If the only operations are action insertion/deletion this probably can be made to look atomic for the data-plane by carefully updating to the two tables in the "right" order. For the general case think "databases": in databases if you need to do multiple operations atomically (across one or multiple tables) you need some form of transactions, which I don't know if the P4-16 control plane will provide. I am guessing that the control-plane will attempt to promise that any one operation will be atomic (as seen by the data-plane), but cannot promise that combinations of operations will be. |
It's really not a matter of atomic operations or resource utilization. I believe the main goal is to simplify the P4 program and expose a familiar (think OpenFlow maybe) group / member abstraction to the application through the runtime APIs. |
@jafingerhut I think you captured the logical view of action profile / selector correctly in your document. |
What should be said about tables that have both an action_profile() or action_selector() implementation, and the "default_action" table property? For example, when I try to compile this program: https://github.com/jafingerhut/p4-guide/blob/master/action-profile-and-selector/action-profile.p4 using a recent version of p4c-bm2-ss, it gives the following warnings:
Is that some fundamental limitation on all implementations of such tables? If so, why? (I don't see yet why it would be.) Or is it just an implementation restriction currently in bmv2, and it should be straightforward for PSA implementations to have default actions for such tables? |
@jafingerhut That's a great question that needs to be resolved. |
The feedback from PSA is to disallow specifying a default action for tables with action profile and action selector implementation. So, if the table is not hit, the action will default to NoAction. We will note this in the PSA specification. This requires change to p4c in that the implementation and default action attributes cannot co-exist in the table. |
No description provided.