Skip to content

Commit ff0d601

Browse files
author
Ken Cox
committed
bnxt_en: Restore PTP tx_avail count in case of skb_pad() error
JIRA: https://issues.redhat.com/browse/RHEL-19811 JIRA: https://issues.redhat.com/browse/RHEL-23120 JIRA: https://issues.redhat.com/browse/RHEL-25505 commit 1e79621 Author: Pavan Chebbi <pavan.chebbi@broadcom.com> Date: Tue Jun 18 14:53:13 2024 -0700 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 <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> Signed-off-by: Ken Cox <jkc@redhat.com>
1 parent 8e66b35 commit ff0d601

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
@@ -678,9 +678,6 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
678678
return NETDEV_TX_OK;
679679

680680
tx_dma_error:
681-
if (BNXT_TX_PTP_IS_SET(lflags))
682-
atomic_inc(&bp->ptp_cfg->tx_avail);
683-
684681
last_frag = i;
685682

686683
/* start back at beginning and unmap skb */
@@ -702,6 +699,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
702699
tx_free:
703700
dev_kfree_skb_any(skb);
704701
tx_kick_pending:
702+
if (BNXT_TX_PTP_IS_SET(lflags))
703+
atomic_inc(&bp->ptp_cfg->tx_avail);
705704
if (txr->kick_pending)
706705
bnxt_txr_db_kick(bp, txr, txr->tx_prod);
707706
txr->tx_buf_ring[txr->tx_prod].skb = NULL;

0 commit comments

Comments
 (0)