From 71f5872dd131983932cbfeb5f71345c53473fa81 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Fri, 12 Mar 2021 10:51:09 +0530 Subject: [PATCH] net/bnxt: fix Rx and Tx timestamps 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: b11cceb83a34 ("net/bnxt: support timesync") Cc: stable@dpdk.org Reviewed-by: Lance Richardson Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur --- 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 7124f48013..6cc6af0a66 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3428,6 +3428,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; } @@ -3578,6 +3580,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.20.1