[dpdk-stable] patch 'net/bnxt: fix timesync when PTP is not supported' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:00:40 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/6260a81282190cf7e019ada470ea062a321f302c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 6260a81282190cf7e019ada470ea062a321f302c Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Thu, 18 Mar 2021 15:05:23 +0530
Subject: [PATCH] net/bnxt: fix timesync when PTP is not supported
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 ]

Fixed to return error when PTP support is not supported on the port.
Also, removed an unnecessary check inside bnxt_get_rx_ts().

Fixes: b11cceb83a34 ("net/bnxt: support timesync")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index d70e37ca60..b719cd74c4 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3198,9 +3198,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts)
 	uint16_t port_id;
 	uint32_t fifo;
 
-	if (!ptp)
-		return -ENODEV;
-
 	fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 +
 				ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO]));
 	if (!(fifo & BNXT_PTP_RX_FIFO_PENDING))
@@ -3233,7 +3230,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	ns = rte_timespec_to_ns(ts);
 	/* Set the timecounters to a new value. */
@@ -3253,7 +3250,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
 	int rc = 0;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	if (BNXT_CHIP_THOR(bp))
 		rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME,
@@ -3275,7 +3272,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev)
 	int rc;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	ptp->rx_filter = 1;
 	ptp->tx_tstamp_en = 1;
@@ -3314,7 +3311,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev)
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	ptp->rx_filter = 0;
 	ptp->tx_tstamp_en = 0;
@@ -3339,7 +3336,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
 	uint64_t ns;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	if (BNXT_CHIP_THOR(bp))
 		rx_tstamp_cycles = ptp->rx_timestamp;
@@ -3362,7 +3359,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 	int rc = 0;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	if (BNXT_CHIP_THOR(bp))
 		rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_PATH_TX,
@@ -3383,7 +3380,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 
 	if (!ptp)
-		return 0;
+		return -ENOTSUP;
 
 	ptp->tc.nsec += delta;
 	ptp->tx_tstamp_tc.nsec += delta;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:28.978051400 +0800
+++ 0092-net-bnxt-fix-timesync-when-PTP-is-not-supported.patch	2021-05-10 23:59:26.460000000 +0800
@@ -1 +1 @@
-From ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 Mon Sep 17 00:00:00 2001
+From 6260a81282190cf7e019ada470ea062a321f302c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 4bdc8223d3..646cc94bd8 100644
+index d70e37ca60..b719cd74c4 100644
@@ -23 +25 @@
-@@ -3399,9 +3399,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts)
+@@ -3198,9 +3198,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts)
@@ -33 +35 @@
-@@ -3434,7 +3431,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
+@@ -3233,7 +3230,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
@@ -42 +44 @@
-@@ -3454,7 +3451,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
+@@ -3253,7 +3250,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
@@ -49 +51 @@
- 	if (BNXT_CHIP_P5(bp))
+ 	if (BNXT_CHIP_THOR(bp))
@@ -51 +53 @@
-@@ -3476,7 +3473,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev)
+@@ -3275,7 +3272,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev)
@@ -60 +62 @@
-@@ -3517,7 +3514,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev)
+@@ -3314,7 +3311,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev)
@@ -69 +71 @@
-@@ -3544,7 +3541,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
+@@ -3339,7 +3336,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
@@ -76 +78 @@
- 	if (BNXT_CHIP_P5(bp))
+ 	if (BNXT_CHIP_THOR(bp))
@@ -78 +80 @@
-@@ -3567,7 +3564,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
+@@ -3362,7 +3359,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
@@ -85 +87 @@
- 	if (BNXT_CHIP_P5(bp))
+ 	if (BNXT_CHIP_THOR(bp))
@@ -87 +89 @@
-@@ -3588,7 +3585,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)
+@@ -3383,7 +3380,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)


More information about the stable mailing list