netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/3 net-next] bnx2: Add missing memory barrier in bnx2_start_xmit()
Date: Sun, 5 Feb 2012 17:24:39 -0800	[thread overview]
Message-ID: <1328491480-13030-2-git-send-email-mchan@broadcom.com> (raw)
In-Reply-To: <1328491480-13030-1-git-send-email-mchan@broadcom.com>

From: Vlad Zolotarov <vlad@scalemp.com>

Sync DMA descriptor before hitting the TX mailbox for weak memory model
CPUs.

There has been discussions several years ago about this.  Some believe
that writel() should guarantee ordering.  Others want explicit barriers
if necessary.  Today writel() does not have the ordering guarantee and
many other drivers use explicit barriers.

Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 2ab31da..7105989 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -6565,6 +6565,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	}
 	txbd->tx_bd_vlan_tag_flags |= TX_BD_FLAGS_END;
 
+	/* Sync BD data before updating TX mailbox */
+	wmb();
+
 	netdev_tx_sent_queue(txq, skb->len);
 
 	prod = NEXT_TX_BD(prod);
-- 
1.6.4.GIT

  reply	other threads:[~2012-02-06  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06  1:24 [PATCH 1/3 net-next] bnx2: Add support for ethtool --show-channels|--set-channels Michael Chan
2012-02-06  1:24 ` Michael Chan [this message]
2012-02-06  1:24   ` [PATCH 3/3 net-next] cnic: Add FCoE parity error recovery Michael Chan
2012-02-06  3:46     ` David Miller
2012-02-06  3:46   ` [PATCH 2/3 net-next] bnx2: Add missing memory barrier in bnx2_start_xmit() David Miller
2012-02-06  3:46 ` [PATCH 1/3 net-next] bnx2: Add support for ethtool --show-channels|--set-channels David Miller
2012-02-07 20:19 ` Ben Hutchings
2012-02-07 20:58   ` Michael Chan
2012-02-07 22:01     ` Ben Hutchings
2012-02-07 22:36       ` Ben Hutchings
2012-02-08  1:19         ` Jesse Brandeburg

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=1328491480-13030-2-git-send-email-mchan@broadcom.com \
    --to=mchan@broadcom.com \
    --cc=davem@davemloft.net \
    --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).