diff options
author | Edward Cree <ecree@solarflare.com> | 2020-06-29 15:33:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-30 02:37:48 +0200 |
commit | de5f32e2b6301c1f6780b3ae9c2740a5e422e2da (patch) | |
tree | cd02ca00c551e20f3b52536bd67ee2fe93df66ec /drivers/net/ethernet/sfc/efx_channels.c | |
parent | sfc: extend bitfield macros up to POPULATE_DWORD_13 (diff) | |
download | linux-de5f32e2b6301c1f6780b3ae9c2740a5e422e2da.tar.xz linux-de5f32e2b6301c1f6780b3ae9c2740a5e422e2da.zip |
sfc: don't try to create more channels than we can have VIs
Calculate efx->max_vis at probe time, and check against it in
efx_allocate_msix_channels() when considering whether to create XDP TX
channels.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx_channels.c')
-rw-r--r-- | drivers/net/ethernet/sfc/efx_channels.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index c492523b986c..2c3510b0524a 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -175,6 +175,13 @@ static int efx_allocate_msix_channels(struct efx_nic *efx, efx->n_xdp_channels = 0; efx->xdp_tx_per_channel = 0; efx->xdp_tx_queue_count = 0; + } else if (n_channels + n_xdp_tx > efx->max_vis) { + netif_err(efx, drv, efx->net_dev, + "Insufficient resources for %d XDP TX queues (%d other channels, max VIs %d)\n", + n_xdp_tx, n_channels, efx->max_vis); + efx->n_xdp_channels = 0; + efx->xdp_tx_per_channel = 0; + efx->xdp_tx_queue_count = 0; } else { efx->n_xdp_channels = n_xdp_ev; efx->xdp_tx_per_channel = EFX_TXQ_TYPES; |