Re: [dpdk-dev] [PATCH v2] lib/librte_timer:fix corruption with reset

2020-07-09 Thread Sarosh Arif
On Wed, Jul 8, 2020 at 8:07 PM Stephen Hemminger wrote: > On Wed, 8 Jul 2020 10:06:26 +0500 > Sarosh Arif wrote: > > > /* loop until rte_timer_reset() succeed */ > > -void > > +int > > rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks, > >enum rte_timer_type type,

Re: [dpdk-dev] [PATCH v2] lib/librte_timer:fix corruption with reset

2020-07-09 Thread Sarosh Arif
On Wed, Jul 8, 2020 at 8:08 PM Stephen Hemminger wrote: > On Wed, 8 Jul 2020 10:06:26 +0500 > Sarosh Arif wrote: > > > rte_timer_stop_sync(struct rte_timer *tim) > > { > > + struct rte_timer_data *timer_data; > > + TIMER_DATA_VALID_GET_OR_ERR_RET(default_data_id, timer_data, > -EINVAL

Re: [dpdk-dev] [PATCH v2] lib/librte_timer:fix corruption with reset

2020-07-08 Thread Stephen Hemminger
On Wed, 8 Jul 2020 10:06:26 +0500 Sarosh Arif wrote: > rte_timer_stop_sync(struct rte_timer *tim) > { > + struct rte_timer_data *timer_data; > + TIMER_DATA_VALID_GET_OR_ERR_RET(default_data_id, timer_data, -EINVAL); > + unsigned int lcore_id = rte_lcore_id(); This mixing code and

Re: [dpdk-dev] [PATCH v2] lib/librte_timer:fix corruption with reset

2020-07-08 Thread Stephen Hemminger
On Wed, 8 Jul 2020 10:06:26 +0500 Sarosh Arif wrote: > /* loop until rte_timer_reset() succeed */ > -void > +int > rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks, >enum rte_timer_type type, unsigned tim_lcore, >rte_timer_cb_t fct, void *arg)

[dpdk-dev] [PATCH v2] lib/librte_timer:fix corruption with reset

2020-07-07 Thread Sarosh Arif
If the user tries to reset/stop some other timer in it's callback function, which is also about to expire, using rte_timer_reset_sync/rte_timer_stop_sync the application goes into an infinite loop. This happens because rte_timer_reset_sync/rte_timer_stop_sync loop until the timer resets/stops an