All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net 5/8] ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size
Date: Wed,  8 Feb 2012 01:36:35 -0800	[thread overview]
Message-ID: <1328693798-27323-6-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1328693798-27323-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>

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: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 819b5c0..0688704 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter,
 	/*
 	 * we must limit the number of descriptors so that the
 	 * total size of max desc * buf_len is not greater
-	 * than 65535
+	 * than 65536
 	 */
 	if (ring_is_ps_enabled(ring)) {
-#if (MAX_SKB_FRAGS > 16)
+#if (PAGE_SIZE < 8192)
 		rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
-#elif (MAX_SKB_FRAGS > 8)
+#elif (PAGE_SIZE < 16384)
 		rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
-#elif (MAX_SKB_FRAGS > 4)
+#elif (PAGE_SIZE < 32768)
 		rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
 #else
 		rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
 #endif
 	} else {
-		if (rx_buf_len < IXGBE_RXBUFFER_4K)
+		if (rx_buf_len <= IXGBE_RXBUFFER_4K)
 			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;
 		else
 			rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
-- 
1.7.7.6

  parent reply	other threads:[~2012-02-08  9:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  9:36 [net 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-08  9:36 ` [net 1/8] e1000: add dropped DMA receive enable back in for WoL Jeff Kirsher
2012-02-08  9:36 ` [net 2/8] igb: fix vf lookup Jeff Kirsher
2012-02-08 23:42   ` Rose, Gregory V
2012-02-08 23:49     ` Joe Perches
2012-02-08 23:52       ` David Miller
2012-02-08 23:55         ` Rose, Gregory V
2012-02-09  9:10       ` Jeff Kirsher
2012-02-08  9:36 ` [net 3/8] ixgbe: " Jeff Kirsher
2012-02-08 23:33   ` David Miller
2012-02-08 23:39     ` Rose, Gregory V
2012-02-09  9:06     ` Jeff Kirsher
2012-02-08  9:36 ` [net 4/8] ixgbe: Fix case of Tx Hang in PF with 32 VFs Jeff Kirsher
2012-02-08  9:36 ` Jeff Kirsher [this message]
2012-02-08  9:36 ` [net 6/8] ixgbe: do not update real num queues when netdev is going away Jeff Kirsher
2012-02-08  9:36 ` [net 7/8] ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state Jeff Kirsher
2012-02-08  9:36 ` [net 8/8] ixgbe: ethtool: stats user buffer overrun Jeff Kirsher
2012-02-08 15:17   ` Ben Hutchings
2012-02-09  9:34 [net v2 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-09  9:34 ` [net 5/8] ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328693798-27323-6-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.