]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Enable M_TSTMP in Chelsio cxgbe driver by creating a mechanism that can sync the...
authorRandall Stewart <rrs@FreeBSD.org>
Tue, 20 Sep 2022 19:13:16 +0000 (15:13 -0400)
committerRandall Stewart <rrs@FreeBSD.org>
Tue, 20 Sep 2022 19:13:16 +0000 (15:13 -0400)
commite398922eaf66978b5e556f6b4b095693c865f329
tree5e5a82ee588a1e1d6a642c5eff4786b9fd4b8f02
parentb77b3099685f27fa1da89cb5b8f376bef87b05ec
Enable M_TSTMP in Chelsio cxgbe driver by creating a mechanism that can sync the time.

Chelsio has always been recording a timestamp in the mbuf (rcv_tstmp) but
not setting the M_TSTMP bit in the mbuf flags. This is because the timestamp
was just the free running 60bit clock. This change fixes that so that
we keep a synchronization by periodically (every 30 seconds after startup)
getting the timestamp and the current nanosecond time. We always keep
several sets around and the current one we always keep the current pair
and the previous pair of timestamps. This allows us to setup a ratio
between the two so we can correctly translate the time. Note that
we use special care to split the timestamp into seconds (per the clock tick)
and nanoseconds otherwise 64bit math would overflow.

Reviewed by: np
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36315
sys/dev/cxgbe/adapter.h
sys/dev/cxgbe/t4_main.c
sys/dev/cxgbe/t4_sge.c