]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-net: support XDP when not more queues
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Wed, 10 Mar 2021 02:24:45 +0000 (10:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 20:45:14 +0000 (12:45 -0800)
commit62aa5a5fc0291a6fe397bef938f5bac5a0b74517
treea74a737cc75efcf3a1a7c7b21df03caf79d954e6
parent3a2041242e2c46548513bb1d33553f40dadff68e
virtio-net: support XDP when not more queues

The number of queues implemented by many virtio backends is limited,
especially some machines have a large number of CPUs. In this case, it
is often impossible to allocate a separate queue for
XDP_TX/XDP_REDIRECT, then xdp cannot be loaded to work, even xdp does
not use the XDP_TX/XDP_REDIRECT.

This patch allows XDP_TX/XDP_REDIRECT to run by reuse the existing SQ
with __netif_tx_lock() hold when there are not enough queues.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c