netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: jeff@garzik.org
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [NET-NEXT PATCH 08/25] ixgb: fix race on rx_buffer_len in mtu change
Date: Tue, 08 Jul 2008 15:51:42 -0700	[thread overview]
Message-ID: <20080708225142.6925.9117.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080708224858.6925.29725.stgit@localhost.localdomain>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

some random coverage testing found that when changing mtu
under heavy traffic load, NAPI would use the rx_buffer_len variable
after it had been changed by change_mtu.

Similar to e1000 bugs found long ago.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 4bf6bbc..c3234c4 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1573,14 +1573,18 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
 		return -EINVAL;
 	}
 
+	if (old_max_frame == max_frame)
+		return 0;
+
+	if (netif_running(netdev))
+		ixgb_down(adapter, true);
+
 	adapter->rx_buffer_len = max_frame + 8; /* + 8 for errata */
 
 	netdev->mtu = new_mtu;
 
-	if ((old_max_frame != max_frame) && netif_running(netdev)) {
-		ixgb_down(adapter, true);
+	if (netif_running(netdev))
 		ixgb_up(adapter);
-	}
 
 	return 0;
 }


  parent reply	other threads:[~2008-07-08 22:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08 22:51 [NET-NEXT PATCH 00/25] ixgb: update to latest Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 01/25] ixgb: maybe stop tx port missed a piece Jeff Kirsher
2008-07-11  5:21   ` Jeff Garzik
2008-07-08 22:51 ` [NET-NEXT PATCH 02/25] ixgb: repeat 32 bit ioremap cleanup Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 03/25] ixgb: fix bug in descriptor ring due to prefetch corruption Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 04/25] ixgb: leave room for extra hardware memory usage Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 05/25] ixgb: check down state before enable irq Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 06/25] ixgb: don't allow too small MTU Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 07/25] ixgb: move time stamp set before setting dma pointer Jeff Kirsher
2008-07-08 22:51 ` Jeff Kirsher [this message]
2008-07-08 22:51 ` [NET-NEXT PATCH 09/25] ixgb: fix unload race with timers Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 10/25] ixgb: remove lltx support and update tx routine Jeff Kirsher
2008-07-08 22:51 ` [NET-NEXT PATCH 11/25] ixgb: update readme text Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 12/25] ixgb: add copybreak parameter Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 13/25] ixgb: clean up un-necessary declarations Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 14/25] ixgb: format all if( to be if ( Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 15/25] ixgb: cleanup space after while Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 16/25] ixgb: whitespace fixups Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 17/25] ixgb: fix spelling errors Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 18/25] ixgb: trivial fix space after for Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 19/25] ixgb: cleanup checkpatch suggestions that are relevant Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 20/25] ixgb: rx cleanup performance improvements Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 21/25] ixgb: clean up assignments inside if statements Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 22/25] ixgb: audit use of dev_kfree_skb_any Jeff Kirsher
2008-07-08 22:52 ` [NET-NEXT PATCH 23/25] ixgb: cleanup header Jeff Kirsher
2008-07-08 22:53 ` [NET-NEXT PATCH 24/25] ixgb: make NAPI the only option and the default Jeff Kirsher
2008-07-08 22:53 ` [NET-NEXT PATCH 25/25] ixgb: update copyright dates and versions 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=20080708225142.6925.9117.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=jesse.brandeburg@intel.com \
    --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).