[v2,3/4] eventdev: remove redundant code
diff mbox series

Message ID 1593667604-12029-3-git-send-email-phil.yang@arm.com
State Superseded
Delegated to: Jerin Jacob
Headers show
Series
  • [v2,1/4] eventdev: fix race condition on timer list counter
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Phil Yang July 2, 2020, 5:26 a.m. UTC
There is no thread will access these impl_opaque data after timer
canceled. When new timer armed, it got refilled. So the cleanup
process is unnecessary.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 lib/librte_eventdev/rte_event_timer_adapter.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Dharmik Thakkar July 3, 2020, 3:35 a.m. UTC | #1
Hi Phil,
Looks good.

> On Jul 2, 2020, at 12:26 AM, Phil Yang <Phil.Yang@arm.com> wrote:
> 
> There is no thread will access these impl_opaque data after timer
> canceled. When new timer armed, it got refilled. So the cleanup
> process is unnecessary.
> 
> Signed-off-by: Phil Yang <phil.yang@arm.com>
> ---
> lib/librte_eventdev/rte_event_timer_adapter.c | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
> index 7cc334c..8909a8c 100644
> --- a/lib/librte_eventdev/rte_event_timer_adapter.c
> +++ b/lib/librte_eventdev/rte_event_timer_adapter.c
> @@ -1167,8 +1167,6 @@ swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
> 		rte_mempool_put(sw->tim_pool, (void **)timp);
> 
> 		evtims[i]->state = RTE_EVENT_TIMER_CANCELED;
> -		evtims[i]->impl_opaque[0] = 0;
> -		evtims[i]->impl_opaque[1] = 0;
> 
> 		rte_smp_wmb();
> 	}
> — 
> 2.7.4
> 

Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

Patch
diff mbox series

diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 7cc334c..8909a8c 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -1167,8 +1167,6 @@  swtim_cancel_burst(const struct rte_event_timer_adapter *adapter,
 		rte_mempool_put(sw->tim_pool, (void **)timp);
 
 		evtims[i]->state = RTE_EVENT_TIMER_CANCELED;
-		evtims[i]->impl_opaque[0] = 0;
-		evtims[i]->impl_opaque[1] = 0;
 
 		rte_smp_wmb();
 	}