diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-06-25 03:05:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-26 00:03:32 -0400 |
commit | 477e54eba4fd092704e50e65ade79463bd17fa85 (patch) | |
tree | cdef631b8e1e3a48578effbced82907026ef3ef8 /drivers/net/sfc | |
parent | 5d3a6fca955c18b066f01233f9faeb351c0d966b (diff) |
sfc: Use Toeplitz IPv4 hash for RSS and hash insertion
Insertion of the Falcon hash is unreliable.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/falcon.c | 14 | ||||
-rw-r--r-- | drivers/net/sfc/siena.c | 11 |
2 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 5a40145f6584..4f9d33f3cca1 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1581,8 +1581,14 @@ static void falcon_init_rx_cfg(struct efx_nic *efx) | |||
1581 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, data_xoff_thr); | 1581 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, data_xoff_thr); |
1582 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); | 1582 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_TX_TH, ctrl_xon_thr); |
1583 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); | 1583 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_TX_TH, ctrl_xoff_thr); |
1584 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_INSRT_HDR, 1); | ||
1585 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); | 1584 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_INGR_EN, 1); |
1585 | |||
1586 | /* Enable hash insertion. This is broken for the | ||
1587 | * 'Falcon' hash so also select Toeplitz TCP/IPv4 and | ||
1588 | * IPv4 hashes. */ | ||
1589 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_INSRT_HDR, 1); | ||
1590 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_HASH_ALG, 1); | ||
1591 | EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_IP_HASH, 1); | ||
1586 | } | 1592 | } |
1587 | /* Always enable XOFF signal from RX FIFO. We enable | 1593 | /* Always enable XOFF signal from RX FIFO. We enable |
1588 | * or disable transmission of pause frames at the MAC. */ | 1594 | * or disable transmission of pause frames at the MAC. */ |
@@ -1656,8 +1662,12 @@ static int falcon_init_nic(struct efx_nic *efx) | |||
1656 | 1662 | ||
1657 | falcon_init_rx_cfg(efx); | 1663 | falcon_init_rx_cfg(efx); |
1658 | 1664 | ||
1659 | /* Set destination of both TX and RX Flush events */ | ||
1660 | if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) { | 1665 | if (efx_nic_rev(efx) >= EFX_REV_FALCON_B0) { |
1666 | /* Set hash key for IPv4 */ | ||
1667 | memcpy(&temp, efx->rx_hash_key, sizeof(temp)); | ||
1668 | efx_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY); | ||
1669 | |||
1670 | /* Set destination of both TX and RX Flush events */ | ||
1661 | EFX_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0); | 1671 | EFX_POPULATE_OWORD_1(temp, FRF_BZ_FLS_EVQ_ID, 0); |
1662 | efx_writeo(efx, &temp, FR_BZ_DP_CTRL); | 1672 | efx_writeo(efx, &temp, FR_BZ_DP_CTRL); |
1663 | } | 1673 | } |
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c index 7fd258ce3c06..3fab030f8ab5 100644 --- a/drivers/net/sfc/siena.c +++ b/drivers/net/sfc/siena.c | |||
@@ -327,10 +327,19 @@ static int siena_init_nic(struct efx_nic *efx) | |||
327 | 327 | ||
328 | efx_reado(efx, &temp, FR_AZ_RX_CFG); | 328 | efx_reado(efx, &temp, FR_AZ_RX_CFG); |
329 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_DESC_PUSH_EN, 0); | 329 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_DESC_PUSH_EN, 0); |
330 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_HASH_INSRT_HDR, 1); | ||
331 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_INGR_EN, 1); | 330 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_INGR_EN, 1); |
331 | /* Enable hash insertion. This is broken for the 'Falcon' hash | ||
332 | * if IPv6 hashing is also enabled, so also select Toeplitz | ||
333 | * TCP/IPv4 and IPv4 hashes. */ | ||
334 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_HASH_INSRT_HDR, 1); | ||
335 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_HASH_ALG, 1); | ||
336 | EFX_SET_OWORD_FIELD(temp, FRF_BZ_RX_IP_HASH, 1); | ||
332 | efx_writeo(efx, &temp, FR_AZ_RX_CFG); | 337 | efx_writeo(efx, &temp, FR_AZ_RX_CFG); |
333 | 338 | ||
339 | /* Set hash key for IPv4 */ | ||
340 | memcpy(&temp, efx->rx_hash_key, sizeof(temp)); | ||
341 | efx_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY); | ||
342 | |||
334 | /* Enable IPv6 RSS */ | 343 | /* Enable IPv6 RSS */ |
335 | BUILD_BUG_ON(sizeof(efx->rx_hash_key) < | 344 | BUILD_BUG_ON(sizeof(efx->rx_hash_key) < |
336 | 2 * sizeof(temp) + FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8 || | 345 | 2 * sizeof(temp) + FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8 || |