Add iri_rcv_tstmp to if_rxd_info so an isc_rxd_pkt_get() driver can report a hardware RX timestamp. Copy it into m_pkthdr.rcv_tstmp, reusing the generic mbuf timestamp path. Widen iri_flags from uint8_t to uint32_t and define the flags drivers may supply. Mask the flags before copying them into the mbuf so no other mbuf state can leak through the driver callback. Place the timestamp next to iri_frags to avoid an alignment hole, and document its nanoseconds-since-boot representation and validity flags. Bump __FreeBSD_version because changing if_rxd_info breaks KBI for out-of-tree iflib drivers. Suggested by: gallatin Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Differential Revision: https://reviews.freebsd.org/D58638
Details
- Reviewers
shurd gallatin sreekanth.reddy_broadcom.com sumit.saxena_broadcom.com - Group Reviewers
iflib - Commits
- rG3c928ccadbb5: iflib: Plumb per-packet RX hardware timestamps to mbufs
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/net/iflib.h | ||
|---|---|---|
| 90 | All other fields are iri_$NAME. Please follow that convention here. | |
| 91 | I really don't like this. We already have iri_flags which is used only for M_VLANTAG. I'd prefer you expand the existing iri_flags to a uint32_t and define And do: Then you can get rid of IFLIB_RX_TIMESTAMP and just check for IFLIB_IRI_VALID_FLAGS being defined in your driver. | |
| sys/net/iflib.h | ||
|---|---|---|
| 91 | Agreed, will fix it up in next revision. | |
Thank you for doing this. I want to eventually add some 1588 stuff to some drivers so this will be a prerequisite. Consider documenting in iflibtxtx(9).
| sys/net/iflib.h | ||
|---|---|---|
| 92 | might consider s/RX HW timestamp/Nanoseconds since boot/ to document the unit succinctly here since the free running clock may be different, Rx is obvious from the struct type. | |
iflibtxrx(9) needs updating for this feature.
And since this breaks binary compat for drivers, you also need to bump __FreeBSD_version in sys/sys/param.h
| sys/net/iflib.h | ||
|---|---|---|
| 92 | Can you move this up to be just after iri_frags? By putting it here, you're creating a 4 byte alignment hole between iri_csum_data and the timestamp | |
@sumit.saxena_broadcom.com I'm going to help this along since it just needs some trivial changes to land, I will retain you as the author