Skip to content

Commit e84a1e1

Browse files
ihuguetdavem330
authored andcommitted
sfc: fix XDP queues mode with legacy IRQ
In systems without MSI-X capabilities, xdp_txq_queues_mode is calculated in efx_allocate_msix_channels, but when enabling MSI-X fails, it was not changed to a proper default value. This was leading to the driver thinking that it has dedicated XDP queues, when it didn't. Fix it by setting xdp_txq_queues_mode to the correct value if the driver fallbacks to MSI or legacy IRQ mode. The correct value is EFX_XDP_TX_QUEUES_BORROWED because there are no XDP dedicated queues. The issue can be easily visible if the kernel is started with pci=nomsi, then a call trace is shown. It is not shown only with sfc's modparam interrupt_mode=2. Call trace example: WARNING: CPU: 2 PID: 663 at drivers/net/ethernet/sfc/efx_channels.c:828 efx_set_xdp_channels+0x124/0x260 [sfc] [...skip...] Call Trace: <TASK> efx_set_channels+0x5c/0xc0 [sfc] efx_probe_nic+0x9b/0x15a [sfc] efx_probe_all+0x10/0x1a2 [sfc] efx_pci_probe_main+0x12/0x156 [sfc] efx_pci_probe_post_io+0x18/0x103 [sfc] efx_pci_probe.cold+0x154/0x257 [sfc] local_pci_probe+0x42/0x80 Fixes: 6215b60 ("sfc: last resort fallback for lack of xdp tx queues") Reported-by: Yanghang Liu <yanghliu@redhat.com> Signed-off-by: Íñigo Huguet <ihuguet@redhat.com> Acked-by: Martin Habets <habetsm.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0c0cf3d commit e84a1e1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/net/ethernet/sfc/efx_channels.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ int efx_probe_interrupts(struct efx_nic *efx)
301301
efx->tx_channel_offset = 0;
302302
efx->n_xdp_channels = 0;
303303
efx->xdp_channel_offset = efx->n_channels;
304+
efx->xdp_txq_queues_mode = EFX_XDP_TX_QUEUES_BORROWED;
304305
rc = pci_enable_msi(efx->pci_dev);
305306
if (rc == 0) {
306307
efx_get_channel(efx, 0)->irq = efx->pci_dev->irq;
@@ -322,6 +323,7 @@ int efx_probe_interrupts(struct efx_nic *efx)
322323
efx->tx_channel_offset = efx_separate_tx_channels ? 1 : 0;
323324
efx->n_xdp_channels = 0;
324325
efx->xdp_channel_offset = efx->n_channels;
326+
efx->xdp_txq_queues_mode = EFX_XDP_TX_QUEUES_BORROWED;
325327
efx->legacy_irq = efx->pci_dev->irq;
326328
}
327329

drivers/net/ethernet/sfc/siena/efx_channels.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
302302
efx->tx_channel_offset = 0;
303303
efx->n_xdp_channels = 0;
304304
efx->xdp_channel_offset = efx->n_channels;
305+
efx->xdp_txq_queues_mode = EFX_XDP_TX_QUEUES_BORROWED;
305306
rc = pci_enable_msi(efx->pci_dev);
306307
if (rc == 0) {
307308
efx_get_channel(efx, 0)->irq = efx->pci_dev->irq;
@@ -323,6 +324,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
323324
efx->tx_channel_offset = efx_siena_separate_tx_channels ? 1 : 0;
324325
efx->n_xdp_channels = 0;
325326
efx->xdp_channel_offset = efx->n_channels;
327+
efx->xdp_txq_queues_mode = EFX_XDP_TX_QUEUES_BORROWED;
326328
efx->legacy_irq = efx->pci_dev->irq;
327329
}
328330

0 commit comments

Comments
 (0)