-
Notifications
You must be signed in to change notification settings - Fork 445
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
varbit fields are not properly implemented #447
Comments
I can look into how to support the 2 argument extract in bmv2. It's not such a big difference with what is supported today. Today in bmv2, the VL field size expression is a property of the VL field; I just need to support providing this expression as part of the extract call instead. The only difficulty is that I need to make sure the JSON stays backward-compatible. |
You can use another name for the method, like 'extractVarbits' if that helps. That will only be half of the equation, though, we also need to support converting P4-14 correctly, and also assignments between varbit values. I guess that today they can be done using copy_header. Also, @akeep pointed out checksums; does the checksum work with a field list where a field is a varbit? |
Apart from the parsing, I don't see what else would need to change. Assignments and using VL fields in calculations / checksums should work fine. |
Support for this has been added in bmv2 with p4lang/behavioral-model#330
|
Thank you, this simplifies things. Can you have varbits in metadata? |
It should be possible to use a varbit metadata field as either operand of |
@antoninbas : I have started to work on this issue. I have a P4-16 file file which seems to generate json that is parsed by the simple_switch, but it crashes the switch when executing. https://github.com/mbudiu-vmw/p4c-clone/tree/issue447 shows a reproduction. The test that fails is |
BTW: the program contains just an extract and an emit of a header with a single varbit field; no other processing. |
This doesn't seem related to varbit support at all. Your two pipelines are called "cIngress" and "cEgress", but simple_switch expects "ingress" and "egress". |
At least that's what I see when I generate the JSON file for issue447-bmv2.p4 using your branch. |
* Fix for issue #638 * IRGen fixes - support for autogenerating methods in nested classes - support for friend functions - misc bug fixes * cpplint fixes * Update comment * Minor change in bmv2 backend: set action_const (#652) In the bmv2 JSON, a match-table can indicate that its default action is constant (using 'action_const') and that the default action entry (action + action parameter values) is constant (using 'action_entry_const'). `action_entry_const == true => action_const == true`. The bmv2 backend was setting 'action_entry_const' correctly, but 'action_const' was always set to false. Note that P4_16 does not make a difference between the 2, the presence of `const` in the P4_16 source implies that both attributes should be true. * Fix for issue #629 (#636) * Support emits of structs; test parsing of varbit fields (#634) * Support emits of structs; test parsing of varbit fields * Fixes issue #447 and #630 * Updated reference outputs * Additional tests and bug-fixes for varbits * Fix for issue #638 * Allow empty actions list in tables
I believe that this is fixed. |
There are several issues with varbit:
The text was updated successfully, but these errors were encountered: