sfc: fallback for lack of xdp tx queues
authorÍñigo Huguet <ihuguet@redhat.com>
Thu, 9 Sep 2021 09:28:45 +0000 (11:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Sep 2021 10:17:37 +0000 (11:17 +0100)
commit415446185b939dcdcd6a483e705c805ab961e54c
tree36b7b984b10d9042349c6b8b1128109dc1c5b402
parent2a48d96fd58a666ae231c3dd6fe4a458798ac645
sfc: fallback for lack of xdp tx queues

If there are not enough resources to allocate one TX queue per core for
XDP TX it was completely disabled.

This patch implements a fallback solution for sharing the available
queues using __netif_tx_lock for synchronization. In the normal case that
there is one TX queue per CPU, no locking is done, as it was before.

With this fallback solution, XDP TX will work in much more cases that
were failing, specially in machines with many CPUs. It's hard for XDP
users to know what features are supported across different NICs and
configurations, so they will benefit on having wider support.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx_channels.c
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/tx.c