Skip to content

Commit a4af244

Browse files
bjking1gregkh
authored andcommitted
bnx2x: Prevent load reordering in tx completion processing
[ Upstream commit ea811b7 ] This patch fixes an issue seen on Power systems with bnx2x which results in the skb is NULL WARN_ON in bnx2x_free_tx_pkt firing due to the skb pointer getting loaded in bnx2x_free_tx_pkt prior to the hw_cons load in bnx2x_tx_int. Adding a read memory barrier resolves the issue. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 40f8aa1 commit a4af244

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
288288
hw_cons = le16_to_cpu(*txdata->tx_cons_sb);
289289
sw_cons = txdata->tx_pkt_cons;
290290

291+
/* Ensure subsequent loads occur after hw_cons */
292+
smp_rmb();
293+
291294
while (sw_cons != hw_cons) {
292295
u16 pkt_cons;
293296

0 commit comments

Comments
 (0)