diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2011-08-22 23:14:22 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-09-29 02:09:59 -0400 |
commit | 9da712d2ede7e3e3a0da180351505310ee271773 (patch) | |
tree | b1892a255c4d20c71b66d8a96c0554cc42463863 /drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c | |
parent | 934c18cc5a2318f525a187e77a46d559d3b8cb44 (diff) |
ixgbe: update {P}FC thresholds to account for X540 and loopback
Revise high and low threshold marks wrt flow control to account
for the X540 devices and latency introduced by the loopback
switch.
Without this it was in theory possible to drop frames on a
supposedly lossless link with X540 or SR-IOV enabled.
Previously we used a magic number in a define to calculate the
threshold values. This made it difficult to sort out exactly
which latencies were or were not being accounted for. Here
I was overly explicit and tried to used #define names that would
be recognizable after reading the IEEE 802.1Qbb specification.
Signed-off-by: John Fastabend <john.r.fastabend@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/intel/ixgbe/ixgbe_dcb_82599.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c index d64fb872978e..02f6724bf48e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c | |||
@@ -210,21 +210,19 @@ s32 ixgbe_dcb_config_tx_data_arbiter_82599(struct ixgbe_hw *hw, | |||
210 | */ | 210 | */ |
211 | s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en) | 211 | s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en) |
212 | { | 212 | { |
213 | u32 i, reg, rx_pba_size; | 213 | u32 i, reg; |
214 | 214 | ||
215 | /* Configure PFC Tx thresholds per TC */ | 215 | /* Configure PFC Tx thresholds per TC */ |
216 | for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { | 216 | for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { |
217 | int enabled = pfc_en & (1 << i); | 217 | int enabled = pfc_en & (1 << i); |
218 | rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)); | ||
219 | rx_pba_size >>= IXGBE_RXPBSIZE_SHIFT; | ||
220 | 218 | ||
221 | reg = (rx_pba_size - hw->fc.low_water) << 10; | 219 | reg = hw->fc.low_water << 10; |
222 | 220 | ||
223 | if (enabled) | 221 | if (enabled) |
224 | reg |= IXGBE_FCRTL_XONE; | 222 | reg |= IXGBE_FCRTL_XONE; |
225 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), reg); | 223 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), reg); |
226 | 224 | ||
227 | reg = (rx_pba_size - hw->fc.high_water) << 10; | 225 | reg = hw->fc.high_water[i] << 10; |
228 | if (enabled) | 226 | if (enabled) |
229 | reg |= IXGBE_FCRTH_FCEN; | 227 | reg |= IXGBE_FCRTH_FCEN; |
230 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), reg); | 228 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), reg); |