From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 1044D1B173 for ; Wed, 24 Jan 2018 16:36:15 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 97C1720083; Wed, 24 Jan 2018 10:36:12 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:36:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/UCeZAgqJPLCKa1BL clnSMmOoNj/NlSvp3ryhxZZM9U=; b=akzSL+R97qXKHkNLFe72OL4cGOXS1+8p6 LxgFezKFfX9F9w4LrK0CP88k8xDfJwQEO+rWWgni2fDWBwXWbs7TDXlceNGAojqu hwImFFmH3oLraZ6hjML0BHRYpqQjbItwphREbi8lSbUur612C/b0yTgi5ZMmr2L6 Fk3In/aUJQVh6iShL+jC87k3AINyknlJt0esidkHhML2YD4ZkWcGADqhGzmfGqf0 SGFjXGWgeLlMu3eyZB1naMvplNtFH7EHPn4h7+PJMMt0nRAKphELNtSRxkE5nTjo GdIb3f5LbZCMnaY/IIGoBABnhN37gJWUqSlunuXRDYKerEzBgOQzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/UCeZAgqJPLCKa1BLclnSMmOoNj/NlSvp3ryhxZZM9U=; b=cVM6Xdou vMK80ZtFHCHnLjBPcSxfeBSa1XYVUCf/I/qnrBPtEQy+3xx1xajQbqfr6vn/ypIV KeBFqBpx+m/LrTlfYvM0NmFZOVvGOMlV7hzicZ5EST3pOptn8tdhuvdWdnmQRu34 7w0GnrwegXX92uRDZEk/QEROrz8ncFAU236TTig0YdExYEmj3nsH+LHfn5Zm59HJ v4bF97WrJs3qXzRcYpm5Z0DorAzDcFSy1sg/wk9OCNodVI56dkydZwnxIpXQS+cs Wzx2TFlSvxWPzJWp5+NQDHBb05BGbF2zq8WBElRAkLtzlqf0ODNLTbQLV+M/BZea wU1Wzz3e+0RGfQ== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 7F76B7E3D6; Wed, 24 Jan 2018 10:36:10 -0500 (EST) From: Yuanhan Liu To: Pavan Nikhilesh Cc: Harry van Haaren , dpdk stable Date: Wed, 24 Jan 2018 23:31:16 +0800 Message-Id: <1516808026-25523-8-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'service: fix number mapped cores count' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:36:15 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From b431891c6adad4b52178e61fdb7810fa6df1f028 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Tue, 9 Jan 2018 15:10:41 +0530 Subject: [PATCH] service: fix number mapped cores count [ upstream commit 088a05f057d68ad48fe6788bb276d5d4bd151fb1 ] 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") Signed-off-by: Pavan Nikhilesh Acked-by: Harry van Haaren --- 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 ae97e6b..2630770 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.7.4