Commit 7d8eb29e authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: update feature flags supported in ethtool

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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0fbe67af
...@@ -287,15 +287,15 @@ static int igb_set_rx_csum(struct net_device *netdev, u32 data) ...@@ -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) 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) static int igb_set_tx_csum(struct net_device *netdev, u32 data)
{ {
if (data) if (data)
netdev->features |= NETIF_F_HW_CSUM; netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
else else
netdev->features &= ~NETIF_F_HW_CSUM; netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
return 0; return 0;
} }
...@@ -304,15 +304,13 @@ static int igb_set_tso(struct net_device *netdev, u32 data) ...@@ -304,15 +304,13 @@ static int igb_set_tso(struct net_device *netdev, u32 data)
{ {
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
if (data) if (data) {
netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO;
else
netdev->features &= ~NETIF_F_TSO;
if (data)
netdev->features |= NETIF_F_TSO6; netdev->features |= NETIF_F_TSO6;
else } else {
netdev->features &= ~NETIF_F_TSO;
netdev->features &= ~NETIF_F_TSO6; netdev->features &= ~NETIF_F_TSO6;
}
dev_info(&adapter->pdev->dev, "TSO is %s\n", dev_info(&adapter->pdev->dev, "TSO is %s\n",
data ? "Enabled" : "Disabled"); data ? "Enabled" : "Disabled");
......
...@@ -1158,11 +1158,12 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1158,11 +1158,12 @@ static int __devinit igb_probe(struct pci_dev *pdev,
"PHY reset is blocked due to SOL/IDER session.\n"); "PHY reset is blocked due to SOL/IDER session.\n");
netdev->features = NETIF_F_SG | netdev->features = NETIF_F_SG |
NETIF_F_HW_CSUM | NETIF_F_IP_CSUM |
NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER; NETIF_F_HW_VLAN_FILTER;
netdev->features |= NETIF_F_IPV6_CSUM;
netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO6; netdev->features |= NETIF_F_TSO6;
...@@ -1172,7 +1173,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1172,7 +1173,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
netdev->vlan_features |= NETIF_F_TSO; netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6; 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; netdev->vlan_features |= NETIF_F_SG;
if (pci_using_dac) if (pci_using_dac)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment