xdp-project / bpf-examples

Making eBPF programming easier via build env and examples
395 stars 79 forks source link

How to fix linux kernel don't trigger tx_ring #95

Open xjj210130 opened 11 months ago

xjj210130 commented 11 months ago

HI all: My env is centos 7. core is 5.15.46 (build by myself) gcc 11.2.1 clang 14.0.6 llvm 14.0.6 bpftool is v5.15.46. I use bpf_redirect(redirectIfindex, 0);

to redirect packet. The para redirectIfindex is index network(sfp2). However, i see there is no packet sent. cat /sys/class/net/sfp2/statistics/tx_packets The number is the same.

when i use xdp SKB model , the number change. But when i use NATIVE model, the number is the same. i build AF_XDP config

I use xdpdump/tcpdump to capture packet. There is no packet sent. Is it any way to fix it ? Thanks

sachintiptur commented 9 months ago

Then your NIC driver doesn't support xdp hook i guess. AF_XDP is for sending pkts to user space.