bnxt_en: Restore PTP tx_avail count in case of skb_pad() error
The current code only restores PTP tx_avail count when we get DMA
mapping errors. Fix it so that the PTP tx_avail count will be
restored for both DMA mapping errors and skb_pad() errors.
Otherwise PTP TX timestamp will not be available after a PTP
packet hits the skb_pad() error.
Fixes: 83bb623c96
("bnxt_en: Transmit and retrieve packet timestamps")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240618215313.29631-4-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b7bfcb4c7c
commit
1e7962114c
1 changed files with 2 additions and 3 deletions
|
@ -732,9 +732,6 @@ tx_done:
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
|
|
||||||
tx_dma_error:
|
tx_dma_error:
|
||||||
if (BNXT_TX_PTP_IS_SET(lflags))
|
|
||||||
atomic_inc(&bp->ptp_cfg->tx_avail);
|
|
||||||
|
|
||||||
last_frag = i;
|
last_frag = i;
|
||||||
|
|
||||||
/* start back at beginning and unmap skb */
|
/* start back at beginning and unmap skb */
|
||||||
|
@ -756,6 +753,8 @@ tx_dma_error:
|
||||||
tx_free:
|
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))
|
||||||
|
atomic_inc(&bp->ptp_cfg->tx_avail);
|
||||||
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[txr->tx_prod].skb = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue