Skip to content

Commit 15c3d76

Browse files
Daniel Pieczkogregkh
Daniel Pieczko
authored andcommitted
Call efx_set_channels() before efx->type->dimension_resources()
[ Upstream commit 52ad762 ] When using the "separate_tx_channels=1" module parameter, the TX queues are initially numbered starting from the first TX-only channel number (after all the RX-only channels). efx_set_channels() renumbers the queues so that they are indexed from zero. On EF10, the TX queues need to be relabelled in this way before calling the dimension_resources NIC type operation, otherwise the TX queue PIO buffers can be linked to the wrong VIs when using "separate_tx_channels=1". Added comments to explain UC/WC mappings for PIO buffers Signed-off-by: Shradha Shah <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0e4a1bc commit 15c3d76

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,17 @@ static int efx_ef10_dimension_resources(struct efx_nic *efx)
555555
* several of each (in fact that's the only option if host
556556
* page size is >4K). So we may allocate some extra VIs just
557557
* for writing PIO buffers through.
558+
*
559+
* The UC mapping contains (min_vis - 1) complete VIs and the
560+
* first half of the next VI. Then the WC mapping begins with
561+
* the second half of this last VI.
558562
*/
559563
uc_mem_map_size = PAGE_ALIGN((min_vis - 1) * EFX_VI_PAGE_SIZE +
560564
ER_DZ_TX_PIOBUF);
561565
if (nic_data->n_piobufs) {
566+
/* pio_write_vi_base rounds down to give the number of complete
567+
* VIs inside the UC mapping.
568+
*/
562569
pio_write_vi_base = uc_mem_map_size / EFX_VI_PAGE_SIZE;
563570
wc_mem_map_size = (PAGE_ALIGN((pio_write_vi_base +
564571
nic_data->n_piobufs) *

drivers/net/ethernet/sfc/efx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,8 @@ static int efx_probe_nic(struct efx_nic *efx)
15141514
if (rc)
15151515
goto fail1;
15161516

1517+
efx_set_channels(efx);
1518+
15171519
rc = efx->type->dimension_resources(efx);
15181520
if (rc)
15191521
goto fail2;
@@ -1524,7 +1526,6 @@ static int efx_probe_nic(struct efx_nic *efx)
15241526
efx->rx_indir_table[i] =
15251527
ethtool_rxfh_indir_default(i, efx->rss_spread);
15261528

1527-
efx_set_channels(efx);
15281529
netif_set_real_num_tx_queues(efx->net_dev, efx->n_tx_channels);
15291530
netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels);
15301531

0 commit comments

Comments
 (0)