aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40evf_main.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-11-16 09:23:13 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-16 15:59:12 -0500
commit22f258a1cc2f35d2f5800276360c2aeed385b24e (patch)
treef7d73be86d3e49f6f9114b8089532e373aea063d /drivers/net/ethernet/intel/i40evf/i40evf_main.c
parentc41a4fba4a220c644ba6641c779cf427729f2eec (diff)
i40e: use netdev_rss_key_fill() helper
Use of well known RSS key increases attack surface. Switch to a random one, using generic helper so that all ports share a common key. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40evf_main.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index f0d07ad54198..489227891ffb 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1434,18 +1434,12 @@ static int next_queue(struct i40evf_adapter *adapter, int j)
1434 **/ 1434 **/
1435static void i40evf_configure_rss(struct i40evf_adapter *adapter) 1435static void i40evf_configure_rss(struct i40evf_adapter *adapter)
1436{ 1436{
1437 u32 rss_key[I40E_VFQF_HKEY_MAX_INDEX + 1];
1437 struct i40e_hw *hw = &adapter->hw; 1438 struct i40e_hw *hw = &adapter->hw;
1438 u32 lut = 0; 1439 u32 lut = 0;
1439 int i, j; 1440 int i, j;
1440 u64 hena; 1441 u64 hena;
1441 1442
1442 /* Set of random keys generated using kernel random number generator */
1443 static const u32 seed[I40E_VFQF_HKEY_MAX_INDEX + 1] = {
1444 0x794221b4, 0xbca0c5ab, 0x6cd5ebd9, 0x1ada6127,
1445 0x983b3aa1, 0x1c4e71eb, 0x7f6328b2, 0xfcdc0da0,
1446 0xc135cafa, 0x7a6f7e2d, 0xe7102d28, 0x163cd12e,
1447 0x4954b126 };
1448
1449 /* No RSS for single queue. */ 1443 /* No RSS for single queue. */
1450 if (adapter->num_active_queues == 1) { 1444 if (adapter->num_active_queues == 1) {
1451 wr32(hw, I40E_VFQF_HENA(0), 0); 1445 wr32(hw, I40E_VFQF_HENA(0), 0);
@@ -1454,8 +1448,9 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
1454 } 1448 }
1455 1449
1456 /* Hash type is configured by the PF - we just supply the key */ 1450 /* Hash type is configured by the PF - we just supply the key */
1451 netdev_rss_key_fill(rss_key, sizeof(rss_key));
1457 for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) 1452 for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
1458 wr32(hw, I40E_VFQF_HKEY(i), seed[i]); 1453 wr32(hw, I40E_VFQF_HKEY(i), rss_key[i]);
1459 1454
1460 /* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */ 1455 /* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */
1461 hena = I40E_DEFAULT_RSS_HENA; 1456 hena = I40E_DEFAULT_RSS_HENA;