timer: allow reset on service cores
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Thu, 21 Sep 2017 20:10:03 +0000 (01:40 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Oct 2017 20:35:02 +0000 (22:35 +0200)
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>
lib/librte_timer/rte_timer.c

index 5ee0840..ec86744 100644 (file)
@@ -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)