[dpdk-dev] [PATCH 2/2] net/bnxt: fix Rx and Tx timestamp assignment

Somnath Kotur somnath.kotur at broadcom.com
Fri Mar 12 06:21:09 CET 2021


timesync adjust and write_time APIs needed to account for the Rx and Tx
timestamp counters as well. Fix it since it was not done earlier.

Fixes: b11cceb83a3 ("net/bnxt: support timesync")
Cc: stable at dpdk.org

Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde at broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3f28e0ea45..6d0719f2d8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3427,6 +3427,8 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
 	ns = rte_timespec_to_ns(ts);
 	/* Set the timecounters to a new value. */
 	ptp->tc.nsec = ns;
+	ptp->tx_tstamp_tc.nsec = ns;
+	ptp->rx_tstamp_tc.nsec = ns;
 
 	return 0;
 }
@@ -3577,6 +3579,8 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)
 		return 0;
 
 	ptp->tc.nsec += delta;
+	ptp->tx_tstamp_tc.nsec += delta;
+	ptp->rx_tstamp_tc.nsec += delta;
 
 	return 0;
 }
-- 
2.28.0.497.g54e85e7



More information about the dev mailing list