]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: disable rxhash when try to enable jumbo frame also rxhash and rxcsum have...
authorJoe Jin <joe.jin@oracle.com>
Tue, 28 Aug 2012 13:05:09 +0000 (21:05 +0800)
committerJoe Jin <joe.jin@oracle.com>
Wed, 29 Aug 2012 00:22:24 +0000 (08:22 +0800)
commit ffd3d6 check if both rxhash and rxcsum enabled when enable jumbo
frames and disallowed all of them enabled at the same time.
Since jumbo frame widely be used in real world, and el5 did not supported
enable/disable rxhash, so we changed default behavior to disable rxhash
when try to enable jumbo frames also rxhash and rxcsum have enabled.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
Acked-by: Adnan Misherfi <adnan.misherfi@oracle.com>
drivers/net/e1000e/netdev.c

index 50c4f12e59f51068b467385916f74ae395368ecd..8b334221c3f51a60e4aa0fe5a5654df57b5bbe7b 100644 (file)
@@ -71,6 +71,8 @@ module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
 static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
+static int e1000_set_features(struct net_device *netdev,
+                             netdev_features_t features);
 
 static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
 {
@@ -6077,8 +6079,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
                 */
                if ((netdev->features & NETIF_F_RXCSUM) &&
                    (netdev->features & NETIF_F_RXHASH)) {
-                       e_err("Jumbo frames cannot be enabled when both receive checksum offload and receive hashing are enabled.  Disable one of the receive offload features before enabling jumbos.\n");
-                       return -EINVAL;
+                       /* Disable receive hashing */
+                       netdev_features_t features;
+
+                       features = netdev->features & (~NETIF_F_RXHASH);
+                       if (e1000_set_features(netdev, features)) {
+                               e_err("Jumbo frames cannot be enabled when both receive checksum offload and receive hashing are enabled.  Disable one of the receive offload features before enabling jumbos.\n");
+                               return -EINVAL;
+                       }
+                       e_info("Jumbo frames cannot be enabled when both receive checksum offload and receive hashing are enabled. Disabling Receive Hashing.\n");
                }
 #endif /* HAVE_NDO_SET_FEATURES */
        }