-
Notifications
You must be signed in to change notification settings - Fork 449
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
Consider enabling support in bmv2 backend for default_action in tables with action profiles or action selectors #5101
Comments
@jafingerhut I guess it can be solved. First we can remove warnings from backends/bmv2 files and then we can update the json generation. One thing that I would like to test is that does bmv2 handles the warning correctly |
It is definitely possible. I did some further investigation on the details and added my findings to this comment on a related issue in the behavioral-model repo: p4lang/behavioral-model#1290 (comment) As far as I can tell, enabling this would require changes in all of these repositories, if you want the P4Runtime API to be able to configure the default_action of such tables at runtime:
When I saw that the work required was about 4 times more than I originally expected, I became less interested in pursuing such changes any time soon, personally. If someone else wants to take up that work, I certainly do not mind. Just go into it eyes open knowing that it is a much bigger task than I originally guessed. |
@jafingerhut what would be the impact of this change. If it has significant impact I would like to work on it |
It is difficult for me to judge if the impact is "significant". It is a nice small generalization to what you can do now. People have obviously been living with that restriction for 8-9 years now. |
If you are looking for a project that I think would have a significant impact, take a look at this one: p4lang/project-ideas#33 Either that, or an enhancement that enabled BMv2 to implement loops written inside of the body of a control, but not inside of an action (that is different implementation in BMv2, unfortunately). |
Since 2016, the p4c bmv2 backend has issued a warning if a table has a default_action property, and an implementation of an action profile or action selector. Then it produces a BMv2 JSON file that has no mention of the default_action at all. I believe this was done because at that time, BMv2 did not correctly implement those cases.
Since 2018, BMv2 should implement this correctly.
Links to commits/PRs with the 2016/2018 changes mentioned above can be found in the discussion thread following this comment: https://github.com/p4lang/behavioral-model/pull/1287/files#r1913623565
This issue is to track a possible enhancement to the p4c bmv2 backend that:
(a) no longer issues a warning for tables with a default_action property, if they have implementation that is action_profile or action_selector.
(b) for such tables, the BMv2 JSON data written for that table includes a description of the default_action of the table.
Of course, such a change should not be merged into p4c until after we have tested and verified that we believe BMv2 is working as expected for such tables.
The text was updated successfully, but these errors were encountered: