diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-08-30 13:07:11 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-10-16 16:18:47 -0400 |
commit | fd38f734cb8200529e281338514945fcbff2364b (patch) | |
tree | b3ebe33151fa90fdfd0196adafb1aa6d4ab7a1de /drivers/net/ethernet/intel/igbvf/netdev.c | |
parent | 11ba69e876e1141fa4b11a7c0efb256a8df9ae7d (diff) |
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) | |||
2530 | dev_info(&pdev->dev, "MAC: %d\n", hw->mac.type); | 2530 | dev_info(&pdev->dev, "MAC: %d\n", hw->mac.type); |
2531 | } | 2531 | } |
2532 | 2532 | ||
2533 | static int igbvf_set_features(struct net_device *netdev, u32 features) | ||
2534 | { | ||
2535 | struct igbvf_adapter *adapter = netdev_priv(netdev); | ||
2536 | |||
2537 | if (features & NETIF_F_RXCSUM) | ||
2538 | adapter->flags &= ~IGBVF_FLAG_RX_CSUM_DISABLED; | ||
2539 | else | ||
2540 | adapter->flags |= IGBVF_FLAG_RX_CSUM_DISABLED; | ||
2541 | |||
2542 | return 0; | ||
2543 | } | ||
2544 | |||
2533 | static const struct net_device_ops igbvf_netdev_ops = { | 2545 | static const struct net_device_ops igbvf_netdev_ops = { |
2534 | .ndo_open = igbvf_open, | 2546 | .ndo_open = igbvf_open, |
2535 | .ndo_stop = igbvf_close, | 2547 | .ndo_stop = igbvf_close, |
@@ -2545,6 +2557,7 @@ static const struct net_device_ops igbvf_netdev_ops = { | |||
2545 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2557 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2546 | .ndo_poll_controller = igbvf_netpoll, | 2558 | .ndo_poll_controller = igbvf_netpoll, |
2547 | #endif | 2559 | #endif |
2560 | .ndo_set_features = igbvf_set_features, | ||
2548 | }; | 2561 | }; |
2549 | 2562 | ||
2550 | /** | 2563 | /** |
@@ -2652,16 +2665,18 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, | |||
2652 | 2665 | ||
2653 | adapter->bd_number = cards_found++; | 2666 | adapter->bd_number = cards_found++; |
2654 | 2667 | ||
2655 | netdev->features = NETIF_F_SG | | 2668 | netdev->hw_features = NETIF_F_SG | |
2656 | NETIF_F_IP_CSUM | | 2669 | NETIF_F_IP_CSUM | |
2670 | NETIF_F_IPV6_CSUM | | ||
2671 | NETIF_F_TSO | | ||
2672 | NETIF_F_TSO6 | | ||
2673 | NETIF_F_RXCSUM; | ||
2674 | |||
2675 | netdev->features = netdev->hw_features | | ||
2657 | NETIF_F_HW_VLAN_TX | | 2676 | NETIF_F_HW_VLAN_TX | |
2658 | NETIF_F_HW_VLAN_RX | | 2677 | NETIF_F_HW_VLAN_RX | |
2659 | NETIF_F_HW_VLAN_FILTER; | 2678 | NETIF_F_HW_VLAN_FILTER; |
2660 | 2679 | ||
2661 | netdev->features |= NETIF_F_IPV6_CSUM; | ||
2662 | netdev->features |= NETIF_F_TSO; | ||
2663 | netdev->features |= NETIF_F_TSO6; | ||
2664 | |||
2665 | if (pci_using_dac) | 2680 | if (pci_using_dac) |
2666 | netdev->features |= NETIF_F_HIGHDMA; | 2681 | netdev->features |= NETIF_F_HIGHDMA; |
2667 | 2682 | ||