diff mbox

[1/4] bnx2x: use smp_mb() to keep ordering of read write operations

Message ID 1268153703-4186-1-git-send-email-sgruszka@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Stanislaw Gruszka March 9, 2010, 4:55 p.m. UTC
Since we want to keep ordering of write to fp->bd_tx_cons and
netif_tx_queue_stopped(txq), what is read of txq->state, we have to use
general memory barrier.

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

Comments

Eilon Greenstein March 10, 2010, 3:59 p.m. UTC | #1
On Tue, 2010-03-09 at 08:55 -0800, Stanislaw Gruszka wrote:
> Since we want to keep ordering of write to fp->bd_tx_cons and
> netif_tx_queue_stopped(txq), what is read of txq->state, we have to use
> general memory barrier.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Singed-of-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. UTC | #2
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 10 Mar 2010 17:59:44 +0200

> On Tue, 2010-03-09 at 08:55 -0800, Stanislaw Gruszka wrote:
>> Since we want to keep ordering of write to fp->bd_tx_cons and
>> netif_tx_queue_stopped(txq), what is read of txq->state, we have to use
>> general memory barrier.
>> 
>> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Singed-of-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
diff mbox

Patch

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ed785a3..9fc0f6a 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -963,7 +963,7 @@  static int bnx2x_tx_int(struct bnx2x_fastpath *fp)
 	 * start_xmit() will miss it and cause the queue to be stopped
 	 * forever.
 	 */
-	smp_wmb();
+	smp_mb();
 
 	/* TBD need a thresh? */
 	if (unlikely(netif_tx_queue_stopped(txq))) {