fm10k: use netdev_rss_key_fill() helper
authorEric Dumazet <edumazet@google.com>
Sun, 16 Nov 2014 14:23:12 +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/fm10k/fm10k_pci.c

index a0cb74ab3dc617d0262ebaf4df9c52bc0b159093..4f5892cc32d70c15b7911e0975eb6f39a5f5b6fb 100644 (file)
@@ -1551,15 +1551,11 @@ void fm10k_down(struct fm10k_intfc *interface)
 static int fm10k_sw_init(struct fm10k_intfc *interface,
                         const struct pci_device_id *ent)
 {
-       static const u32 seed[FM10K_RSSRK_SIZE] = { 0xda565a6d, 0xc20e5b25,
-                                                   0x3d256741, 0xb08fa343,
-                                                   0xcb2bcad0, 0xb4307bae,
-                                                   0xa32dcb77, 0x0cf23080,
-                                                   0x3bb7426a, 0xfa01acbe };
        const struct fm10k_info *fi = fm10k_info_tbl[ent->driver_data];
        struct fm10k_hw *hw = &interface->hw;
        struct pci_dev *pdev = interface->pdev;
        struct net_device *netdev = interface->netdev;
+       u32 rss_key[FM10K_RSSRK_SIZE];
        unsigned int rss;
        int err;
 
@@ -1673,8 +1669,8 @@ static int fm10k_sw_init(struct fm10k_intfc *interface,
        /* initialize vxlan_port list */
        INIT_LIST_HEAD(&interface->vxlan_port);
 
-       /* initialize RSS key */
-       memcpy(interface->rssrk, seed, sizeof(seed));
+       netdev_rss_key_fill(rss_key, sizeof(rss_key));
+       memcpy(interface->rssrk, rss_key, sizeof(rss_key));
 
        /* Start off interface as being down */
        set_bit(__FM10K_DOWN, &interface->state);