From: Joe Jin Date: Thu, 7 Jun 2012 23:35:58 +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~423^2~4^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=60aaeb22941b80b2dba032470ada4480dd8861a2;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 30004942e1af..b09d7a6c56d6 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -61,6 +61,8 @@ char e1000e_driver_name[] = "e1000e"; const char e1000e_driver_version[] = DRV_VERSION; 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 const struct e1000_info *e1000_info_tbl[] = { [board_82571] = &e1000_82571_info, @@ -5215,8 +5217,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"); } }