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

packet03-assignment-04: packet have been redirect, xdp_stats have recored the redirect action, but the statistics of ethtool is wrong #424

Open
daiminglong opened this issue May 18, 2024 · 1 comment

Comments

@daiminglong
Copy link

daiminglong commented May 18, 2024

case1: redirect to outside
veth0(10.11.1.2) <----> test(10.11.1.1) <--xdp_route_fib_lookup_redirect--> eth1(9.134.119.213) <---> internet

case2: redirect to another namespace
veth0(10.11.1.2) <----> test(10.11.1.1) <--xdp_route_fib_lookup_redirect--> test1(10.11.2.1) <---> veth0(10.11.2.2)

result:
case2 ping 10.11.2.2 is success
case1 ping 183.2.172.42(i'm sure about that the route is reachable and can be ping successful from outside ns)failed with stats like below:
[root@xxxxx]# ./xdp_stats -d test
XDP-action
XDP_ABORTED 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:0.250111
XDP_DROP 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:0.250084
XDP_PASS 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:0.250084
XDP_TX 0 pkts ( 0 pps) 0 Kbytes ( 0 Mbits/s) period:0.250084
XDP_REDIRECT 26 pkts ( 0 pps) 2 Kbytes ( 0 Mbits/s) period:0.250084

[root@xxx]# ethtool -S test
NIC statistics:
peer_ifindex: 2
rx_queue_0_xdp_packets: 207
rx_queue_0_xdp_bytes: 17388
rx_queue_0_xdp_drops: 146 ???????

the xdp_stats record my pkt is redirect successed, but the interface statistics showed that the packet is dropped by xdp?
can anybody help with this, thankyou :)
@aspsk

@ncshy
Copy link

ncshy commented Jul 11, 2024

Can you verify if your redirected packet has the correct MAC addresses, by verifying that fib_params.dmac and fib_params.smac correspond to your gateway (route -n) and ARP table entry for your gateway device(arp -n).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants