Skip to content
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

p4c-bm2-ss compiler bug: could not convert Checksum16 to Json #741

Closed
tomrodeheffer opened this issue Jun 27, 2017 · 5 comments
Closed

p4c-bm2-ss compiler bug: could not convert Checksum16 to Json #741

tomrodeheffer opened this issue Jun 27, 2017 · 5 comments
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.

Comments

@tomrodeheffer
Copy link

I wrote the following program to try out the Checksum16 extern: checksum.p4.txt
But p4c-bm2-ss says:

In file: ../backends/bmv2/expression.cpp:82
Compiler Bug: checksum.p4(38): ck_1/ck;: could not convert to Json
    hdr.h.cksm = ck.get(hdr.h);
                 ^^

Is Checksum16 supported in p4c-bm2-ss? If not, I would expect to see some remark about that in the documentation and a better error message from the compiler.

@mihaibudiu mihaibudiu added the bug This behavior is unintended and should be fixed. label Jul 20, 2017
@mihaibudiu
Copy link
Contributor

The documentation is really lacking, indeed.
Checksums can be only instantiated in the verifyChecksum and updateChecksum controls.
The error message is bad, so we'll keep this as a bug.

@jafingerhut
Copy link
Contributor

I was running a test case yesterday with someone using v1model.p4 using the 2017-Jun-19 latest versions of p4c-bm2-ss and p4lang/behavioral-model's simple_switch, and it seems that nothing in the verifyCheckum and updateChecksum controls is executed in simple_switch. Not 100% sure, but we had some evidence pointing that way.

@mihaibudiu
Copy link
Contributor

BMv2 ignores checksum verify statements, even in P4-14.
If the update does not work then you can't really modify IPv4 headers.
We have issue #655, which still seems to be open. @hanw assigned himself for this one.

@antoninbas
Copy link
Member

Actually bmv2 now logs an error message if a packet has an invalid checksum, but does not drop the packet. This was implemented a couple months ago.

@mihaibudiu
Copy link
Contributor

I hope that the new checksum APIs in v1model make this a non-issue,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

4 participants