aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
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
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')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c16
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c5
2 files changed, 13 insertions, 8 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
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index aa0155848d39..c521007c54b3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6382,7 +6382,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6382#ifdef IXGBE_FCOE 6382#ifdef IXGBE_FCOE
6383 /* setup tx offload for FCoE */ 6383 /* setup tx offload for FCoE */
6384 if ((protocol == __constant_htons(ETH_P_FCOE)) && 6384 if ((protocol == __constant_htons(ETH_P_FCOE)) &&
6385 (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) { 6385 (tx_ring->netdev->features & (NETIF_F_FSO | NETIF_F_FCOE_CRC))) {
6386 tso = ixgbe_fso(tx_ring, first, &hdr_len); 6386 tso = ixgbe_fso(tx_ring, first, &hdr_len);
6387 if (tso < 0) 6387 if (tso < 0)
6388 goto out_drop; 6388 goto out_drop;
@@ -7257,6 +7257,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7257 7257
7258 adapter->ring_feature[RING_F_FCOE].limit = IXGBE_FCRETA_SIZE; 7258 adapter->ring_feature[RING_F_FCOE].limit = IXGBE_FCRETA_SIZE;
7259 7259
7260 netdev->features |= NETIF_F_FSO |
7261 NETIF_F_FCOE_CRC;
7262
7260 netdev->vlan_features |= NETIF_F_FSO | 7263 netdev->vlan_features |= NETIF_F_FSO |
7261 NETIF_F_FCOE_CRC | 7264 NETIF_F_FCOE_CRC |
7262 NETIF_F_FCOE_MTU; 7265 NETIF_F_FCOE_MTU;