aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-06-25 03:05:43 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-26 00:03:31 -0400
commit5d3a6fca955c18b066f01233f9faeb351c0d966b (patch)
tree6cc1ea2cf88a058425d003aaa53fbcc2c228f2b2
parent604f6049ba2af86fe361d4cc320443d35b232df1 (diff)
sfc: Move siena_nic_data::ipv6_rss_key to efx_nic::rx_hash_key
We will use this hash key for Toeplitz IPv4 hashing too. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/sfc/efx.c3
-rw-r--r--drivers/net/sfc/net_driver.h1
-rw-r--r--drivers/net/sfc/nic.h1
-rw-r--r--drivers/net/sfc/siena.c12
4 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index d68f061a25e9..2a90bf9df913 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1134,6 +1134,9 @@ static int efx_probe_nic(struct efx_nic *efx)
1134 * in MSI-X interrupts. */ 1134 * in MSI-X interrupts. */
1135 efx_probe_interrupts(efx); 1135 efx_probe_interrupts(efx);
1136 1136
1137 if (efx->n_channels > 1)
1138 get_random_bytes(&efx->rx_hash_key, sizeof(efx->rx_hash_key));
1139
1137 efx_set_channels(efx); 1140 efx_set_channels(efx);
1138 efx->net_dev->real_num_tx_queues = efx->n_tx_channels; 1141 efx->net_dev->real_num_tx_queues = efx->n_tx_channels;
1139 1142
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index bdec542e0c3d..28f3ff4cff4a 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -735,6 +735,7 @@ struct efx_nic {
735 unsigned n_tx_channels; 735 unsigned n_tx_channels;
736 unsigned int rx_buffer_len; 736 unsigned int rx_buffer_len;
737 unsigned int rx_buffer_order; 737 unsigned int rx_buffer_order;
738 u8 rx_hash_key[40];
738 739
739 unsigned int_error_count; 740 unsigned int_error_count;
740 unsigned long int_error_expire; 741 unsigned long int_error_expire;
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index 534461ffece8..a39822da081b 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -142,7 +142,6 @@ struct siena_nic_data {
142 u32 fw_build; 142 u32 fw_build;
143 struct efx_mcdi_iface mcdi; 143 struct efx_mcdi_iface mcdi;
144 int wol_filter_id; 144 int wol_filter_id;
145 u8 ipv6_rss_key[40];
146}; 145};
147 146
148extern void siena_print_fwver(struct efx_nic *efx, char *buf, size_t len); 147extern void siena_print_fwver(struct efx_nic *efx, char *buf, size_t len);
diff --git a/drivers/net/sfc/siena.c b/drivers/net/sfc/siena.c
index f1741b4af1b3..7fd258ce3c06 100644
--- a/drivers/net/sfc/siena.c
+++ b/drivers/net/sfc/siena.c
@@ -285,9 +285,6 @@ static int siena_probe_nic(struct efx_nic *efx)
285 goto fail5; 285 goto fail5;
286 } 286 }
287 287
288 get_random_bytes(&nic_data->ipv6_rss_key,
289 sizeof(nic_data->ipv6_rss_key));
290
291 return 0; 288 return 0;
292 289
293fail5: 290fail5:
@@ -307,7 +304,6 @@ fail1:
307 */ 304 */
308static int siena_init_nic(struct efx_nic *efx) 305static int siena_init_nic(struct efx_nic *efx)
309{ 306{
310 struct siena_nic_data *nic_data = efx->nic_data;
311 efx_oword_t temp; 307 efx_oword_t temp;
312 int rc; 308 int rc;
313 309
@@ -336,16 +332,16 @@ static int siena_init_nic(struct efx_nic *efx)
336 efx_writeo(efx, &temp, FR_AZ_RX_CFG); 332 efx_writeo(efx, &temp, FR_AZ_RX_CFG);
337 333
338 /* Enable IPv6 RSS */ 334 /* Enable IPv6 RSS */
339 BUILD_BUG_ON(sizeof(nic_data->ipv6_rss_key) != 335 BUILD_BUG_ON(sizeof(efx->rx_hash_key) <
340 2 * sizeof(temp) + FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8 || 336 2 * sizeof(temp) + FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8 ||
341 FRF_CZ_RX_RSS_IPV6_TKEY_HI_LBN != 0); 337 FRF_CZ_RX_RSS_IPV6_TKEY_HI_LBN != 0);
342 memcpy(&temp, nic_data->ipv6_rss_key, sizeof(temp)); 338 memcpy(&temp, efx->rx_hash_key, sizeof(temp));
343 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG1); 339 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG1);
344 memcpy(&temp, nic_data->ipv6_rss_key + sizeof(temp), sizeof(temp)); 340 memcpy(&temp, efx->rx_hash_key + sizeof(temp), sizeof(temp));
345 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG2); 341 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG2);
346 EFX_POPULATE_OWORD_2(temp, FRF_CZ_RX_RSS_IPV6_THASH_ENABLE, 1, 342 EFX_POPULATE_OWORD_2(temp, FRF_CZ_RX_RSS_IPV6_THASH_ENABLE, 1,
347 FRF_CZ_RX_RSS_IPV6_IP_THASH_ENABLE, 1); 343 FRF_CZ_RX_RSS_IPV6_IP_THASH_ENABLE, 1);
348 memcpy(&temp, nic_data->ipv6_rss_key + 2 * sizeof(temp), 344 memcpy(&temp, efx->rx_hash_key + 2 * sizeof(temp),
349 FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8); 345 FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH / 8);
350 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3); 346 efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3);
351 347