[dpdk-dev,v3] timer: allow timer reset on service cores

Message ID 1506024603-27266-1-git-send-email-pbhagavatula@caviumnetworks.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Pavan Nikhilesh Sept. 21, 2017, 8:10 p.m. UTC
  From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

The rte_timer_reset function should be able to register timers on service
lcores as they are EAL threads.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 This patch depends on http://dpdk.org/dev/patchwork/patch/29056/

 v3 changes:
   -updated the API as per the new lcore role API

 v2 changes:
   -modified the commit title.

 lib/librte_timer/rte_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.7.4
  

Comments

Thomas Monjalon Oct. 11, 2017, 8:34 p.m. UTC | #1
21/09/2017 22:10, Pavan Nikhilesh:
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> 
> The rte_timer_reset function should be able to register timers on service
> lcores as they are EAL threads.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 5ee0840..ec86744 100644
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -432,7 +432,8 @@  rte_timer_reset(struct rte_timer *tim, uint64_t ticks,
 	uint64_t period;

 	if (unlikely((tim_lcore != (unsigned)LCORE_ID_ANY) &&
-			!rte_lcore_is_enabled(tim_lcore)))
+			!(rte_lcore_is_enabled(tim_lcore) ||
+				rte_lcore_has_role(tim_lcore, ROLE_SERVICE))))
 		return -1;

 	if (type == PERIODICAL)