提交 a58915c7 编写于 作者: A Alexander Duyck 提交者: Jeff Kirsher

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: NAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: NPhil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 ef89e0a2
...@@ -616,11 +616,11 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter) ...@@ -616,11 +616,11 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
int i, fcoe_q, fcoe_i; int i, fcoe_q, fcoe_i;
u32 etqf; u32 etqf;
/* leave registers unconfigued if FCoE is disabled */ /* Minimal functionality for FCoE requires at least CRC offloads */
if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) if (!(adapter->netdev->features & NETIF_F_FCOE_CRC))
return; return;
/* Enable L2 EtherType filter for FCoE, necessary for FCoE Rx CRC */ /* Enable L2 EtherType filter for FCoE, needed for FCoE CRC and DDP */
etqf = ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN; etqf = ETH_P_FCOE | IXGBE_ETQF_FCOE | IXGBE_ETQF_FILTER_EN;
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
etqf |= IXGBE_ETQF_POOL_ENABLE; etqf |= IXGBE_ETQF_POOL_ENABLE;
...@@ -629,6 +629,10 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter) ...@@ -629,6 +629,10 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE), etqf); IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FCOE), etqf);
IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE), 0); IXGBE_WRITE_REG(hw, IXGBE_ETQS(IXGBE_ETQF_FILTER_FCOE), 0);
/* leave registers un-configured if FCoE is disabled */
if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))
return;
/* Use one or more Rx queues for FCoE by redirection table */ /* Use one or more Rx queues for FCoE by redirection table */
for (i = 0; i < IXGBE_FCRETA_SIZE; i++) { for (i = 0; i < IXGBE_FCRETA_SIZE; i++) {
fcoe_i = fcoe->offset + (i % fcoe->indices); fcoe_i = fcoe->offset + (i % fcoe->indices);
...@@ -804,7 +808,7 @@ int ixgbe_fcoe_enable(struct net_device *netdev) ...@@ -804,7 +808,7 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
/* enable FCoE and notify stack */ /* enable FCoE and notify stack */
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
netdev->features |= NETIF_F_FSO | NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU; netdev->features |= NETIF_F_FCOE_MTU;
netdev_features_change(netdev); netdev_features_change(netdev);
/* release existing queues and reallocate them */ /* release existing queues and reallocate them */
...@@ -844,9 +848,7 @@ int ixgbe_fcoe_disable(struct net_device *netdev) ...@@ -844,9 +848,7 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
/* disable FCoE and notify stack */ /* disable FCoE and notify stack */
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
netdev->features &= ~(NETIF_F_FCOE_CRC | netdev->features &= ~NETIF_F_FCOE_MTU;
NETIF_F_FSO |
NETIF_F_FCOE_MTU);
netdev_features_change(netdev); netdev_features_change(netdev);
......
...@@ -6382,7 +6382,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, ...@@ -6382,7 +6382,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
#ifdef IXGBE_FCOE #ifdef IXGBE_FCOE
/* setup tx offload for FCoE */ /* setup tx offload for FCoE */
if ((protocol == __constant_htons(ETH_P_FCOE)) && if ((protocol == __constant_htons(ETH_P_FCOE)) &&
(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) { (tx_ring->netdev->features & (NETIF_F_FSO | NETIF_F_FCOE_CRC))) {
tso = ixgbe_fso(tx_ring, first, &hdr_len); tso = ixgbe_fso(tx_ring, first, &hdr_len);
if (tso < 0) if (tso < 0)
goto out_drop; goto out_drop;
...@@ -7257,6 +7257,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, ...@@ -7257,6 +7257,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
adapter->ring_feature[RING_F_FCOE].limit = IXGBE_FCRETA_SIZE; adapter->ring_feature[RING_F_FCOE].limit = IXGBE_FCRETA_SIZE;
netdev->features |= NETIF_F_FSO |
NETIF_F_FCOE_CRC;
netdev->vlan_features |= NETIF_F_FSO | netdev->vlan_features |= NETIF_F_FSO |
NETIF_F_FCOE_CRC | NETIF_F_FCOE_CRC |
NETIF_F_FCOE_MTU; NETIF_F_FCOE_MTU;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册