aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorParikh, Neerav <neerav.parikh@intel.com>2012-09-27 08:02:22 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-11-28 07:28:56 -0500
commit2afaa00d2fa2ae1fa806ebd229bc3f56df8449d5 (patch)
treede6def5760ba7b8688c4d3649737d11e2d561e1d /drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
parent9de0c8ed7840d01fd5cf1851df2725fe30dc0817 (diff)
ixgbe: Fix incorrect disabling of Tx hang check in case of PFC
The XOFF received statistic registers are per priority based and not per traffic class. The ixgbe driver was incorrectly considering them to be for each traffic class; and then disabling the "Tx hang" check for the queues that belonged to the particular traffic class that had received PFC frames. The above logic worked fine in scenario where the user priority and traffic class number matched e.g. priority 0 is mapped to traffic class 0 and so on. But, when multiple user priorities are mapped to a single traffic class or when user priorities and traffic class numbers do not line up; the ixgbe driver may disable the "Tx hang" check for queues belonging to a traffic class that did not receive PFC frames and keep the "Tx hang" check enabled for the queues that did receive the PFC frames. This patch corrects the above in the code by considering the statistics on a per priority basis; then getting the traffic class the user priority belongs to and disabling the "Tx hang" check for queues that belong to that traffic class. Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com> Acked-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index e6e12450bf30..fc8cfad4ac9b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -703,6 +703,7 @@ static void ixgbe_update_xoff_received(struct ixgbe_adapter *adapter)
703 struct ixgbe_hw *hw = &adapter->hw; 703 struct ixgbe_hw *hw = &adapter->hw;
704 struct ixgbe_hw_stats *hwstats = &adapter->stats; 704 struct ixgbe_hw_stats *hwstats = &adapter->stats;
705 u32 xoff[8] = {0}; 705 u32 xoff[8] = {0};
706 u8 tc;
706 int i; 707 int i;
707 bool pfc_en = adapter->dcb_cfg.pfc_mode_enable; 708 bool pfc_en = adapter->dcb_cfg.pfc_mode_enable;
708 709
@@ -716,21 +717,26 @@ static void ixgbe_update_xoff_received(struct ixgbe_adapter *adapter)
716 717
717 /* update stats for each tc, only valid with PFC enabled */ 718 /* update stats for each tc, only valid with PFC enabled */
718 for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) { 719 for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) {
720 u32 pxoffrxc;
721
719 switch (hw->mac.type) { 722 switch (hw->mac.type) {
720 case ixgbe_mac_82598EB: 723 case ixgbe_mac_82598EB:
721 xoff[i] = IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(i)); 724 pxoffrxc = IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(i));
722 break; 725 break;
723 default: 726 default:
724 xoff[i] = IXGBE_READ_REG(hw, IXGBE_PXOFFRXCNT(i)); 727 pxoffrxc = IXGBE_READ_REG(hw, IXGBE_PXOFFRXCNT(i));
725 } 728 }
726 hwstats->pxoffrxc[i] += xoff[i]; 729 hwstats->pxoffrxc[i] += pxoffrxc;
730 /* Get the TC for given UP */
731 tc = netdev_get_prio_tc_map(adapter->netdev, i);
732 xoff[tc] += pxoffrxc;
727 } 733 }
728 734
729 /* disarm tx queues that have received xoff frames */ 735 /* disarm tx queues that have received xoff frames */
730 for (i = 0; i < adapter->num_tx_queues; i++) { 736 for (i = 0; i < adapter->num_tx_queues; i++) {
731 struct ixgbe_ring *tx_ring = adapter->tx_ring[i]; 737 struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
732 u8 tc = tx_ring->dcb_tc;
733 738
739 tc = tx_ring->dcb_tc;
734 if (xoff[tc]) 740 if (xoff[tc])
735 clear_bit(__IXGBE_HANG_CHECK_ARMED, &tx_ring->state); 741 clear_bit(__IXGBE_HANG_CHECK_ARMED, &tx_ring->state);
736 } 742 }