DPDK packet timestamp when using AF_PACKET / AF_XDP

71 Views Asked by At

I want to replace libpcap with DPDK and for the start I plan to use the AF_PACKET or AF_XDP PMD. However, I’m curious about how to obtain packet timestamps.

Currently, I enable hardware timestamping on the AF_PACKET socket using the libpcap API. However, I couldn’t find any information regarding packet timestamps in the documentation of DPDK. I’ve examined the AF_PACKET PMD code, but unfortunately, I didn’t find any configuration related to PACKET_TIMESTAMP on the socket. Upon further investigation of the DPDK code, I discovered a callback in the eth_dev_ops called timesync_enable. Interestingly, this callback is not registered for AF_PACKET, but it is used by some other PMD drivers.

I’ve also learned that mbuf dynamic fields are utilized to store timestamps in certain PMDs. These drivers use the rte_mbuf_dyn_rx_timestamp_register function.

Now, my question is: How does packet timestamping work in DPDK, and how can I retrieve the timestamp for each packet? Is my intuition correct that I might need to handle timestamping manually within my application?

Thank you for your assistance!

0

There are 0 best solutions below