-
Notifications
You must be signed in to change notification settings - Fork 579
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
basic04 reuse pinned map failed. #402
Comments
Well, things to check:
You can use bpftool to check if there's more than one map loaded into the kernel, which could be an indication that the XDP program and the userspace program don't agree on which one they are using... |
thks for you help. the key point is I did not do reuse map ops between load the prog ops & attach prog ops as the assignment hints described, the solution guide did not give the right answer, I have figured out the way just like below:
|
I have tried something below try to reuse a pinned map:
step 1) load a prog to my test dev:
$ ./xdp_loader --dev test
step 2) do ping ops inside the custom NS with:
$ ./testenv.sh ping
Running ping from inside test environment:
PING fc00:dead:cafe:1::1(fc00:dead:cafe:1::1) 56 data bytes
64 bytes from fc00:dead:cafe:1::1: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=2 ttl=64 time=0.040 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=3 ttl=64 time=0.037 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=4 ttl=64 time=0.038 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=5 ttl=64 time=0.038 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=6 ttl=64 time=0.037 ms
64 bytes from fc00:dead:cafe:1::1: icmp_seq=7 ttl=64 time=0.040 ms
step3) start a stat process, and it start print XDP-action stats(XDP_PASS has increased step by step like below):
$ ./xdp_stats --dev test
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000120
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000120
XDP_PASS 1 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000120
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000120
XDP_REDIRECT 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000120
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000124
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000124
XDP_PASS 3 pkts ( 1 pps) 0 Kbytes ( 0 Mbits/s) period:2.000124
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000124
XDP_REDIRECT 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000124
...
step4) I unloaded the xdp prog with:
$ ./xdp_loader --dev test --unload-all
step5) I reload the xdp prog with resuse map logic like below:
$ ./xdp_loader --dev test
reuse logic is refered to assigment:
but the statistics value of XDP_PASS stopped, even that PING ops just going on:
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000135
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000135
XDP_PASS 65 pkts ( 0 pps) 7 Kbytes ( 0 Mbits/s) period:2.000135
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000135
XDP_REDIRECT 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000134
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000112
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000112
XDP_PASS 65 pkts ( 0 pps) 7 Kbytes ( 0 Mbits/s) period:2.000112
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000112
XDP_REDIRECT 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000112
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000139
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000139
XDP_PASS 65 pkts ( 0 pps) 7 Kbytes ( 0 Mbits/s) period:2.000139
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000139
XDP_REDIRECT 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:2.000139
It seems I failed, what's wrong and what should I do. Thks for help, plz:) @tohojo
The text was updated successfully, but these errors were encountered: