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

Thomas Monjalon thomas at monjalon.net
Mon Apr 19 20:13:45 CEST 2021


19/04/2021 20:04, Jie Zhou:
> On Sun, Apr 18, 2021 at 05:20:42PM +0000, Tal Shnaiderman wrote:
> > > --- a/app/test-pmd/config.c
> > > +++ b/app/test-pmd/config.c
> > > @@ -63,6 +63,12 @@
> > > 
> > >  #define NS_PER_SEC 1E9
> > > 
> > > +#ifdef RTE_EXEC_ENV_WINDOWS
> > > +#define _clock_gettime_monotonic(cur_time)
> > > +clock_gettime_monotonic(&cur_time)
> > > +#else
> > > +#define _clock_gettime_monotonic(cur_time)
> > > clock_gettime(CLOCK_TYPE_ID,
> > > +&cur_time) #endif
> > > +
> > 
> > I think this change should be in EAL:
> > rte_get_time_monotonic(&cur_time)
> > 
> > Windows implementation in windows\eal_timer.c
> > Unix implementation in unix\eal_unix_timer.c
> 
> 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 don't know who decided to take this shortcut,
but it should be considered as an exception,
and accepted only if improving EAL is really difficult.





More information about the dev mailing list