diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2010-11-16 22:26:44 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2010-11-16 22:26:44 -0500 |
commit | 16b61beb39f2446460f93c08d4d263dc24f22dd8 (patch) | |
tree | 3901c6f9d786c934f971cffb65dc4fb8577044c8 /drivers/net/ixgbe/ixgbe_82598.c | |
parent | 66c87bd50ddae681ebedfda0d75e6e73ecd29ce7 (diff) |
ixgbe: DCB set PFC high and low water marks per data sheet specs
Currently the high and low water marks for PFC are being set
conservatively for jumbo frames. This means the RX buffers
are being underutilized in the default 1500 MTU. This patch
fixes this so that the water marks are set as described in
the data sheet considering the MTU size.
The equation used is,
RTT * 1.44 + MTU * 1.44 + MTU
Where RTT is the round trip time and MTU is the max frame size
in KB. To avoid floating point arithmetic FC_HIGH_WATER is
defined
((((RTT + MTU) * 144) + 99) / 100) + MTU
This changes how the hardware field fc.low_water and
fc.high_water are used. With this change they are no longer
storing the actual low water and high water markers but are
storing the required head room in the buffer. This simplifies
the logic and we do not need to account for the size of the
buffer when setting the thresholds.
Testing with iperf and 16 threads showed a slight uptick in
throughput over a single traffic class .1-.2Gbps and a reduction
in pause frames. Without the patch a 30 second run would show
~10-15 pause frames being transmitted with the patch ~2-5 are
seen. Test were run back to back with 82599.
Note RXPBSIZE is in KB and low and high water marks fields are
also in KB. However the FCRT* registers are 32B granularity and
right shifted 5 into the register,
(((rx_pbsize - water_mark) * 1024) / 32) << 5
is the most explicit conversion here we simplify
(rx_pbsize - water_mark) * 32 << 5 = (rx_pbsize - water_mark) << 10
This patch updates the PFC thresholds and legacy FC thresholds.
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/ixgbe/ixgbe_82598.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 9c02d6014cc4..25b20f93190a 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -357,6 +357,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
357 | u32 fctrl_reg; | 357 | u32 fctrl_reg; |
358 | u32 rmcs_reg; | 358 | u32 rmcs_reg; |
359 | u32 reg; | 359 | u32 reg; |
360 | u32 rx_pba_size; | ||
360 | u32 link_speed = 0; | 361 | u32 link_speed = 0; |
361 | bool link_up; | 362 | bool link_up; |
362 | 363 | ||
@@ -459,16 +460,18 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
459 | 460 | ||
460 | /* Set up and enable Rx high/low water mark thresholds, enable XON. */ | 461 | /* Set up and enable Rx high/low water mark thresholds, enable XON. */ |
461 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { | 462 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { |
462 | if (hw->fc.send_xon) { | 463 | rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num)); |
463 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), | 464 | rx_pba_size >>= IXGBE_RXPBSIZE_SHIFT; |
464 | (hw->fc.low_water | IXGBE_FCRTL_XONE)); | 465 | |
465 | } else { | 466 | reg = (rx_pba_size - hw->fc.low_water) << 6; |
466 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), | 467 | if (hw->fc.send_xon) |
467 | hw->fc.low_water); | 468 | reg |= IXGBE_FCRTL_XONE; |
468 | } | 469 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg); |
470 | |||
471 | reg = (rx_pba_size - hw->fc.high_water) << 10; | ||
472 | reg |= IXGBE_FCRTH_FCEN; | ||
469 | 473 | ||
470 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), | 474 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg); |
471 | (hw->fc.high_water | IXGBE_FCRTH_FCEN)); | ||
472 | } | 475 | } |
473 | 476 | ||
474 | /* Configure pause time (2 TCs per register) */ | 477 | /* Configure pause time (2 TCs per register) */ |