From patchwork Sat Feb 7 09:18:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 22479 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 4DA4ADDDEE for ; Sat, 7 Feb 2009 20:18:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752698AbZBGJSu (ORCPT ); Sat, 7 Feb 2009 04:18:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752566AbZBGJSs (ORCPT ); Sat, 7 Feb 2009 04:18:48 -0500 Received: from qmta02.westchester.pa.mail.comcast.net ([76.96.62.24]:50304 "EHLO QMTA02.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbZBGJSr (ORCPT ); Sat, 7 Feb 2009 04:18:47 -0500 Received: from OMTA13.westchester.pa.mail.comcast.net ([76.96.62.52]) by QMTA02.westchester.pa.mail.comcast.net with comcast id CxGG1b00117dt5G52xJnQW; Sat, 07 Feb 2009 09:18:47 +0000 Received: from lost.foo-projects.org ([63.64.152.142]) by OMTA13.westchester.pa.mail.comcast.net with comcast id CxJU1b00334bfcX3ZxJXnP; Sat, 07 Feb 2009 09:18:45 +0000 From: Jeff Kirsher Subject: [net-next PATCH 11/26] igb: update feature flags supported in ethtool To: davem@davemloft.net Cc: netdev@vger.kernel.org, jeff@garzik.org, gospo@redhat.com, Alexander Duyck , Jeff Kirsher Date: Sat, 07 Feb 2009 01:18:27 -0800 Message-ID: <20090207091827.15697.42208.stgit@lost.foo-projects.org> In-Reply-To: <20090207091504.15697.26667.stgit@lost.foo-projects.org> References: <20090207091504.15697.26667.stgit@lost.foo-projects.org> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Alexander Duyck This driver is currently using HW_CSUM which is not correct. Update this to use the IP_CSUM and IPV6_CSUM flags. In addition consolidate the TSO flag setting. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher --- drivers/net/igb/igb_ethtool.c | 16 +++++++--------- drivers/net/igb/igb_main.c | 5 +++-- 2 files changed, 10 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 84be46c..d7bdc6c 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c @@ -287,15 +287,15 @@ static int igb_set_rx_csum(struct net_device *netdev, u32 data) static u32 igb_get_tx_csum(struct net_device *netdev) { - return (netdev->features & NETIF_F_HW_CSUM) != 0; + return (netdev->features & NETIF_F_IP_CSUM) != 0; } static int igb_set_tx_csum(struct net_device *netdev, u32 data) { if (data) - netdev->features |= NETIF_F_HW_CSUM; + netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); else - netdev->features &= ~NETIF_F_HW_CSUM; + netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); return 0; } @@ -304,15 +304,13 @@ static int igb_set_tso(struct net_device *netdev, u32 data) { struct igb_adapter *adapter = netdev_priv(netdev); - if (data) + if (data) { netdev->features |= NETIF_F_TSO; - else - netdev->features &= ~NETIF_F_TSO; - - if (data) netdev->features |= NETIF_F_TSO6; - else + } else { + netdev->features &= ~NETIF_F_TSO; netdev->features &= ~NETIF_F_TSO6; + } dev_info(&adapter->pdev->dev, "TSO is %s\n", data ? "Enabled" : "Disabled"); diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index e3a3582..8c27e0a 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -1158,11 +1158,12 @@ static int __devinit igb_probe(struct pci_dev *pdev, "PHY reset is blocked due to SOL/IDER session.\n"); netdev->features = NETIF_F_SG | - NETIF_F_HW_CSUM | + NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; + netdev->features |= NETIF_F_IPV6_CSUM; netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO6; @@ -1172,7 +1173,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, netdev->vlan_features |= NETIF_F_TSO; netdev->vlan_features |= NETIF_F_TSO6; - netdev->vlan_features |= NETIF_F_HW_CSUM; + netdev->vlan_features |= NETIF_F_IP_CSUM; netdev->vlan_features |= NETIF_F_SG; if (pci_using_dac)