From: Joe Jin Date: Tue, 28 Aug 2012 13:05:09 +0000 (+0800) Subject: e1000e: disable rxhash when try to enable jumbo frame also rxhash and rxcsum have... X-Git-Tag: v2.6.39-400.9.0~338^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=de8f15a6d6d0bb823a23e9539ff1d1da658f1e37;p=users%2Fjedix%2Flinux-maple.git e1000e: disable rxhash when try to enable jumbo frame also rxhash and rxcsum have enabled 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 Signed-off-by: Guru Anbalagane Acked-by: Adnan Misherfi --- diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 50c4f12e59f5..8b334221c3f5 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -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 */ }