Re: [dpdk-dev] [PATCH v2] net/pcap: support software Tx nanosecond timestamps

2020-06-10 Thread Ferruh Yigit
On 6/9/2020 8:07 PM, Vivien Didelot wrote: > When capturing packets into a PCAP file, DPDK currently uses > microseconds for the timestamps. But libpcap supports interpreting > tv_usec as nanoseconds depending on the file timestamp precision, > as of commit ba89e4a18e8b ("Make timestamps precision

Re: [dpdk-dev] [PATCH v2] net/pcap: support software Tx nanosecond timestamps

2020-06-10 Thread Ferruh Yigit
On 6/9/2020 8:57 PM, Vivien Didelot wrote: > Hi Stephen, > > On Tue, 9 Jun 2020 12:43:57 -0700, Stephen Hemminger > wrote: >> On Tue, 9 Jun 2020 15:07:19 -0400 >> Vivien Didelot wrote: >> >>> >>> +#define NSEC_PER_SEC 10L >>> + >>> static inline void >>> calculate_timestamp(s

Re: [dpdk-dev] [PATCH v2] net/pcap: support software Tx nanosecond timestamps

2020-06-10 Thread Vivien Didelot
Hi Stephen, On Tue, 9 Jun 2020 12:43:57 -0700, Stephen Hemminger wrote: > On Tue, 9 Jun 2020 15:07:19 -0400 > Vivien Didelot wrote: > > > > > +#define NSEC_PER_SEC 10L > > + > > static inline void > > calculate_timestamp(struct timeval *ts) { > > uint64_t cycles; > > @@

[dpdk-dev] [PATCH v2] net/pcap: support software Tx nanosecond timestamps

2020-06-10 Thread Vivien Didelot
When capturing packets into a PCAP file, DPDK currently uses microseconds for the timestamps. But libpcap supports interpreting tv_usec as nanoseconds depending on the file timestamp precision, as of commit ba89e4a18e8b ("Make timestamps precision configurable"). To support this, use PCAP_TSTAMP_P

Re: [dpdk-dev] [PATCH v2] net/pcap: support software Tx nanosecond timestamps

2020-06-09 Thread Stephen Hemminger
On Tue, 9 Jun 2020 15:07:19 -0400 Vivien Didelot wrote: > > +#define NSEC_PER_SEC 10L > + > static inline void > calculate_timestamp(struct timeval *ts) { > uint64_t cycles; > @@ -294,8 +296,14 @@ calculate_timestamp(struct timeval *ts) { > > cycles = rte_get_timer_cycl