<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 26, 2024 at 1:53 AM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 25 Jan 2024 10:48:07 +0200<br>
Pavel Vazharov <<a href="mailto:freakpv@gmail.com" target="_blank">freakpv@gmail.com</a>> wrote:<br>
<br>
> Hi there,<br>
> <br>
> I'd like to ask for advice for a weird issue that I'm facing trying to run<br>
> XDP on top of a bonding device (802.3ad) (and also on the physical<br>
> interfaces behind the bond).<br>
> <br>
> I've a DPDK application which runs on top of XDP sockets, using the DPDK AF_XDP<br>
> driver <<a href="https://doc.dpdk.org/guides/nics/af_xdp.html" rel="noreferrer" target="_blank">https://doc.dpdk.org/guides/nics/af_xdp.html</a>>. It was a pure DPDK<br>
> application but lately it was migrated to run on top of XDP sockets because<br>
> we need to split the traffic entering the machine between the DPDK<br>
> application and other "standard-Linux" applications running on the same<br>
> machine.<br>
> The application works fine when running on top of a single interface but it<br>
> has problems when it runs on top of a bonding interface. It needs to be<br>
> able to run with multiple XDP sockets where each socket (or group of XDP<br>
> sockets) is/are handled in a separate thread. However, the bonding device<br>
> is reported with a single queue and thus the application can't open more<br>
> than one  XDP socket for it. So I've tried binding the XDP sockets to the<br>
> queues of the physical interfaces. For example:<br>
> - 3 interfaces each one is set to have 8 queues<br>
> - I've created 3 virtual af_xdp devices each one with 8 queues i.e. in<br>
> summary 24 XDP sockets each bound to a separate queue (this functionality<br>
> is provided by the DPDK itself).<br>
> - I've run the application on 2 threads where the first thread handled the<br>
> first 12 queues (XDP sockets) and the second thread handled the next 12<br>
> queues (XDP socket) i.e. the first thread worked with all 8 queues from<br>
> af_xdp device 0 and the first 4 queues from af_xdp device 1. The second<br>
> thread worked with the next 4 queues from af_xdp device 1 and all 8 queues<br>
> from af_xdp device 2. I've also tried another distribution scheme (see<br>
> below). The given threads just call the receve/transmit functions provided<br>
> by the DPDK for the assigned queues.<br>
> - The problem is that with this scheme the network device on the other side<br>
> reports: "The member of the LACP mode Eth-Trunk interface received an<br>
> abnormal LACPDU, which may be caused by optical fiber misconnection". And<br>
> this error is always reported for the last device/interface in the bonding<br>
> and the bonding/LACP doesn't work.<br>
> - Another thing is that if I run the DPDK application on a single thread,<br>
> and the sending/receiving on all queues is handled on a single thread, then<br>
> the bonding seems to work correctly and the above error is not reported.<br>
> - I've checked the code multiple times and I'm sure that each thread is<br>
> accessing its own group of queues/sockets.<br>
> - I've tried 2 different schemes of accessing but each one led to the same<br>
> issue. For example (device_idx - queue_idx), I've tried these two orders of<br>
> accessing:<br>
> Thread 1        Thread2<br>
> (0 - 0)             (1 - 4)<br>
> (0 - 1)             (1 - 5)<br>
> ...                    (1 - 6)<br>
> ...                    (1 - 7)<br>
> (0 - 7)             (2 - 0)<br>
> (1 - 0)             (2 - 1)<br>
> (1 - 1)             ...<br>
> (1 - 2)             ...<br>
> (1 - 3)             (2 - 7)<br>
> <br>
> Thread 1        Thread2<br>
> (0 - 0)             (0 - 4)<br>
> (1 - 0)             (1 - 4)<br>
> (2 - 0)             (2 - 4)<br>
> (0 - 1)             (0 - 5)<br>
> (1 - 1)             (1 - 5)<br>
> (2 - 1)             (2 - 5)<br>
> ...                    ...<br>
> (0 - 3)             (0 - 7)<br>
> (1 - 3)             (1 - 7)<br>
> (2 - 3)             (2 - 7)<br>
> <br>
> And here are my questions based on the above situation:<br>
> 1. I assumed that it's not possible to run multiple XDP sockets on top of<br>
> the bonding device itself and I need to "bind" the XDP sockets on the<br>
> physical interfaces behind the bonding device. Am I right about this or am<br>
> I missing something?<br>
> 2. Is the bonding logic (LACP management traffic) affected by the access<br>
> pattern of the XDP sockets?<br>
> 3. Is this scheme supposed to work or it's just that the design is wrong? I<br>
> mean, maybe a group of queues/sockets shouldn't be handled on a given<br>
> thread but only a single queue should be handled on a given application<br>
> thread. It's just that the physical devices have more queues setup on them<br>
> than the number of threads in the DPDK application and thus multiple queues<br>
> need to be handled on a single application thread.<br>
> <br>
> Any ideas are appreciated!<br>
> <br>
> Regards,<br>
> Pavel.<br>
<br>
Look at recent discussions on netdev mailing list.<br>
Linux bonding device still needs more work to fully support XDP.<br></blockquote><div>Thank you. Will do so. <br></div></div></div>