Skip to content

Commit 1e79621

Browse files
Pavan Chebbikuba-moo
authored andcommitted
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: 83bb623 ("bnxt_en: Transmit and retrieve packet timestamps") Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b7bfcb4 commit 1e79621

File tree

1 file changed

+2
-3
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-3
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,6 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
732732
return NETDEV_TX_OK;
733733

734734
tx_dma_error:
735-
if (BNXT_TX_PTP_IS_SET(lflags))
736-
atomic_inc(&bp->ptp_cfg->tx_avail);
737-
738735
last_frag = i;
739736

740737
/* start back at beginning and unmap skb */
@@ -756,6 +753,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
756753
tx_free:
757754
dev_kfree_skb_any(skb);
758755
tx_kick_pending:
756+
if (BNXT_TX_PTP_IS_SET(lflags))
757+
atomic_inc(&bp->ptp_cfg->tx_avail);
759758
if (txr->kick_pending)
760759
bnxt_txr_db_kick(bp, txr, txr->tx_prod);
761760
txr->tx_buf_ring[txr->tx_prod].skb = NULL;

0 commit comments

Comments
 (0)