aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-11-07 09:29:14 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-11-07 09:29:14 +0000
commit3cf8254f1ea9666c9cd7bd55e56b4c8543505113 (patch)
tree524b77ccf60f205547bb8cad37e8707e37ca7d13 /sys/net/if.h
parentd61b3d7a720f36fdff69749c8096546a3ba8aba4 (diff)
downloadsrc-3cf8254f1ea9666c9cd7bd55e56b4c8543505113.tar.gz
src-3cf8254f1ea9666c9cd7bd55e56b4c8543505113.zip
Add a place for a driver to report rx timestamps in nanoseconds from
boot for the received packets. The rcv_tstmp field overlaps the place of Ln header length indicators, not used by received packets. The basic pkthdr rearrangement change in sys/mbuf.h was provided by gallatin. There are two accompanying M_ flags: M_TSTMP means that there is the timestamp (and it was generated by hardware). Another flag M_TSTMP_HPREC indicates that the timestamp is high-precision. Practically M_TSTMP_HPREC means that hardware provided additional precision comparing with the stamps when the flag is not set. E.g., for ConnectX all packets are stamped by hardware when PCIe transaction to write out the completion descriptor is performed, but PTP packet are stamped on port. For Intel cards, when PTP assist is enabled, only PTP packets are stamped in the limited number of registers, so if Intel cards ever start support this mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware timestamp is present for the given packet. Add IFCAP_HWRXTSTMP interface capability to indicate the support for hardware rx timestamping, and ifconfig(8) command to toggle it. Based on the patch by: gallatin Reviewed by: gallatin (previous version), hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks (? mbuf KBI issue) X-Differential revision: https://reviews.freebsd.org/D12638
Notes
Notes: svn path=/head/; revision=325506
Diffstat (limited to 'sys/net/if.h')
-rw-r--r--sys/net/if.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index 91a6786d4fec..60b83fcb9a9e 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -240,6 +240,7 @@ struct if_data {
#define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */
#define IFCAP_HWSTATS 0x800000 /* manages counters internally */
#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */
+#define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */
#define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)