[dpdk-dev] Saving packet timestamp when reading from pcap

Dor Green dorgreen1 at gmail.com
Mon Apr 20 18:06:13 CEST 2015

To test my program and for some other uses I sometimes use vdev
(libpcap pmd) to read data from a pcap file.

Those tests would be a lot easier if the packet timestamp (which is in
the cap) was supplied by DPDK, but alas it is not.

So I could access it, I placed it in mbuf's userdata for the timebeing.
In rte_eth_pcap.c I added this after line 171:
 mbuf->userdata = (void*) header.ts.tv_sec;
Obviously this isn't the prettiest and it lacks the microseconds the
struct supplies.

Does anyone have any better ideas on how to do it, or is this a
feature planned for any future version (seems easy enough to add some
more fields to the mbuf struct to accommodate this, and maybe in the
future hardware timestamps, etc.?)

Thanks, Dor.

More information about the dev mailing list