[dpdk-dev] timer: fix reset on service cores

Message ID 1503501537-12383-1-git-send-email-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Pavan Nikhilesh Aug. 23, 2017, 3:18 p.m. UTC
  - API rte_timer_reset() should be able to register timers on service
lcores as they are EAL threads.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 This patch depends on http://dpdk.org/dev/patchwork/patch/27818/
 lib/librte_timer/rte_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.7.4
  

Comments

Van Haaren, Harry Sept. 6, 2017, 9:25 a.m. UTC | #1
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Wednesday, August 23, 2017 4:19 PM
> To: dev@dpdk.org
> Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] timer: fix reset on service cores
> 
> - API rte_timer_reset() should be able to register timers on service
> lcores as they are EAL threads.

Nitpick comment: remove - at the start. (I'd ignore this, but v2 required based on below anyway..)


> Fixes: af75078fece3 ("first public release")

I'm not sure this is a fix to the first release.. service cores has only been added recently, I feel bad "git blaming" the first release :)
I suggest renaming the title to "timer: allow timer reset on service cores", and removing the Fixes: tag.

> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

With above changes,

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

> ---
>  This patch depends on http://dpdk.org/dev/patchwork/patch/27818/
>  lib/librte_timer/rte_timer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
> index 5ee0840..a5a045c 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_is_service_lcore(tim_lcore))))
>  		return -1;
> 
>  	if (type == PERIODICAL)
> --
> 2.7.4
  

Patch

diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 5ee0840..a5a045c 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_is_service_lcore(tim_lcore))))
 		return -1;

 	if (type == PERIODICAL)