ixgbe: fix dca issue with relaxed ordering turned on
Subsystems (2)
PATCH 1/3 ixgbe: fix dca issue with relaxed ordering turned on
From: Don Skidmore <[email protected]>
The is an issue where setting Relaxed Ordering (RO) bit (in a PCI-E write transaction) on 82598 causing the chipset to drop DCA hints. This patch forces RO not to be set for descriptors as well as payload. This will only be in effect while DCA is enabled and no performance difference was noticed in testing.
---
drivers/net/ixgbe/ixgbe_main.c | 3 +++ drivers/net/ixgbe/ixgbe_type.h | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +3 -0
@@ -318,6 +318,9 @@ static void ixgbe_update_rx_dca(struct ixgbe_adapter *adapter, rxctrl |=dca3_get_tag (&adapter->pdev->dev, cpu); rxctrl |=IXGBE_DCA_RXCTRL_DESC_DCA_EN ; rxctrl |=IXGBE_DCA_RXCTRL_HEAD_DCA_EN ; + rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_RRO_EN ); + rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | +IXGBE_DCA_RXCTRL_DESC_HSRO_EN );IXGBE_WRITE_REG (&adapter->hw,IXGBE_DCA_RXCTRL (q), rxctrl); rx_ring->cpu = cpu; }
drivers/net/ixgbe/ixgbe_type.h +3 -0
@@ -404,6 +404,9 @@#define IXGBE_DCA_RXCTRL_DESC_DCA_EN (1 << 5)/* DCA Rx Desc enable */ #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN (1 << 6)/* DCA Rx Desc header enable */ #define IXGBE_DCA_RXCTRL_DATA_DCA_EN (1 << 7)/* DCA Rx Desc payload enable */ +#define IXGBE_DCA_RXCTRL_DESC_RRO_EN (1 << 9)/* DCA Rx rd Desc Relax Order */ +#define IXGBE_DCA_RXCTRL_DESC_WRO_EN (1 << 13)/* DCA Rx wr Desc Relax Order */ +#define IXGBE_DCA_RXCTRL_DESC_HSRO_EN (1 << 15)/* DCA Rx Split Header RO */ #define IXGBE_DCA_TXCTRL_CPUID_MASK 0x0000001F/* Tx CPUID Mask */ #define IXGBE_DCA_TXCTRL_DESC_DCA_EN (1 << 5)/* DCA Tx Desc enable */
PATCH 2/3 ixgbe: fix tag stripping for VLAN ID 0
From: Don Skidmore <[email protected]>
Register VLAN ID 0 so that frames with VLAN ID 0 are received and get their tag stripped when ixgbe is not in DCB mode. VLAN ID 0 means that the frame is 'priority tagged' only - it is not a VLAN, but the priority value is the tag in valid. The functions ixgbe_vlan_rx_register() and ixgbe_vlan_rx_kill_vid() were moved up a couple functions to correct compiling issues with this change.
---
drivers/net/ixgbe/ixgbe_main.c | 53 ++++++++++++++++++++-------------------- 1 files changed, 27 insertions(+), 26 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +27 -26
@@ -1744,6 +1744,32 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)IXGBE_WRITE_REG (hw,IXGBE_RXCSUM , rxcsum); } +static void ixgbe_vlan_rx_add_vid (struct net_device *netdev,u16 vid) +{ +struct ixgbe_adapter *adapter =netdev_priv (netdev); +struct ixgbe_hw *hw = &adapter->hw; + +/* add VID to filter table */ + hw->mac.ops.set_vfta (&adapter->hw, vid,0 , true); +} + +static void ixgbe_vlan_rx_kill_vid (struct net_device *netdev,u16 vid) +{ +struct ixgbe_adapter *adapter =netdev_priv (netdev); +struct ixgbe_hw *hw = &adapter->hw; + +if (!test_bit (__IXGBE_DOWN, &adapter->state)) +ixgbe_irq_disable (adapter); + +vlan_group_set_device (adapter->vlgrp, vid,NULL ); + +if (!test_bit (__IXGBE_DOWN, &adapter->state)) +ixgbe_irq_enable (adapter); + +/* remove VID from filter table */ + hw->mac.ops.set_vfta (&adapter->hw, vid,0 , false); +} +static void ixgbe_vlan_rx_register (struct net_device *netdev,struct vlan_group *grp) {
@@ -1763,6 +1789,7 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, ctrl |=IXGBE_VLNCTRL_VME ; ctrl &= ~IXGBE_VLNCTRL_CFIEN ;IXGBE_WRITE_REG (&adapter->hw,IXGBE_VLNCTRL , ctrl); +ixgbe_vlan_rx_add_vid (netdev,0 );if (grp) {/* enable VLAN tag insert/strip */
@@ -1776,32 +1803,6 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev,ixgbe_irq_enable (adapter); } -static void ixgbe_vlan_rx_add_vid (struct net_device *netdev,u16 vid) -{ -struct ixgbe_adapter *adapter =netdev_priv (netdev); -struct ixgbe_hw *hw = &adapter->hw; - -/* add VID to filter table */ - hw->mac.ops.set_vfta (&adapter->hw, vid,0 , true); -} - -static void ixgbe_vlan_rx_kill_vid (struct net_device *netdev,u16 vid) -{ -struct ixgbe_adapter *adapter =netdev_priv (netdev); -struct ixgbe_hw *hw = &adapter->hw; - -if (!test_bit (__IXGBE_DOWN, &adapter->state)) -ixgbe_irq_disable (adapter); - -vlan_group_set_device (adapter->vlgrp, vid,NULL ); - -if (!test_bit (__IXGBE_DOWN, &adapter->state)) -ixgbe_irq_enable (adapter); - -/* remove VID from filter table */ - hw->mac.ops.set_vfta (&adapter->hw, vid,0 , false); -} -static void ixgbe_restore_vlan (struct ixgbe_adapter *adapter) {ixgbe_vlan_rx_register (adapter->netdev, adapter->vlgrp);
PATCH 3/3 ixgbe: Fix usage of netif_*_all_queues() with netif_carrier_{off|on}()
In reply to Jeff KirsherFrom: PJ Waskiewicz <[email protected]>
netif_carrier_off() is sufficient to stop Tx into the driver. Stopping the Tx queues is redundant and unnecessary. By the same token, netif_carrier_on() will be sufficient to re-enable Tx, so waking the queues is unnecessary.
---
drivers/net/ixgbe/ixgbe_main.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +3 -3
@@ -2078,6 +2078,9 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)ixgbe_irq_enable (adapter); +/* enable transmits */ +netif_tx_start_all_queues (netdev); +/* bring the link up in the watchdog, this could race with our first * link up interrupt but shouldn't be a problem */ adapter->flags |=IXGBE_FLAG_NEED_LINK_UPDATE ;
@@ -3479,7 +3482,6 @@ static void ixgbe_watchdog_task(struct work_struct *work) (FLOW_TX ? "TX" : "None"))));netif_carrier_on (netdev); -netif_tx_wake_all_queues (netdev); }else {/* Force detection of hung controller */ adapter->detect_tx_hung = true;
@@ -3491,7 +3493,6 @@ static void ixgbe_watchdog_task(struct work_struct *work)printk (KERN_INFO "ixgbe: %s NIC Link is Down\n" , netdev->name);netif_carrier_off (netdev); -netif_tx_stop_all_queues (netdev); } }
@@ -4222,7 +4223,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, }netif_carrier_off (netdev); -netif_tx_stop_all_queues (netdev);strcpy (netdev->name,"eth%d" ); err =register_netdev (netdev);
From: Jeff Kirsher <[email protected]>
Date: Mon, 19 Jan 2009 16:11:05 -0800
Quoted 10 lines
The is an issue where setting Relaxed Ordering (RO) bit (in a PCI-E write transaction) on 82598 causing the chipset to drop DCA hints. This patch forces RO not to be set for descriptors as well as payload. This will only be in effect while DCA is enabled and no performance difference was noticed in testing.
Signed-off-by Don Skidmore <[email protected]>Signed-off-by Peter P Waskiewicz Jr <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
Re: [PATCH 2/3] ixgbe: fix tag stripping for VLAN ID 0
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Mon, 19 Jan 2009 16:11:26 -0800
Quoted 6 lines
Register VLAN ID 0 so that frames with VLAN ID 0 are received and get their tag stripped when ixgbe is not in DCB mode. VLAN ID 0 means that the frame is 'priority tagged' only - it is not a VLAN, but the priority value is the tag in valid. The functions
ixgbe_vlan_rx_register()andixgbe_vlan_rx_kill_vid()were moved up a couple functions to correct compiling issues with this change.Signed-off-by Don Skidmore <[email protected]>Signed-off-by Peter P Waskiewicz Jr <[email protected]>Signed-off-by Eric W Multanen <[email protected]>
Applied.
Re: [PATCH 3/3] ixgbe: Fix usage of netif_*_all_queues() with netif_carrier_{off|on}()
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Mon, 19 Jan 2009 16:11:47 -0800
Quoted 6 lines
netif_carrier_off()is sufficient to stop Tx into the driver. Stopping the Tx queues is redundant and unnecessary. By the same token,netif_carrier_on()will be sufficient to re-enable Tx, so waking the queues is unnecessary.Signed-off-by Peter P Waskiewicz Jr <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.