mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
eth: bnxt: fix missing ring index trim on error path
Commit under Fixes converted tx_prod to be free running but missed
masking it on the Tx error path. This crashes on error conditions,
for example when DMA mapping fails.
Fixes: 6d1add9553
("bnxt_en: Modify TX ring indexing logic.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250414143210.458625-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
903d2b9f9e
commit
12f2d033fa
@ -787,7 +787,7 @@ tx_free:
|
|||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
tx_kick_pending:
|
tx_kick_pending:
|
||||||
if (BNXT_TX_PTP_IS_SET(lflags)) {
|
if (BNXT_TX_PTP_IS_SET(lflags)) {
|
||||||
txr->tx_buf_ring[txr->tx_prod].is_ts_pkt = 0;
|
txr->tx_buf_ring[RING_TX(bp, txr->tx_prod)].is_ts_pkt = 0;
|
||||||
atomic64_inc(&bp->ptp_cfg->stats.ts_err);
|
atomic64_inc(&bp->ptp_cfg->stats.ts_err);
|
||||||
if (!(bp->fw_cap & BNXT_FW_CAP_TX_TS_CMP))
|
if (!(bp->fw_cap & BNXT_FW_CAP_TX_TS_CMP))
|
||||||
/* set SKB to err so PTP worker will clean up */
|
/* set SKB to err so PTP worker will clean up */
|
||||||
@ -795,7 +795,7 @@ tx_kick_pending:
|
|||||||
}
|
}
|
||||||
if (txr->kick_pending)
|
if (txr->kick_pending)
|
||||||
bnxt_txr_db_kick(bp, txr, txr->tx_prod);
|
bnxt_txr_db_kick(bp, txr, txr->tx_prod);
|
||||||
txr->tx_buf_ring[txr->tx_prod].skb = NULL;
|
txr->tx_buf_ring[RING_TX(bp, txr->tx_prod)].skb = NULL;
|
||||||
dev_core_stats_tx_dropped_inc(dev);
|
dev_core_stats_tx_dropped_inc(dev);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user