-
Notifications
You must be signed in to change notification settings - Fork 444
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
backends/ebpf: Add support for XDP model. #4160
Conversation
ebpf_psa is much more featured that this backend, and also actively maintained. I assume that you want a simpler architecture. |
That's correct, the existing |
This avoids the 'root is not in the sudoers file' error.
The same instruction is already emitted in EBPFParser::emit().
As things stand, when using the ebpf backend (not PSA or TC), the emitDeparserExternCalls() causes the deparsing code to be emitted before any variables are initialised. This is obviously incorrect however wasn't noticed since the only users of the deparser code currently override this method.
13d8f4b
to
055ee08
Compare
Fixed clang-format issues and rebased onto main. |
Should fix macOS compilation error.
There seems to be one test failure in the last run but I don't understand how it can be related to these changes. From memory this test didn't fail in previous runs - could it be a one-off failure?
I have tried to reproduce locally but am hitting other issues with my VM's local configuration. Any pointers appreciated - thanks. |
Gauntlet is some kind of fuzzer written by @fruffy. It has some false positives. He has to take a look.
…________________________________
From: Thomas Calvert ***@***.***>
Sent: Thursday, September 21, 2023 8:54:51 AM
To: p4lang/p4c ***@***.***>
Cc: Mihai Budiu ***@***.***>; Mention ***@***.***>
Subject: Re: [p4lang/p4c] backends/ebpf: Add support for XDP model. (PR #4160)
There seems to be one test failure in the last run but I don't understand how it can be related to these changes. From memory this test didn't fail in previous runs - could it be a one-off failure?
1302/1627 Test #3279: testgen-p4c-bmv2-ptf/gauntlet_nested_table_calls-bmv2.p4 .................***Failed 1.82 sec
(...)
WARNING: FileNotFoundError: [Errno 2] No such file or directory: 'ptf.log'
ERROR: Error 1 when executing "ip netns exec 984d755a-b74b-4eba-9a6b-935167d2b8e3 ptf --pypath /home/runner/work/p4c/p4c/backends/bmv2 --test-dir /home/runner/work/p4c/p4c/build/tmpk1dhkqkj --list".
I have tried to reproduce locally but am hitting other issues with my VM's local configuration. Any pointers appreciated - thanks.
—
Reply to this email directly, view it on GitHub<#4160 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AET7TMTXAC26UQXSNRWJRIDX3RPMXANCNFSM6AAAAAA4ZZBJLI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This is a spurious failure that can happen because of a bug in the packet test framework. Rerunning the tests should fix the issue. |
One approval and all tests passing, so merging this in. |
This PR adds support for the
xdp_model.p4
file. It is effectively a resurrection of the p4c-xdp work by @mihaibudiu.The net effect is that it's possible to write a simple P4->eBPF program with a deparser (whereas previously one could only classify the packet).
It also adds support for running
ebpf-kernel
tests in the XDP hook (rather than TC) and includes a couple simple tests of the new functionality.The PR starts with a few minor "cleanup" type commits which hopefully aren't too controversial.
I hope that these changes don't break anything else - I have tried to run as many tests as possible but am still seeing a couple failures:
backends/ebpf/tests/test.sh
): I see these fail due toptf_out/bng.p4info.txt
not being created. Again I don't think it's caused by these changes.All the other testcases are passing as far as I can tell, and even a few more than before. :)
Note that this PR depends on #4159 and #4134 -- the commits are unfortunately duplicated here since GH can't deal with dependent PRs. I am happy to rebase this PR if/when they are merged.