-
Notifications
You must be signed in to change notification settings - Fork 13
Description
So I can see the desire and use for a feature like this. I was curious about how general you were hoping this would be.
For example, what if a P4 program has 3 action selectors in series, where each decision is based on a different hash function than the other ones, so they are effectively "independent"? If there were M choices for the first, N choices for the second, and P choices for the third, and each such choice resulted in exactly one output packet, would you expect to get M*N*P
output sets from such a program? It is of course possible there would be less than that, e.g. some choices of the first action selector might cause the 2nd and 3rd action selector to be used, while other choices of the first action select might cause the 2nd and/or 3rd action selector to be skipped, e.g. due to if conditions containing variables that are modified by the 1st action selector action.
Besides output packets, there can also be counter, meter, and register side effects while processing a packet, and these could be either the same for different action selector choices, or in general they can be different depending upon the action selector choice.
Are you thinking that you want the P4 register initial state to be the same for each packet output set, i.e. first calculate output packet set 1, then reset all registers back to the way before output packet set 1 was determined, then calculate output packet set 2, etc.?
Or should output packet set 2's contents be determined based on the register values that are present after output packet set 1 is determined? In general, the register side effects, and the output of the packets, could depend very significantly on the order that the action selector choices are chosen while determining the output packet sets.
One could also imagine limiting the project scope so that no P4 register arrays are supported in a program using this new feature, to simplify the implementation.