e100e: use netdev_rss_key_fill() helper
authorEric Dumazet <edumazet@google.com>
Sun, 16 Nov 2014 14:23:11 +0000 (06:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Nov 2014 20:59:12 +0000 (15:59 -0500)
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>
drivers/net/ethernet/intel/e1000e/netdev.c

index 247335d2c7ec26cb9c50bb93c6a675b4ff35879a..370cfa275ddbd0638f874105e8b15e0eb9430cbd 100644 (file)
@@ -3449,15 +3449,12 @@ static void e1000e_setup_rss_hash(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
        u32 mrqc, rxcsum;
+       u32 rss_key[10];
        int i;
-       static const u32 rsskey[10] = {
-               0xda565a6d, 0xc20e5b25, 0x3d256741, 0xb08fa343, 0xcb2bcad0,
-               0xb4307bae, 0xa32dcb77, 0x0cf23080, 0x3bb7426a, 0xfa01acbe
-       };
 
-       /* Fill out hash function seed */
+       netdev_rss_key_fill(rss_key, sizeof(rss_key));
        for (i = 0; i < 10; i++)
-               ew32(RSSRK(i), rsskey[i]);
+               ew32(RSSRK(i), rss_key[i]);
 
        /* Direct all traffic to queue 0 */
        for (i = 0; i < 32; i++)