aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-05-25 02:38:18 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-07-19 21:21:22 -0400
commita58915c7ecba89bef0914664ecf87c2156c68630 (patch)
tree9db52c22fd17ed0c99a235efdfc31b0defd5ac46 /drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
parentef89e0a24ea97fc9209074a19cf60e63bba18c22 (diff)
ixgbe: Enable FCoE FSO and CRC offloads based on CAPABLE instead of ENABLED flag
Instead of only setting the FCOE segmentation offload and CRC offload flags if we enable FCoE, we could just set them always since there are no modifications needed to the hardware or adapter FCoE structure in order to use these features. The advantage to this is that if FCoE enablement fails, for example because SR-IOV was enabled on 82599, we will still have use of the FCoE segmentation offload and Tx/Rx CRC offloads which should still help to improve the FCoE performance. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index e79ba3927344..ae73ef14fdf3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -616,11 +616,11 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
616 int i, fcoe_q, fcoe_i; 616 int i, fcoe_q, fcoe_i;
617 u32 etqf; 617 u32 etqf;
618 618
619 /* leave registers unconfigued if FCoE is disabled */ 619 /* Minimal functionality for FCoE requires at least CRC offloads */
620 if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) 620 if (!(adapter->netdev->features & NETIF_F_FCOE_CRC))
621 return; 621 return;
622 622
623 /* Enable L2 EtherType filter for FCoE, necessary for FCoE Rx CRC */ 623 /* Enable L2 EtherType filter for FCoE, needed for FCoE CRC and DDP */
624 etqf = ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN; 624 etqf = ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN;
625 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { 625 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
626 etqf |= IXGBE_ETQF_POOL_ENABLE; 626 etqf |= IXGBE_ETQF_POOL_ENABLE;
@@ -629,6 +629,10 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
629 IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE), etqf); 629 IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE), etqf);
630 IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE), 0); 630 IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE), 0);
631 631
632 /* leave registers un-configured if FCoE is disabled */
633 if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))
634 return;
635
632 /* Use one or more Rx queues for FCoE by redirection table */ 636 /* Use one or more Rx queues for FCoE by redirection table */
633 for (i = 0; i < IXGBE_FCRETA_SIZE; i++) { 637 for (i = 0; i < IXGBE_FCRETA_SIZE; i++) {
634 fcoe_i = fcoe->offset + (i % fcoe->indices); 638 fcoe_i = fcoe->offset + (i % fcoe->indices);
@@ -804,7 +808,7 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
804 808
805 /* enable FCoE and notify stack */ 809 /* enable FCoE and notify stack */
806 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 810 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
807 netdev->features |= NETIF_F_FSO | NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU; 811 netdev->features |= NETIF_F_FCOE_MTU;
808 netdev_features_change(netdev); 812 netdev_features_change(netdev);
809 813
810 /* release existing queues and reallocate them */ 814 /* release existing queues and reallocate them */
@@ -844,9 +848,7 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
844 848
845 /* disable FCoE and notify stack */ 849 /* disable FCoE and notify stack */
846 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 850 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
847 netdev->features &= ~(NETIF_F_FCOE_CRC | 851 netdev->features &= ~NETIF_F_FCOE_MTU;
848 NETIF_F_FSO |
849 NETIF_F_FCOE_MTU);
850 852
851 netdev_features_change(netdev); 853 netdev_features_change(netdev);
852 854