patch 'net/bnxt: support PTP for Thor2' has been queued to stable release 24.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 11 15:20:56 CEST 2026


Hi,

FYI, your patch has been queued to stable release 24.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/63deffaef96626f3eb61638ab12fe570fb352f79

Thanks.

Luca Boccassi

---
>From 63deffaef96626f3eb61638ab12fe570fb352f79 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Sun, 25 Aug 2024 03:52:47 -0700
Subject: [PATCH] net/bnxt: support PTP for Thor2

[ upstream commit 01a02596d47be27c476846aac4eced81e291fb37 ]

If firmware advertises support for the TX timestamp completion and
PTP is also supported, then enable this feature when allocating TX
rings.

The new BCM5760X chips will return the timestamp of TX packets in a
new completion. Add logic to handle this completion type to retrieve
the timestamp.

Logic to retrieve Rx timestamp is same as Thor.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  3 +++
 drivers/net/bnxt/bnxt_ethdev.c |  8 +++++---
 drivers/net/bnxt/bnxt_hwrm.c   |  8 +++++++-
 drivers/net/bnxt/bnxt_rxr.c    | 10 +++++-----
 drivers/net/bnxt/bnxt_txr.c    | 16 ++++++++++++++++
 5 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0402de3eb9..6e439cb87b 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -404,6 +404,8 @@ struct bnxt_ptp_cfg {
 	uint64_t			current_time;
 	uint64_t			old_time;
 	rte_spinlock_t			ptp_lock;
+	/* On P7, the Tx timestamp is present in the Tx completion record */
+	uint64_t			tx_timestamp;
 };
 
 struct bnxt_coal {
@@ -874,6 +876,7 @@ struct bnxt {
 	 (bp)->hwrm_spec_code >= HWRM_VERSION_1_9_2 && \
 	 !BNXT_VF((bp)))
 #define BNXT_FW_CAP_UDP_GSO		BIT(13)
+#define BNXT_FW_CAP_TX_TS_CMP		BIT(16)
 #define BNXT_TRUFLOW_EN(bp)	((bp)->fw_cap & BNXT_FW_CAP_TRUFLOW_EN &&\
 				 (bp)->app_id != 0xFF)
 
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e6c3acaa03..d90a418f2c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3820,9 +3820,11 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 	if (!ptp)
 		return -ENOTSUP;
 
-	/* TODO Revisit for Thor 2 */
-	rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_PATH_TX,
-				     &tx_tstamp_cycles);
+	if (BNXT_CHIP_P7(bp))
+		tx_tstamp_cycles = ptp->tx_timestamp;
+	else
+		rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_PATH_TX,
+					     &tx_tstamp_cycles);
 
 	ns = rte_timecounter_update(&ptp->tx_tstamp_tc, tx_tstamp_cycles);
 	*timestamp = rte_ns_to_timespec(ns);
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index c80425c948..e34929515e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1027,7 +1027,8 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
 
 	HWRM_CHECK_RESULT();
 
-	if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS))
+	if (!BNXT_CHIP_P7(bp) &&
+	    !(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS))
 		return 0;
 
 	if (resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS)
@@ -1224,6 +1225,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_UDP_GSO;
+	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_TX_PKT_TS_CMPL_SUPPORTED)
+		bp->fw_cap |= BNXT_FW_CAP_TX_TS_CMP;
 	if (flags_ext3 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RX_RATE_PROFILE_SEL_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_RX_RATE_PROFILE;
 
@@ -2189,6 +2192,9 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
 		if (stats_ctx_id != INVALID_STATS_CTX_ID)
 			enables |=
 			HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID;
+		if (bp->fw_cap & BNXT_FW_CAP_TX_TS_CMP && bp->ptp_cfg)
+			req.flags =
+				rte_cpu_to_le_16(HWRM_RING_ALLOC_INPUT_FLAGS_TX_PKT_TS_CMPL_ENABLE);
 		break;
 	case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX:
 		req.ring_type = ring_type;
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 16547a5cb6..76f0201de4 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -740,13 +740,13 @@ static void bnxt_get_rx_ts(struct bnxt *bp)
 }
 
 static void
-bnxt_get_rx_ts_p5(struct bnxt *bp, uint32_t rx_ts_cmpl)
+bnxt_get_rx_ts_p5_p7(struct bnxt *bp, uint32_t rx_ts_cmpl)
 {
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
-	uint64_t last_hwrm_time = 0;
+	uint64_t last_hwrm_time;
 	uint64_t pkt_time = 0;
 
-	if (!BNXT_CHIP_P5(bp) || !ptp)
+	if (!ptp)
 		return;
 
 	/* On P5, Rx timestamps are provided directly in the
@@ -1206,8 +1206,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 		      RX_PKT_CMPL_FLAGS_MASK) ==
 		      RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP) ||
 		      bp->ptp_all_rx_tstamp) {
-		if (BNXT_CHIP_P5(bp))
-			bnxt_get_rx_ts_p5(rxq->bp, rxcmp1->reorder);
+		if (BNXT_CHIP_P5_P7(bp))
+			bnxt_get_rx_ts_p5_p7(rxq->bp, rxcmp1->reorder);
 		else
 			bnxt_get_rx_ts(rxq->bp);
 	}
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index bdfb0a63a2..9a5bcec177 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -599,6 +599,20 @@ static bool bnxt_is_tx_cmpl_type(uint16_t type)
 		type == CMPL_BASE_TYPE_TX_L2);
 }
 
+static void bnxt_get_tx_ts_p7(struct bnxt *bp, struct tx_cmpl_packet_timestamp *txcmp)
+{
+	uint64_t tx_timestamp;
+
+	if (!(bp->fw_cap & BNXT_FW_CAP_TX_TS_CMP))
+		return;
+
+	if (!bp->ptp_cfg || !bp->ieee_1588)
+		return;
+
+	tx_timestamp = rte_le_to_cpu_16(txcmp->ts_ns_mid);
+	bp->ptp_cfg->tx_timestamp = (tx_timestamp << 32) | rte_le_to_cpu_32(txcmp->ts_ns_lo);
+}
+
 static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 {
 	uint32_t nb_tx_pkts = 0, cons, ring_mask, opaque;
@@ -628,6 +642,8 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 			RTE_LOG_DP_LINE(ERR, BNXT,
 					"Unhandled CMP type %02x",
 					CMP_TYPE(txcmp));
+		if (CMP_TYPE(txcmp) == CMPL_BASE_TYPE_TX_L2_PKT_TS)
+			bnxt_get_tx_ts_p7(txq->bp, (struct tx_cmpl_packet_timestamp *)txcmp);
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
 
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-06-11 14:20:05.526484940 +0100
+++ 0107-net-bnxt-support-PTP-for-Thor2.patch	2026-06-11 14:20:01.366749676 +0100
@@ -1 +1 @@
-From 01a02596d47be27c476846aac4eced81e291fb37 Mon Sep 17 00:00:00 2001
+From 63deffaef96626f3eb61638ab12fe570fb352f79 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 01a02596d47be27c476846aac4eced81e291fb37 ]
+
@@ -16,2 +17,0 @@
-Cc: stable at dpdk.org
-
@@ -29 +29 @@
-index 7515f0564f..03df28e64a 100644
+index 0402de3eb9..6e439cb87b 100644
@@ -32 +32 @@
-@@ -410,6 +410,8 @@ struct bnxt_ptp_cfg {
+@@ -404,6 +404,8 @@ struct bnxt_ptp_cfg {
@@ -41 +41 @@
-@@ -892,6 +894,7 @@ struct bnxt {
+@@ -874,6 +876,7 @@ struct bnxt {
@@ -50 +50 @@
-index 6049698ada..6357098d1d 100644
+index e6c3acaa03..d90a418f2c 100644
@@ -53 +53 @@
-@@ -3889,9 +3889,11 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
+@@ -3820,9 +3820,11 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
@@ -69 +69 @@
-index 68e75e43bd..e4ae27d3f4 100644
+index c80425c948..e34929515e 100644
@@ -91 +91 @@
-@@ -2192,6 +2195,9 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
+@@ -2189,6 +2192,9 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
@@ -102 +102 @@
-index fb7c70fd45..293b5c03b6 100644
+index 16547a5cb6..76f0201de4 100644
@@ -122,4 +122,4 @@
-@@ -1210,8 +1210,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
- 		      bp->ptp_cfg) {
- 		mbuf->ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP |
- 				  RTE_MBUF_F_RX_IEEE1588_TMST;
+@@ -1206,8 +1206,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
+ 		      RX_PKT_CMPL_FLAGS_MASK) ==
+ 		      RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP) ||
+ 		      bp->ptp_all_rx_tstamp) {
@@ -132 +132 @@
- #ifndef RTE_IOVA_IN_MBUF
+ 	}
@@ -134 +134 @@
-index 7ef5b15ae8..fb5be224d9 100644
+index bdfb0a63a2..9a5bcec177 100644
@@ -137 +137 @@
-@@ -600,6 +600,20 @@ static bool bnxt_is_tx_cmpl_type(uint16_t type)
+@@ -599,6 +599,20 @@ static bool bnxt_is_tx_cmpl_type(uint16_t type)
@@ -158 +158 @@
-@@ -629,6 +643,8 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
+@@ -628,6 +642,8 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)


More information about the stable mailing list