netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: netdev@vger.kernel.org
Cc: Vladislav Zolotarov <vladz@broadcom.com>,
	Eilon Greenstein <eilong@broadcom.com>,
	Michael Chan <mchan@broadcom.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [PATCH 3/4] bnx2x: change smp_mb() comment to conform the true
Date: Tue,  9 Mar 2010 17:55:02 +0100	[thread overview]
Message-ID: <1268153703-4186-3-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1268153703-4186-2-git-send-email-sgruszka@redhat.com>

Access to fp->tx_bp_prod is protected by __netif_tx_lock,
smp_mb() is not needed for that.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/bnx2x_main.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ae62b67..6c042a7 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -11428,9 +11428,12 @@ static netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) {
 		netif_tx_stop_queue(txq);
-		/* We want bnx2x_tx_int to "see" the updated tx_bd_prod
-		   if we put Tx into XOFF state. */
+
+		/* paired memory barrier is in bnx2x_tx_int(), we have to keep
+		 * ordering of set_bit() in netif_tx_stop_queue() and read of
+		 * fp->bd_tx_cons */
 		smp_mb();
+
 		fp->eth_q_stats.driver_xoff++;
 		if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3)
 			netif_tx_wake_queue(txq);
-- 
1.6.2.5


  reply	other threads:[~2010-03-09 16:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 16:55 [PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations Stanislaw Gruszka
2010-03-09 16:55 ` [PATCH 2/4] bnx2x: remove not necessary compiler barrier Stanislaw Gruszka
2010-03-09 16:55   ` Stanislaw Gruszka [this message]
2010-03-09 16:55     ` [PATCH 4/4] bnx2x: merge common code when stopping queue Stanislaw Gruszka
2010-03-10 16:02       ` Eilon Greenstein
2010-03-10 16:01     ` [PATCH 3/4] bnx2x: change smp_mb() comment to conform the true Eilon Greenstein
2010-03-15 22:47       ` David Miller
2010-03-10 16:00   ` [PATCH 2/4] bnx2x: remove not necessary compiler barrier Eilon Greenstein
2010-03-15 22:47     ` David Miller
2010-03-10 15:59 ` [PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations Eilon Greenstein
2010-03-15 22:47   ` David Miller

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=1268153703-4186-3-git-send-email-sgruszka@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=eilong@broadcom.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=vladz@broadcom.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 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).