net/bnxt: fix Rx and Tx timestamps
authorSomnath Kotur <somnath.kotur@broadcom.com>
Fri, 12 Mar 2021 05:21:09 +0000 (10:51 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 12 Mar 2021 15:27:03 +0000 (16:27 +0100)
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 <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 7124f48..6cc6af0 100644 (file)
@@ -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;
 }