Commit 98fa11217eb8362e6a87e8c608595e97ff90342d

Authored by Daniel Pieczko
Committed by Greg Kroah-Hartman
1 parent 7caaadd87d

Call efx_set_channels() before efx->type->dimension_resources()

[ Upstream commit 52ad762b85ed7947ec9eff6b036eb985352f6874 ]

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 <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 2 changed files with 9 additions and 1 deletions Side-by-side Diff

drivers/net/ethernet/sfc/ef10.c
... ... @@ -565,10 +565,17 @@
565 565 * several of each (in fact that's the only option if host
566 566 * page size is >4K). So we may allocate some extra VIs just
567 567 * for writing PIO buffers through.
  568 + *
  569 + * The UC mapping contains (min_vis - 1) complete VIs and the
  570 + * first half of the next VI. Then the WC mapping begins with
  571 + * the second half of this last VI.
568 572 */
569 573 uc_mem_map_size = PAGE_ALIGN((min_vis - 1) * EFX_VI_PAGE_SIZE +
570 574 ER_DZ_TX_PIOBUF);
571 575 if (nic_data->n_piobufs) {
  576 + /* pio_write_vi_base rounds down to give the number of complete
  577 + * VIs inside the UC mapping.
  578 + */
572 579 pio_write_vi_base = uc_mem_map_size / EFX_VI_PAGE_SIZE;
573 580 wc_mem_map_size = (PAGE_ALIGN((pio_write_vi_base +
574 581 nic_data->n_piobufs) *
drivers/net/ethernet/sfc/efx.c
... ... @@ -1603,6 +1603,8 @@
1603 1603 if (rc)
1604 1604 goto fail1;
1605 1605  
  1606 + efx_set_channels(efx);
  1607 +
1606 1608 rc = efx->type->dimension_resources(efx);
1607 1609 if (rc)
1608 1610 goto fail2;
... ... @@ -1613,7 +1615,6 @@
1613 1615 efx->rx_indir_table[i] =
1614 1616 ethtool_rxfh_indir_default(i, efx->rss_spread);
1615 1617  
1616   - efx_set_channels(efx);
1617 1618 netif_set_real_num_tx_queues(efx->net_dev, efx->n_tx_channels);
1618 1619 netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels);
1619 1620