Re: [dpdk-dev] [PATCH v1 1/2] eal: add nanosleep based delay function

2018-09-10 Thread Ilya Maximets
On 05.09.2018 16:10, Stephen Hemminger wrote: > On Mon, 3 Sep 2018 17:47:42 +0300 > Ilya Maximets wrote: > >> >> +void __rte_experimental >> +rte_delay_us_sleep(unsigned int us) >> +{ >> +struct timespec wait[2]; >> +int ind = 0; >> + >> +wait[0].tv_sec = 0; >> +if (us >= US_PE

Re: [dpdk-dev] [PATCH v1 1/2] eal: add nanosleep based delay function

2018-09-05 Thread Stephen Hemminger
On Mon, 3 Sep 2018 17:47:42 +0300 Ilya Maximets wrote: > > +void __rte_experimental > +rte_delay_us_sleep(unsigned int us) > +{ > + struct timespec wait[2]; > + int ind = 0; > + > + wait[0].tv_sec = 0; > + if (us >= US_PER_S) { > + wait[0].tv_sec = us / US_PER_S; >

[dpdk-dev] [PATCH v1 1/2] eal: add nanosleep based delay function

2018-09-03 Thread Ilya Maximets
Add a new rte_delay_us_sleep() function that uses nanosleep(). This function can be used by applications to not implement their own nanosleep() based callback and by internal DPDK code if CPU non-blocking delay needed. Signed-off-by: Ilya Maximets --- lib/librte_eal/common/eal_common_timer.c