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

Packets arrival during xdp loading

Open Adarsh97 opened this issue 2 years ago • 13 comments

I am having an interesting observation. If I am receiving network packets through the nic, while loading xdp my throughout is getting reduced (this throughput is consistent with a reduction from the expected throughput). If I am receiving packets only after xdp loading on the interface I am getting full throughput. For example if receiving packets, while loading xdp I am getting consistently the same reduced throughput of 400mbps, but expected was 600mbps, which I will receive if packets are coming after xdp load ? What is the reason for it ? Any clear I have to perform ? Should I down the nic during xdp load ? @magnus-karlsson @tohojo

Adarsh97 avatar Apr 07 '22 16:04 Adarsh97

How are you receiving these packets? Is this TCP? Using what tool? How long did you wait to see if it recovered after the load?

tohojo avatar Apr 07 '22 16:04 tohojo

Packets are UDP. Transmission is multicast. We are using xdp and af_xdp. I have waited for 10 minute. I am consistently seeing the same reduced throughput. It seems it's not recovering.

Adarsh97 avatar Apr 07 '22 16:04 Adarsh97

Packets are sending with UDP c program

Adarsh97 avatar Apr 07 '22 16:04 Adarsh97

Can I down the nic just before xdp load and make it up just after loading. Will that work ?

Adarsh97 avatar Apr 07 '22 16:04 Adarsh97

Your receiver is using AF_XDP? So how are you receiving packets prior to loading an XDP program?

tohojo avatar Apr 07 '22 16:04 tohojo

I am receiving packets after loading xdp only. Packets are continuously coming in the nic at 1gbps rate. During that I try to load xdp, then the reduced throughput I am observing consistently. The same behaviour is not observed if there is no active packets in the link and if I try loading xdp and then sending packets, I am getting full throughput

Adarsh97 avatar Apr 07 '22 16:04 Adarsh97

Ah, right, so what you mean is that it depends on which order you start the receiver and sender in?

Where do the rest of the packets go? What does ethtool -S tell you? And which NIC/driver is this?

tohojo avatar Apr 07 '22 17:04 tohojo

Yeah exactly. I am seeing an order dependency of starting of sender and receiver. The os is RHEL 8.4 Do I need to do any clearing operation ? Making the link down just before xdp load and making it up right after the load will resolve the issue ?

Adarsh97 avatar Apr 07 '22 17:04 Adarsh97

@tohojo @magnus-karlsson @netoptimizer @dmitris @davem330 any idea on this ?

Adarsh97 avatar Apr 07 '22 19:04 Adarsh97

What NIC are you using?

magnus-karlsson avatar Apr 08 '22 06:04 magnus-karlsson

Details are as follows Ixgbe Kernel driver : ixgbe Kernel modules : ixgbe Ethernet controller : intel corporation Ethernet connection X552 GbE Backplane

Adarsh97 avatar Apr 08 '22 08:04 Adarsh97

I hope we are having support for the above one ? Does clock speed having any role here ? Or hyper threading ?

Adarsh97 avatar Apr 08 '22 09:04 Adarsh97

XDP_DRV is supported on ixgbe. I tried the two samples xdp1 and xdp2 found in samples/bpf and I get the same throughput independent on traffic being started after or before launching the program. Can you please try these out on your system? After that, please try them out with the latest and greatest kernel from bpf-next or net-next. I do not know what kernel RHEL 8.4 contains.

magnus-karlsson avatar Apr 08 '22 11:04 magnus-karlsson