-
Notifications
You must be signed in to change notification settings - Fork 953
Open
Description
ff_veth_input() in ff_dpdk_if.c never copies mbuf->timestamp from the DPDK mbuf to the FreeBSD mbuf's m_pkthdr.rcv_tstmp. The FreeBSD side already has the full
SO_TIMESTAMP → recvmsg() → SCM_TIMESTAMP path wired up — the timestamp just gets dropped at the DPDK→FreeBSD boundary.
The fix is ~10 lines across ff_veth.c, ff_veth.h, ff_dpdk_if.c:
- Add
ff_mbuf_set_timestamp()(same pattern asff_mbuf_set_vlan_info()):
void ff_mbuf_set_timestamp(void *hdr, uint64_t timestamp) {
struct mbuf *m = (struct mbuf *)hdr;
m->m_pkthdr.rcv_tstmp = timestamp;
m->m_flags |= M_TSTMP | M_TSTMP_HPREC;
}- Enable RTE_ETH_RX_OFFLOAD_TIMESTAMP on the port when the NIC supports it.
- Call the helper in
ff_veth_input()whenRTE_MBUF_F_RX_IEEE1588_TMSTis set:
if (pkt->ol_flags & RTE_MBUF_F_RX_IEEE1588_TMST)
ff_mbuf_set_timestamp(hdr, pkt->timestamp);When HW timestamps aren't available the flag is never set, so nothing changes — fully backward compatible.
Happy to raise a PR if you're interested.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels