Commit 377228ac authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

ixgbe: Prevent u8 wrapping of ITR value to something less than 10us

There were a couple cases where the ITR value generated via the adaptive
ITR scheme could exceed 126. This resulted in the value becoming either 0
or something less than 10. Switching back and forth between a value less
than 10 and a value greater than 10 can cause issues as certain hardware
features such as RSC to not function well when the ITR value has dropped
that low.

CC: stable@vger.kernel.org
Fixes: b4ded832 ("ixgbe: Update adaptive ITR algorithm")
Reported-by: default avatarGregg Leventhal <gleventhal@janestreet.com>
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@linux.intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent f4b752a6
...@@ -2621,7 +2621,7 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector, ...@@ -2621,7 +2621,7 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
/* 16K ints/sec to 9.2K ints/sec */ /* 16K ints/sec to 9.2K ints/sec */
avg_wire_size *= 15; avg_wire_size *= 15;
avg_wire_size += 11452; avg_wire_size += 11452;
} else if (avg_wire_size <= 1980) { } else if (avg_wire_size < 1968) {
/* 9.2K ints/sec to 8K ints/sec */ /* 9.2K ints/sec to 8K ints/sec */
avg_wire_size *= 5; avg_wire_size *= 5;
avg_wire_size += 22420; avg_wire_size += 22420;
...@@ -2654,6 +2654,8 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector, ...@@ -2654,6 +2654,8 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector,
case IXGBE_LINK_SPEED_2_5GB_FULL: case IXGBE_LINK_SPEED_2_5GB_FULL:
case IXGBE_LINK_SPEED_1GB_FULL: case IXGBE_LINK_SPEED_1GB_FULL:
case IXGBE_LINK_SPEED_10_FULL: case IXGBE_LINK_SPEED_10_FULL:
if (avg_wire_size > 8064)
avg_wire_size = 8064;
itr += DIV_ROUND_UP(avg_wire_size, itr += DIV_ROUND_UP(avg_wire_size,
IXGBE_ITR_ADAPTIVE_MIN_INC * 64) * IXGBE_ITR_ADAPTIVE_MIN_INC * 64) *
IXGBE_ITR_ADAPTIVE_MIN_INC; IXGBE_ITR_ADAPTIVE_MIN_INC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment