aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2010-07-19 09:59:52 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-19 23:23:37 -0400
commit5e09d7f6305fc9a1141bef116c7c02756d3bfa16 (patch)
tree6bb60b9738d4a504181cfc9b6afaf016563b2faf
parentd6ea7c9ccc9fd351fa2675304695d1654331fca3 (diff)
ixgbe: properly toggling netdev feature flags when disabling FCoE
When FCoE is disabled, there is a race condition that FCoE offload is turned off but the FCoE protocol driver is still queuing I/O thinking offload support still exists. This patch toggles off corresponding FCoE netdev feature flags and notify the FCoE stack first, allowing FCoE protocol stack driver to update its flags upon NETDEV_FEAT_CHANGE so no I/O will be using offload. Also, indicate FCoE offload flags in vlan_features in ixgbe_probe once and do not toggle them in ixgbe_fcoe_enable/disable so when FCoE is created on the VLAN interface, vlan_transfer_features() would properly update the VLAN netdev features flag and notify the FCoE protocol driver for NETDEV_FEAT_CHANGE. Signed-off-by: Yi Zou <yi.zou@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ixgbe/ixgbe_fcoe.c19
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c5
2 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index f6ef4cd0a12..1737d2bddc1 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -622,9 +622,6 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
622 netdev->features |= NETIF_F_FCOE_CRC; 622 netdev->features |= NETIF_F_FCOE_CRC;
623 netdev->features |= NETIF_F_FSO; 623 netdev->features |= NETIF_F_FSO;
624 netdev->features |= NETIF_F_FCOE_MTU; 624 netdev->features |= NETIF_F_FCOE_MTU;
625 netdev->vlan_features |= NETIF_F_FCOE_CRC;
626 netdev->vlan_features |= NETIF_F_FSO;
627 netdev->vlan_features |= NETIF_F_FCOE_MTU;
628 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; 625 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
629 626
630 ixgbe_init_interrupt_scheme(adapter); 627 ixgbe_init_interrupt_scheme(adapter);
@@ -658,24 +655,20 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
658 goto out_disable; 655 goto out_disable;
659 656
660 e_info(drv, "Disabling FCoE offload features.\n"); 657 e_info(drv, "Disabling FCoE offload features.\n");
658 netdev->features &= ~NETIF_F_FCOE_CRC;
659 netdev->features &= ~NETIF_F_FSO;
660 netdev->features &= ~NETIF_F_FCOE_MTU;
661 netdev->fcoe_ddp_xid = 0;
662 netdev_features_change(netdev);
663
661 if (netif_running(netdev)) 664 if (netif_running(netdev))
662 netdev->netdev_ops->ndo_stop(netdev); 665 netdev->netdev_ops->ndo_stop(netdev);
663 666
664 ixgbe_clear_interrupt_scheme(adapter); 667 ixgbe_clear_interrupt_scheme(adapter);
665
666 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 668 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
667 adapter->ring_feature[RING_F_FCOE].indices = 0; 669 adapter->ring_feature[RING_F_FCOE].indices = 0;
668 netdev->features &= ~NETIF_F_FCOE_CRC;
669 netdev->features &= ~NETIF_F_FSO;
670 netdev->features &= ~NETIF_F_FCOE_MTU;
671 netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
672 netdev->vlan_features &= ~NETIF_F_FSO;
673 netdev->vlan_features &= ~NETIF_F_FCOE_MTU;
674 netdev->fcoe_ddp_xid = 0;
675
676 ixgbe_cleanup_fcoe(adapter); 670 ixgbe_cleanup_fcoe(adapter);
677 ixgbe_init_interrupt_scheme(adapter); 671 ixgbe_init_interrupt_scheme(adapter);
678 netdev_features_change(netdev);
679 672
680 if (netif_running(netdev)) 673 if (netif_running(netdev))
681 netdev->netdev_ops->ndo_open(netdev); 674 netdev->netdev_ops->ndo_open(netdev);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 813d2cb5b4d..7d619d620f2 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -6740,6 +6740,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
6740 adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE; 6740 adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
6741 } 6741 }
6742 } 6742 }
6743 if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
6744 netdev->vlan_features |= NETIF_F_FCOE_CRC;
6745 netdev->vlan_features |= NETIF_F_FSO;
6746 netdev->vlan_features |= NETIF_F_FCOE_MTU;
6747 }
6743#endif /* IXGBE_FCOE */ 6748#endif /* IXGBE_FCOE */
6744 if (pci_using_dac) 6749 if (pci_using_dac)
6745 netdev->features |= NETIF_F_HIGHDMA; 6750 netdev->features |= NETIF_F_HIGHDMA;