Commit 642c680e authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size

This patch fixes an issue in which RSC will generate corrupted frames when
PAGE_SIZE is larger than 8K.  Specifically it looks like that in 2.6.39 a
change was made so that GRO would always have at least 16 frags available
for coalescing, but the ixgbe RSC logic was not updated.  As such the RSC
feature would generate a frame larger than 64K and then overflow the value
in the IP length field.

To correct that I am now basing things on the PAGE_SIZE.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: default avatarStephen Ko <stephen.s.ko@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 4cd6923d
...@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter, ...@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter,
/* /*
* we must limit the number of descriptors so that the * we must limit the number of descriptors so that the
* total size of max desc * buf_len is not greater * total size of max desc * buf_len is not greater
* than 65535 * than 65536
*/ */
if (ring_is_ps_enabled(ring)) { if (ring_is_ps_enabled(ring)) {
#if (MAX_SKB_FRAGS > 16) #if (PAGE_SIZE < 8192)
rscctrl |= IXGBE_RSCCTL_MAXDESC_16; rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
#elif (MAX_SKB_FRAGS > 8) #elif (PAGE_SIZE < 16384)
rscctrl |= IXGBE_RSCCTL_MAXDESC_8; rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
#elif (MAX_SKB_FRAGS > 4) #elif (PAGE_SIZE < 32768)
rscctrl |= IXGBE_RSCCTL_MAXDESC_4; rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
#else #else
rscctrl |= IXGBE_RSCCTL_MAXDESC_1; rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
#endif #endif
} else { } else {
if (rx_buf_len < IXGBE_RXBUFFER_4K) if (rx_buf_len <= IXGBE_RXBUFFER_4K)
rscctrl |= IXGBE_RSCCTL_MAXDESC_16; rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
else if (rx_buf_len < IXGBE_RXBUFFER_8K) else if (rx_buf_len <= IXGBE_RXBUFFER_8K)
rscctrl |= IXGBE_RSCCTL_MAXDESC_8; rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
else else
rscctrl |= IXGBE_RSCCTL_MAXDESC_4; rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
......
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