Skip to content

Commit

Permalink
net/bnxt: fix Rx and Tx timestamps
Browse files Browse the repository at this point in the history
[ upstream commit 71f5872 ]

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: b11cceb ("net/bnxt: support timesync")

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>
  • Loading branch information
skotur-brcm authored and cpaelzer committed May 11, 2021
1 parent c0406eb commit 1ad0c43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/bnxt/bnxt_ethdev.c
Expand Up @@ -3506,6 +3506,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;
}
Expand Down Expand Up @@ -3652,6 +3654,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;
}
Expand Down

0 comments on commit 1ad0c43

Please sign in to comment.