diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-03-16 19:07:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-19 17:37:21 -0400 |
commit | 8f4a0a3d9f9706da5a9d053fe39854c160250ddc (patch) | |
tree | 1e7c4af740002a3d0ee2a5982b27cdeb1d18f13b /drivers | |
parent | da24e906cbfc08171d24a2b7cf66fad565fdd121 (diff) |
ixgbe: Fix issues with SR-IOV loopback when flow control is disabled
This patch allows us to avoid a Tx hang when SR-IOV is enabled. This hang
can be triggered by sending small packets at a rate that was triggering Rx
missed errors from the adapter while the internal Tx switch and at least
one VF are enabled.
This was all due to the fact that under heavy stress the Rx FIFO never
drained below the flow control high water mark. This resulted in the Tx
FIFO being head of line blocked due to the fact that it relies on the flow
control high water mark to determine when it is acceptable for the Tx to
place a packet in the Rx FIFO.
The resolution for this is to set the FCRTH value to the RXPBSIZE - 32 so
that even if the ring is almost completely full we can still place Tx
packets on the Rx ring and drop incoming Rx traffic if we do not have
sufficient space available in the Rx FIFO.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 6117bfd924cc..49aa41fe7b84 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
@@ -2011,13 +2011,20 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
2011 | IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); | 2011 | IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); |
2012 | IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); | 2012 | IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); |
2013 | 2013 | ||
2014 | fcrth = hw->fc.high_water[packetbuf_num] << 10; | ||
2015 | fcrtl = hw->fc.low_water << 10; | 2014 | fcrtl = hw->fc.low_water << 10; |
2016 | 2015 | ||
2017 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { | 2016 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { |
2017 | fcrth = hw->fc.high_water[packetbuf_num] << 10; | ||
2018 | fcrth |= IXGBE_FCRTH_FCEN; | 2018 | fcrth |= IXGBE_FCRTH_FCEN; |
2019 | if (hw->fc.send_xon) | 2019 | if (hw->fc.send_xon) |
2020 | fcrtl |= IXGBE_FCRTL_XONE; | 2020 | fcrtl |= IXGBE_FCRTL_XONE; |
2021 | } else { | ||
2022 | /* | ||
2023 | * If Tx flow control is disabled, set our high water mark | ||
2024 | * to Rx FIFO size minus 32 in order prevent Tx switch | ||
2025 | * loopback from stalling on DMA. | ||
2026 | */ | ||
2027 | fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num)) - 32; | ||
2021 | } | 2028 | } |
2022 | 2029 | ||
2023 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), fcrth); | 2030 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), fcrth); |