netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brice Goglin <brice@myri.com>
To: Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 6/7] myri10ge: fix big_bytes in case of vlan frames
Date: Mon, 11 Dec 2006 11:27:19 +0100	[thread overview]
Message-ID: <457D3287.7050701@myri.com> (raw)
In-Reply-To: <457D31B2.30505@myri.com>

Fix sizing of big_bytes in the case of vlan frames. The 4
VLAN_HLEN bytes were omitted, leading to sizing the big buffer
4 bytes smaller than it should be.  Due to how rx buffers are
carved from pages, this was harmless for the common (9000, 1500)
byte MTUs, but could lead to data corruption for some MTUs.

Signed-off-by: Brice Goglin <brice@myri.com>
---
 drivers/net/myri10ge/myri10ge.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-git/drivers/net/myri10ge/myri10ge.c
===================================================================
--- linux-git.orig/drivers/net/myri10ge/myri10ge.c	2006-12-11 10:52:51.000000000 +0100
+++ linux-git/drivers/net/myri10ge/myri10ge.c	2006-12-11 10:53:06.000000000 +0100
@@ -1696,11 +1696,11 @@
 	 * tell him the buffer is larger, because we only use 1
 	 * buffer/pkt, and the mtu will prevent overruns.
 	 */
-	big_pow2 = dev->mtu + ETH_HLEN + MXGEFW_PAD;
+	big_pow2 = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD;
 	if (big_pow2 < MYRI10GE_ALLOC_SIZE / 2) {
 		while ((big_pow2 & (big_pow2 - 1)) != 0)
 			big_pow2++;
-		mgp->big_bytes = dev->mtu + ETH_HLEN + MXGEFW_PAD;
+		mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD;
 	} else {
 		big_pow2 = MYRI10GE_ALLOC_SIZE;
 		mgp->big_bytes = big_pow2;



  parent reply	other threads:[~2006-12-11 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 10:23 [PATCH 0/7] myri10ge updates Brice Goglin
2006-12-11 10:24 ` [PATCH 1/7] myri10ge: indentation cleanups Brice Goglin
2006-12-11 14:54   ` Jeff Garzik
2006-12-11 10:25 ` [PATCH 2/7] myri10ge: add page-based skb routines Brice Goglin
2006-12-11 10:25 ` [PATCH 3/7] myri10ge: switch to page-based skb Brice Goglin
2006-12-11 10:26 ` [PATCH 4/7] myri10ge: drop contiguous skb routines Brice Goglin
2006-12-11 10:26 ` [PATCH 5/7] myri10ge: Full vlan frame in small_bytes Brice Goglin
2006-12-11 10:27 ` Brice Goglin [this message]
2006-12-11 10:27 ` [PATCH 7/7] myri10ge: update driver version to 1.1.0 Brice Goglin

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=457D3287.7050701@myri.com \
    --to=brice@myri.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).