Re: AF_XDP busy poll and TX path

Federico Parola <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <[email protected]>
Hello everybody,
sorry for bringing this up again, but I didn't receive any answer and 
I'm still experiencing this problem on kernel 5.14.
Does anybody have some insight on whether this is an expected behavior, 
a bug, or maybe just some problem in my code?

Best regards,
Federico Parola

On 04/08/21 10:55, Federico Parola wrote:
> Dear all,
> I made some changes to the xdpsock kernel example to support the l2fwd 
> scenario between two interfaces. I didn't use the xsk_fwd sample because 
> I didn't need the complex umem management used there.
> The updated code can be found here:
> https://pastebin.com/p54T5nfW
> (I'd be happy to submit it to the kernel, with proper modifications, if 
> you deem it useful, just let me know).
> 
> I get a strange behavior when using busy polling on two interfaces. Here 
> are the numbers I get when testing on a Intel XL710 dual port NIC (i40e 
> driver). I ran all the tests on a single core (both user space and 
> interrupts) and tuned the input rate to achieve maximum throughput (this 
> was fundamental in the non busy poll tests). When running in busy poll 
> both interfaces are configured with:
> 
> $ echo 2 | sudo tee /sys/class/net/<if>/napi_defer_hard_irqs
> $ echo 200000 | sudo tee /sys/class/net/<if>/gro_flush_timeout
> 
> TEST     | Mpps
> ---------+-------
> 1 if     | 10.77
> 1 if BP  | 13.01
> 2 ifs    | 9.49
> 2 ifs BP | 7.25
> (BP = busy poll with default batch size, 64)
> 
> As you can see when I move from 1 interface to 2 interfaces in the 
> non-busy-poll mode performance reduces a bit, but I think this makes 
> sense since we are handling data structures for two ports instead of one 
> (does it make sense?).
> What I don't understand is why performance on 2 ifs is lower when using 
> busy polling. I made some tests and saw that with two interfaces there 
> is some sofirq CPU usage and the tx port keeps generating interrupts, 
> while this doesn't happen when using a single interface.
> 
> My question is: should interrupts and softirq processing be disabled on 
> the tx path as well, when using busy polling? Or is it just a rx feature?
> 
> Best regards,
> Federico Parola
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.