-
Notifications
You must be signed in to change notification settings - Fork 448
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
p4runtime output includes a bunch of tbl_act_N tables and act_N actions. #425
Comments
A lot changed in those commits, but my guess is that the new |
These actions are created by the compiler to execute code that is in a control but cannot be executed directly on the target. They are a symptom that the code is not very well optimized. They should not affect the correctness of the program. |
That should be easy enough to fix, then, except that currently we don't have a way of expressing that a certain table or action shouldn't be exposed. I could add support for an |
This is at most a performance bug, but not a correctness bug. These tables do not have a key - that's a hint that they do not have to be exposed. They should also have a size of 0 - but I guess that the default size is being used. |
I'd prefer not to use a heuristic to identify them; that seems fragile. |
It is not a heuristic. |
The passes in question are SynthesizeActions and MoveActionsToTables. |
Thanks, Mihai. I'll take a look. |
But if the problem is the control-plane this is the correct solution: a table with no key and a const default_action should not be exposed. There is nothing the control-plane can do about it. (Well, perhaps it can, if it has counters...). |
One other thing you can do it to assign them a name such as @name(".") in the MoveActionsToTables pass. |
Yeah, that could work. |
P4_14 allows one to create tables with no fields in the key, and one or more possible actions, and I thought (perhaps only assumed) that the control plane API would allow you to specify the default action on a miss, and that default action would be performed for every packet on which that table is applied. Does P4_16 plan to remove this capability, assuming I am not imagining this capability in P4_14? Such tables are potentially useful for configuring one of several possible actions to take for all packets that reach a particular point in the control flow, regardless of that packet's contents. |
That should remain. |
Even read-only tables should appear in the control plane, really, assuming the programmer introduced them and not the compiler. Although you can't change their behavior, it does seem to reasonable to query information about such a table (its default action, any annotations that were applied to it, etc). |
I like @sethfowler's idea of having something like a @hidden annotation that is automatically added to compiler-synthesized tables like this. Even if they have no fields in the key, and a single action, and a const default_action, or whatever conditions you want to think of, if they are in the P4 source program, making them at least readable from the control plane seems like a good idea. |
If no one is working on this I can do it myself. |
Any chance progress can be made on this? Did you reach consensus on one of these 2 solutions? |
@jnfoster, has the committee reached agreement on an approach here? Should we go ahead and implement |
We discussed and are leaning toward the approach proposed here: If I understand your discussion above, adding the Thoughts? The next steps are to (a) draft a PR against the spec and (b) implement the changes and make a PR against p4c. |
OK, let's just use a |
For a medium-sized P4 program, I can see about a dozen of them. I didn't remember having this problem before, so I rolled back to a p4c version from a week ago and confirmed that this was a new issue.
More precisely, at refpoint cbee56a I do not observe the issue but at refpoint b88b850 I do observe the issue. Which means that the issue must have been introduced by one of these 3 commits by @mbudiu-vmw :
The text was updated successfully, but these errors were encountered: