提交 94bf91ba 编写于 作者: V Vlad Zolotarov 提交者: David S. Miller

bnx2: Add missing memory barrier in bnx2_start_xmit()

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: NVlad Zolotarov <vlad@scalemp.com>
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b033281f
...@@ -6565,6 +6565,9 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -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; 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); netdev_tx_sent_queue(txq, skb->len);
prod = NEXT_TX_BD(prod); prod = NEXT_TX_BD(prod);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册