[dpdk-dev] [EXTERNAL] Re: [PATCH v5 5/9] app/testpmd: add clock_gettime_monotonic

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed Apr 28 10:45:40 CEST 2021


2021-04-19 21:41 (UTC+0200), Thomas Monjalon:
> 19/04/2021 20:34, Tyler Retzlaff:
> > > > Originally and internally, the function was added into eal. But then
> > > > restricted the functionality just inside testpmd to avoid currently
> > > > seems unnecessary version change, per a discussion in community meeting
> > > > several weeks back. If we believe eal support of clock_gettime for
> > > > windows will benefit other drivers/apps now instead of future when real
> > > > need comes up, I can move it back into eal. DmitryK and Tyler, any
> > > > conern or inputs here?  
> > > 
> > > My point of view:
> > > A test application is also testing the API availability.
> > > Here it shows something is missing in EAL.
> > > Instead of workarounding in the test application, it should direct you to
> > > fixing EAL.  
> > 
> > I think we have discussed to some degree in other threads but the more POSIX interfaces that get integrated into eal with an 'rte_' namespace pasted on to the front of them causes the scale of making DPDK portable grows.  If individual applications need portable/cross platform APIs like they should look to other packages tailored for the job instead of trying to put everything into DPDK.  Threads is an example of where this has gone wrong, I don't think doing more of it is going to be beneficial.
> > 
> > Shouldn't EAL be in the business of being DPDK and do it well instead of an all encompassing cross-platform application development kit?  
> 
> Yes good point.

While Tyler's point is valid in general, monotonic time is something required
in many PMDs for timeouts. App networking code often deals with timeouts, too.

There's already a patch adding clock_gettime():

http://patchwork.dpdk.org/project/dpdk/patch/1619597563-56716-1-git-send-email-humin29@huawei.com/

Luckily EAL only needs this in multiprocess part, disabled on Windows;
but PMDs do require it in portable code. Even Unices would benefit a little
from not having #ifdef CLOCK_MONOTONIC_RAW in several files.

I'm for moving this to EAL.

P.S. Not all gettimeofday() are subject to replacement with new API: for
example, in PCAP we (arguably) need a realtime stamp in packets.


More information about the dev mailing list