* [dpdk-dev] [PATCH] service: fix number mapped cores count
@ 2018-01-09 9:40 Pavan Nikhilesh
2018-01-09 11:44 ` Van Haaren, Harry
0 siblings, 1 reply; 3+ messages in thread
From: Pavan Nikhilesh @ 2018-01-09 9:40 UTC (permalink / raw)
To: harry.van.haaren; +Cc: dev, Pavan Nikhilesh, stable
When adding service the number of mapped cores should only be incremented
when the core is not already a service core or vice versa.
Fixes: 21698354c832 ("service: introduce service cores concept")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
lib/librte_eal/common/rte_service.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 2d12d0201..d9138b677 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -545,10 +545,14 @@ service_update(struct rte_service_spec *service, uint32_t lcore,
uint64_t sid_mask = UINT64_C(1) << sid;
if (set) {
- if (*set) {
+ uint64_t lcore_mapped = lcore_states[lcore].service_mask &
+ sid_mask;
+
+ if (*set && !lcore_mapped) {
lcore_states[lcore].service_mask |= sid_mask;
rte_atomic32_inc(&rte_services[sid].num_mapped_cores);
- } else {
+ }
+ if (!*set && lcore_mapped) {
lcore_states[lcore].service_mask &= ~(sid_mask);
rte_atomic32_dec(&rte_services[sid].num_mapped_cores);
}
--
2.14.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] service: fix number mapped cores count
2018-01-09 9:40 [dpdk-dev] [PATCH] service: fix number mapped cores count Pavan Nikhilesh
@ 2018-01-09 11:44 ` Van Haaren, Harry
2018-01-11 22:24 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Van Haaren, Harry @ 2018-01-09 11:44 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: dev, stable
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Tuesday, January 9, 2018 9:41 AM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] service: fix number mapped cores count
>
> When adding service the number of mapped cores should only be incremented
> when the core is not already a service core or vice versa.
>
> Fixes: 21698354c832 ("service: introduce service cores concept")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Just a note;
Be careful of going more than 75 chars on git commit messages,
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] service: fix number mapped cores count
2018-01-09 11:44 ` Van Haaren, Harry
@ 2018-01-11 22:24 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-01-11 22:24 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: stable, Van Haaren, Harry, dev
> > When adding service the number of mapped cores should only be incremented
> > when the core is not already a service core or vice versa.
> >
> > Fixes: 21698354c832 ("service: introduce service cores concept")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>
> Just a note;
> Be careful of going more than 75 chars on git commit messages,
>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-11 22:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 9:40 [dpdk-dev] [PATCH] service: fix number mapped cores count Pavan Nikhilesh
2018-01-09 11:44 ` Van Haaren, Harry
2018-01-11 22:24 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).