diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-06-30 01:06:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-30 17:10:04 -0400 |
commit | 765c9f46867c3253c02275cbb7a453f2eb56eda1 (patch) | |
tree | 42a2f70e2a9104c620849412d8f6ce91f30815f7 /drivers/net/sfc/nic.c | |
parent | a5b6ee291e39e285e021cf251dbcf770c83cd74e (diff) |
sfc: Add support for RX flow hash control
Allow ethtool to query the number of RX rings, the fields used in RX
flow hashing and the hash indirection table.
Allow ethtool to update the RX flow hash indirection table.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/nic.c')
-rw-r--r-- | drivers/net/sfc/nic.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index 30836578c1cc..f595d920c7c4 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c | |||
@@ -1484,22 +1484,21 @@ static irqreturn_t efx_msi_interrupt(int irq, void *dev_id) | |||
1484 | /* Setup RSS indirection table. | 1484 | /* Setup RSS indirection table. |
1485 | * This maps from the hash value of the packet to RXQ | 1485 | * This maps from the hash value of the packet to RXQ |
1486 | */ | 1486 | */ |
1487 | static void efx_setup_rss_indir_table(struct efx_nic *efx) | 1487 | void efx_nic_push_rx_indir_table(struct efx_nic *efx) |
1488 | { | 1488 | { |
1489 | int i = 0; | 1489 | size_t i = 0; |
1490 | unsigned long offset; | ||
1491 | efx_dword_t dword; | 1490 | efx_dword_t dword; |
1492 | 1491 | ||
1493 | if (efx_nic_rev(efx) < EFX_REV_FALCON_B0) | 1492 | if (efx_nic_rev(efx) < EFX_REV_FALCON_B0) |
1494 | return; | 1493 | return; |
1495 | 1494 | ||
1496 | for (offset = FR_BZ_RX_INDIRECTION_TBL; | 1495 | BUILD_BUG_ON(ARRAY_SIZE(efx->rx_indir_table) != |
1497 | offset < FR_BZ_RX_INDIRECTION_TBL + 0x800; | 1496 | FR_BZ_RX_INDIRECTION_TBL_ROWS); |
1498 | offset += 0x10) { | 1497 | |
1498 | for (i = 0; i < FR_BZ_RX_INDIRECTION_TBL_ROWS; i++) { | ||
1499 | EFX_POPULATE_DWORD_1(dword, FRF_BZ_IT_QUEUE, | 1499 | EFX_POPULATE_DWORD_1(dword, FRF_BZ_IT_QUEUE, |
1500 | i % efx->n_rx_channels); | 1500 | efx->rx_indir_table[i]); |
1501 | efx_writed(efx, &dword, offset); | 1501 | efx_writed_table(efx, &dword, FR_BZ_RX_INDIRECTION_TBL, i); |
1502 | i++; | ||
1503 | } | 1502 | } |
1504 | } | 1503 | } |
1505 | 1504 | ||
@@ -1634,7 +1633,7 @@ void efx_nic_init_common(struct efx_nic *efx) | |||
1634 | EFX_INVERT_OWORD(temp); | 1633 | EFX_INVERT_OWORD(temp); |
1635 | efx_writeo(efx, &temp, FR_AZ_FATAL_INTR_KER); | 1634 | efx_writeo(efx, &temp, FR_AZ_FATAL_INTR_KER); |
1636 | 1635 | ||
1637 | efx_setup_rss_indir_table(efx); | 1636 | efx_nic_push_rx_indir_table(efx); |
1638 | 1637 | ||
1639 | /* Disable the ugly timer-based TX DMA backoff and allow TX DMA to be | 1638 | /* Disable the ugly timer-based TX DMA backoff and allow TX DMA to be |
1640 | * controlled by the RX FIFO fill level. Set arbitration to one pkt/Q. | 1639 | * controlled by the RX FIFO fill level. Set arbitration to one pkt/Q. |