xdp-tutorial icon indicating copy to clipboard operation
xdp-tutorial copied to clipboard

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

Open daiminglong opened this issue 1 month ago • 0 comments

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

daiminglong avatar May 18 '24 09:05 daiminglong