Patchwork [3/4] bnx2x: change smp_mb() comment to conform the true

login
register
mail settings
Submitter Stanislaw Gruszka
Date March 9, 2010, 4:55 p.m.
Message ID <1268153703-4186-3-git-send-email-sgruszka@redhat.com>
Download mbox | patch
Permalink /patch/47174/
State Accepted
Delegated to: David Miller
Headers show

Comments

Stanislaw Gruszka - March 9, 2010, 4:55 p.m.
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(-)
Eilon Greenstein - March 10, 2010, 4:01 p.m.
On Tue, 2010-03-09 at 08:55 -0800, Stanislaw Gruszka wrote:
> 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>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - March 15, 2010, 10:47 p.m.
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 10 Mar 2010 18:01:16 +0200

> On Tue, 2010-03-09 at 08:55 -0800, Stanislaw Gruszka wrote:
>> 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>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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);