Skip to content

Commit

Permalink
bnx2: Add missing memory barrier in bnx2_start_xmit()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vlad Zolotarov authored and David S. Miller committed Feb 6, 2012
1 parent b033281 commit 94bf91b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 94bf91b

Please sign in to comment.