diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-08-30 17:07:11 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-10-16 13:18:47 -0700 |
commit | fd38f734cb8200529e281338514945fcbff2364b (patch) | |
tree | b3ebe33151fa90fdfd0196adafb1aa6d4ab7a1de /drivers/net/ethernet/intel/igbvf/netdev.c | |
parent | 11ba69e876e1141fa4b11a7c0efb256a8df9ae7d (diff) | |
download | blackbird-op-linux-fd38f734cb8200529e281338514945fcbff2364b.tar.gz blackbird-op-linux-fd38f734cb8200529e281338514945fcbff2364b.zip |
igbvf: convert to ndo_fix_features
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
Removing this needs deeper surgery.
Things noticed:
- HW VLAN acceleration probably can be toggled, but it's left as is
- the resets on RX csum offload change can probably be avoided
- there is A LOT of copy-and-pasted code here
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf/netdev.c')
-rw-r--r-- | drivers/net/ethernet/intel/igbvf/netdev.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index b3d760b08a5f..32b3044fa45c 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -2530,6 +2530,18 @@ static void igbvf_print_device_info(struct igbvf_adapter *adapter) dev_info(&pdev->dev, "MAC: %d\n", hw->mac.type); } +static int igbvf_set_features(struct net_device *netdev, u32 features) +{ + struct igbvf_adapter *adapter = netdev_priv(netdev); + + if (features & NETIF_F_RXCSUM) + adapter->flags &= ~IGBVF_FLAG_RX_CSUM_DISABLED; + else + adapter->flags |= IGBVF_FLAG_RX_CSUM_DISABLED; + + return 0; +} + static const struct net_device_ops igbvf_netdev_ops = { .ndo_open = igbvf_open, .ndo_stop = igbvf_close, @@ -2545,6 +2557,7 @@ static const struct net_device_ops igbvf_netdev_ops = { #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = igbvf_netpoll, #endif + .ndo_set_features = igbvf_set_features, }; /** @@ -2652,16 +2665,18 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, adapter->bd_number = cards_found++; - netdev->features = NETIF_F_SG | + netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | + NETIF_F_IPV6_CSUM | + NETIF_F_TSO | + NETIF_F_TSO6 | + NETIF_F_RXCSUM; + + netdev->features = netdev->hw_features | 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; - if (pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; |