-
Notifications
You must be signed in to change notification settings - Fork 26
Can't set 48 bit field in header #53
Comments
Can you please post a complete P4 program which we can add to the testsuite? |
I thought I have fixed the |
I have pushed a PR that tries to fix this, but my testing is not very good. |
The p4 I'm trying to compile is attached. I'm using the docker image provided to build and did a git pull to make sure I have the latest changes. Still got the errors above. Also, does p4c-xdp support 'const entries' yet? I commented it out for now as I get syntax errors trying to implement it. |
Indeed, this back-end is much behind the other ones. |
If you integrate the pending PR p4lang/p4c#987 into the ebpf back-end, the code that is generated looks reasonable (but I didn't test it); hopefully someone will review the PR so we can merge it. I don't see any problems with isValid in actions. Please pull the latest versions for both p4c and p4c-xdp. I can also send you the output file by email so we can compare notes. |
BTW: I filed this issue p4lang/p4c#991 about table initializers. |
We have merged the PR with support for up to 64-bit constants into the ebpf compiler. |
I uncomment your xdp_vlan_to_vxlan.p4.txt and both setValid() and the const entries work OK on 4.14 kernel. Although I again hit some verifier issue, but it's not related to this. |
We are not generating code for the initializers for tables. |
I see, thanks! |
Trying to set 48 bit fields fields causes an error as shown below. Setting 32 bit fields does work.
It seems like the function
memcpy
tries to use the value to which the field must be set as an address:18838586676582 = 0x112233445566 (the value to which the MAC address should be set)
memcpy(&hd.outer_eth.destination, &18838586676582, 6);
For some reason I also can't use
setValid();
inside an action. When using it directly inside theapply{}
block it works.P4 Code:
Errors:
The text was updated successfully, but these errors were encountered: