From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by dpdk.org (Postfix) with ESMTP id B1ECF7CFC for ; Thu, 4 Jan 2018 16:21:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8YJKTv8yXSko8cx0I4KYT2s5H0scPrZ0JAIVyfCO86c=; b=NK6YEsSOi4k+g1lAscrOOIj1BALCAU2nh1ryHjKerfy+KtqQtRJQQsWuZk13cF/m6JtY9+fIHQBHprmMenZLVUCrYexm2eRJQfJirvnI2CoElRtR1NAxQu9hkYyNUWq8dYMbtK2/LQg6Fb04pkbg6TCtTzd1R2nNmu9FgHQQ2d8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 4 Jan 2018 15:21:17 +0000 Date: Thu, 4 Jan 2018 20:50:57 +0530 From: Pavan Nikhilesh To: Harry van Haaren Cc: dev@dpdk.org Message-ID: <20180104152056.ltzm2hsdelpsonto@Pavan-LT> References: <1513768907-112647-1-git-send-email-harry.van.haaren@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1513768907-112647-1-git-send-email-harry.van.haaren@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR13CA0059.namprd13.prod.outlook.com (10.175.103.149) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9b97579-ffa4-40f4-ec4d-08d55386cdd5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:hkrf01D7rENDkFo/11e1nLrITbUrrgEuhCyBkjKc5whXzQdF6eWxKtyQMta0whWkZrSVO+Wd4Y0FXKqT7JwY/PgVLqDxnIfCmLVMNXl009D1WnhaCGRG/SJZjFuaYL0f5uhoNPVnf79+5BrDio+96Lasak1bOUNJUQAJzg6XjTZftQyTGvwGPVGkmNcV6QLHW3gvG9wMOnrUETzFh7lizeCsExpLbLkzS1oefJoBSfCR8qEJ45lBZ5VtaBbBtvdL; 25:Ipyw1SZncct//YtVr7x5NlgodcD/M/Fe/Oj8fbTIV5XmECIObe8En1514EIIzLRLHaG4u6la8Ptl+mWZpJKRFWMIz2q08DXhSPlJaUz7xPgh5zmp+wVgWdMrNUUedYjiqcy2DwuyMlu+JPrz5KA2dh7qCGsSmp/6FQnKegAUBJ7FB9wuUzv7OX02T6IKIN516N56KUKODDsHiQtE68MOMLDiwTS8LxbG5Lj8ReqFWKKE1AxzZsdILCZwMyJpaxtnY6GQkKeYVEV6kZbzAOwrI9Kpy2QPSgk4lHLHVC89UyDER/p3YHruimSm47/PBdt0czYj8+/M0J0ZAmu6U9rFBA==; 31:WITYWWAs2xvjWCJbfnKxzX7GAPd+iOM/+M8Q7c8ggiKYMFrLUF37NXnjvvg0Qoz0dPIHrt1pT9iJzKSBIbMI1eVVf8vWQ+tNQNk+S5oMoeA6RPAL7VXsKOAy5c4NVpMpGfy33CqgH4e3Oqr5ppfm0O4pxZjZhRK2w/o9GUDPgoH9iG8J7A1Lp6MVicM1zoYUeETYCYIxCTYH848/B54pjsGj9svyqtr1i27PwqUkFk8= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:A3xVkuebRJvOXNP/y7JcjvaBpsCZoKDJmxW9Ec9/bgKpTSrob35ha+Cafc9QskA+9JAbLaIe/IB60OcNtS7Xsi4XxsDo2hxq4q0XUhw/e+RdE2JjVc930juiHdvOMvKW3+kwPMmAyZ7XTE+TEjqRv6BN/nzg0JC0AOuqs1Wj0hyAo9E/j/zBzzkL2K6Otd/GmM6nUVfOC5tKyM/P9MqjZRdO9gfP350Hej2p5p5w2tNLOGshuYotHHiY5SKq0g4hnQ3ib+4LLSARdry7bRpABkXJgow6StcGVaJ1TmfJG4bp80S3DYQprFlm2pvbMRpjMgcwICUB64ELSnryN+05Npv/YKni6X78FZ/3rg32lhnLxFPelS91MbwZpftr08XJcxBJKJMoBWAGKhB9s8lftJd2N4VoBb3F3FJwNAQWitkxI0IfGN2qnA62pjzmTyHm4RokUAMsvE+SjhNm1wMXP0tfh8poWXJwQtGBVyjT55peoD38QTCJFcUt4nlo47ht5kMdktoxignuWp9uhw2ndYH7xrnmKatH/2KpGvcTZRuV07Uz5YRtTw7LWfD2JHQ0BliIvNgD2AyFpaMlrMKMT4lJ57kkTNJrCwqzHhOihOk=; 4:mKrgDAuukVRI/w+qS1ciiUEEhGCjKOMH7rPHgdIqaxeDGM9SxdV1JaJvR7R/9NbbtuNODXrsdqunIkfumSa1hq0ezwkur46AYxcE7NkXxBB9UIFcoTsrpG1b8aSz+yA8SabZMjhb9ty8C0wwWKE3PLQGHVMn4YrNMYALzSd5oZgzK0RyP/dwcymmWAZ/VZu6sPE/irnvLywWPaKzYpGFvCUV9MXnavc/SswqSFqlNoNPozUh902gdVE/TytcGpuEcXaxcbYY+KgYa3+M73WHZqArCw2fgE5aFz3RfYBxMdANNPpuE/S1bBs5vCmHXakc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(944501075)(93006095)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 054231DC40 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(39380400002)(366004)(396003)(346002)(24454002)(199004)(189003)(55016002)(52116002)(83506002)(33716001)(7736002)(58126008)(6246003)(16586007)(50466002)(478600001)(229853002)(5009440100003)(23726003)(6116002)(16526018)(3846002)(47776003)(106356001)(53936002)(72206003)(8676002)(105586002)(305945005)(6496006)(9686003)(8936002)(5660300001)(25786009)(386003)(1076002)(97736004)(81156014)(66066001)(76176011)(6916009)(42882006)(2950100002)(6666003)(316002)(33896004)(4326008)(68736007)(81166006)(2906002)(107986001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3464; 23:a2qHyxgf7uO9dl8STgzuRy91crfmXupSG6WW7BTH7?= =?us-ascii?Q?YACACt/LRZELmFyM8bWjcSXa4kl8SW0h6oP48ZV8yhBC5V9tdTGF46q/yWya?= =?us-ascii?Q?rvNFzHEUWM+sD1+eP/u5tnTQVrf179fXbdqvikBnjjGY0PfM8XwoKMK3ESx4?= =?us-ascii?Q?V8FlmaOVI28HbNaf3qeeD4vzmjgAWUdYQEIJYMxTfIe0l8k8oFoqKIOh/G4F?= =?us-ascii?Q?vDF3EdBusIVYXjKNxT8/2P0xT+FnAv3mF8nmW8ahhXffSYjT8hsLiKPryL6b?= =?us-ascii?Q?wZDTgd/5mzcTPK39I04FQpmj8/G8Fjydwclf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agnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2018 15:21:17.3654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9b97579-ffa4-40f4-ec4d-08d55386cdd5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: Re: [dpdk-dev] [PATCH 1/2] service: fix del to reset lcore role to rte X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2018 15:21:21 -0000 Hi Harry, Comments inline. On Wed, Dec 20, 2017 at 11:21:46AM +0000, Harry van Haaren wrote: > This patch fixes the reset of the service core, > that when rte_service_lcore_del() is called, the > lcore_role is restored to RTE. > > This issue was reported as when running the unit tests, an > error was thrown that "failed to allocate lcore". Investigating > revealed that the state of the service-cores after del() was > not allowing a core to be re-used at a later point in time. > > Fixes: 21698354c832 ("service: introduce service cores concept") > +CC stable@dpdk.org > > Reported-by: Pavan Nikhilesh > Signed-off-by: Harry van Haaren > > --- > > @Stable maintainers; this is an EXPERIMENTAL tagged API, so I'm > not sure what the expectation is in terms of backporting. > --- > lib/librte_eal/common/rte_service.c | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > > int32_t rte_service_lcore_reset_all(void) > { > /* loop over cores, reset all to mask 0 */ > uint32_t i; > for (i = 0; i < RTE_MAX_LCORE; i++) { > lcore_states[i].service_mask = 0; > - lcore_states[i].is_service_core = 0; > + set_lcore_state(i, ROLE_RTE); Setting ROLE_RTE for RTE_MAX_LCORE lcores is incorrect. There should be a check to set only service lcores something like this: for (i = 0; i < RTE_MAX_LCORE; i++) { - lcore_states[i].service_mask = 0; - set_lcore_state(i, ROLE_RTE); - lcore_states[i].runstate = RUNSTATE_STOPPED; + if (lcore_states[i].is_service_core) { + lcore_states[i].service_mask = 0; + set_lcore_state(i, ROLE_RTE); + lcore_states[i].runstate = RUNSTATE_STOPPED; + } Cheers, Pavan. > lcore_states[i].runstate = RUNSTATE_STOPPED; > } > for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) > @@ -600,20 +614,6 @@ int32_t rte_service_lcore_reset_all(void) > return 0; > } > > int32_t > rte_service_lcore_add(uint32_t lcore) > { > -- > 2.7.4 >