Skip to content

Commit

Permalink
bnx2x: Prevent load reordering in tx completion processing
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
bjking1 authored and davem330 committed Jul 21, 2019
1 parent 0cea0e1 commit ea811b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
hw_cons = le16_to_cpu(*txdata->tx_cons_sb);
sw_cons = txdata->tx_pkt_cons;

/* Ensure subsequent loads occur after hw_cons */
smp_rmb();

while (sw_cons != hw_cons) {
u16 pkt_cons;

Expand Down

0 comments on commit ea811b7

Please sign in to comment.