Commit e26ca4b5 authored by Ivan Babrou's avatar Ivan Babrou Committed by Jakub Kicinski

sfc: reduce the number of requested xdp ev queues

Without this change the driver tries to allocate too many queues,
breaching the number of available msi-x interrupts on machines
with many logical cpus and default adapter settings:

Insufficient resources for 12 XDP event queues (24 other channels, max 32)

Which in turn triggers EINVAL on XDP processing:

sfc 0000:86:00.0 ext0: XDP TX failed (-22)
Signed-off-by: default avatarIvan Babrou <ivan@cloudflare.com>
Acked-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20210120212759.81548-1-ivan@cloudflare.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e7ed11ee
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "rx_common.h" #include "rx_common.h"
#include "nic.h" #include "nic.h"
#include "sriov.h" #include "sriov.h"
#include "workarounds.h"
/* This is the first interrupt mode to try out of: /* This is the first interrupt mode to try out of:
* 0 => MSI-X * 0 => MSI-X
...@@ -137,6 +138,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx, ...@@ -137,6 +138,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
{ {
unsigned int n_channels = parallelism; unsigned int n_channels = parallelism;
int vec_count; int vec_count;
int tx_per_ev;
int n_xdp_tx; int n_xdp_tx;
int n_xdp_ev; int n_xdp_ev;
...@@ -149,9 +151,9 @@ static int efx_allocate_msix_channels(struct efx_nic *efx, ...@@ -149,9 +151,9 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
* multiple tx queues, assuming tx and ev queues are both * multiple tx queues, assuming tx and ev queues are both
* maximum size. * maximum size.
*/ */
tx_per_ev = EFX_MAX_EVQ_SIZE / EFX_TXQ_MAX_ENT(efx);
n_xdp_tx = num_possible_cpus(); n_xdp_tx = num_possible_cpus();
n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, EFX_MAX_TXQ_PER_CHANNEL); n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, tx_per_ev);
vec_count = pci_msix_vec_count(efx->pci_dev); vec_count = pci_msix_vec_count(efx->pci_dev);
if (vec_count < 0) if (vec_count < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment