xdp-project / xdp-tutorial

XDP tutorial
2.43k stars 574 forks source link

advanced03-AF_XDP: Gotcha by RX-queue id binding #108

Open simonhf opened 4 years ago

simonhf commented 4 years ago

Section [1] warns about multiple NIC queues, but AFAICT veth, at least by default, does not use multiple queues. So now to the question: Is there a way to make veth use multiple queue for testing XDP code (I Googled hard but nothing was coming up...)? Or is the only way to test that code with real hardware NICs which also use multiple queues?

[1] https://github.com/xdp-project/xdp-tutorial/tree/master/advanced03-AF_XDP#gotcha-by-rx-queue-id-binding

tohojo commented 4 years ago

Simon Hardy-Francis notifications@github.com writes:

Section [1] warns about multiple NIC queues, but AFAICT veth, at least by default, does not use multiple queues. So now to the question: Is there a way to make veth use multiple queue for testing XDP code (I Googled hard but nothing was coming up...)? Or is the only way to test that code with real hardware NICs which also use multiple queues?

You can set the number of veth queues when you create the device using the numtxqueues and numrxqueues parameters to 'ip link'. See 'man ip-link'. I think you probably need to have the same number of TX and RX queues for things to work the way you expect with XDP...