From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0079.outbound.protection.outlook.com [104.47.42.79]) by dpdk.org (Postfix) with ESMTP id 2CFD71B20D for ; Wed, 10 Jan 2018 11:23:40 +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=E8mWfBLFyMZug2o+m45uD/jl3O3jmUXGDcpp5myTOVo=; b=fx6I6roixbsEnB8yJiab1I7AfBVIwjuLO158yJwzfpy5jR29YrIsmaNLfi05cgHLcud4wD8a1qkHAZnCNG0YixDWvHRnZbHq0NcHGmOlXypOxlEC01Vhrhv1olwfmphVKNysRYkLbnRQ0KE0JTM55NgNwky6/5RuaG8HtwSihj8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:23:34 +0000 Date: Wed, 10 Jan 2018 15:53:19 +0530 From: Pavan Nikhilesh To: Harry van Haaren , bruce.richardson@intel.com Cc: dev@dpdk.org Message-ID: <20180110102318.vpswoqnqrnqzznjb@Pavan-LT> References: <1515497885-191922-1-git-send-email-harry.van.haaren@intel.com> <1515505061-12112-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: <1515505061-12112-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: MWHPR2201CA0006.namprd22.prod.outlook.com (10.174.164.19) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5c5c403-d07c-4fc2-089c-08d558143671 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:V+ivBiQdX16nqJvpEdD4bkv5AmunoYqDreDoqPg6JsIY5qD0JchKLz/kteRSUWrZEvKNhizS7s+PET8fL7pYcm8VdCmYKWkjGJN6p1CzyPLs140uk2tLZEJuZtBuld0sNN9mf7bv7ixXkH69OQdpM+jzqicffcClB9J0gYoudobI6/PbEyc8LVbaJNRVlK5xRGJL29bmRN8vFbpsza96QxQ8Opyo8jR7lh52soXcKydsqfYllWJQDXxEBZ5UaYgE; 25:zrtgZhn6RMLK/ed0U30R+zkHyqs42kRLrBVpD81o9U0mxAmZrVhkUlt5KYPGBFQ9bTZdESLE7aUujtvVNWDhYe9A8EPMKxbjzFQc4c2EyrX4q7VPNTm1iQ8p0uGS3PhF5KH01XpUNE1tnjD9StpoxwLnMNN61TvqS3cEeH4uPLOYVW4oUb9lqyo2Gc5KGT+bHvEXGX5IBoIgu5WyVAG6m0DWejw+bXhdtnBCnZnc3pZF1EvNxc3NmNdanK5gvtlIl8YgovHvJjpBJTIDECQ4ggcukrGoG0k9T2qyHfaohfaps7Yjzl4cJ5uvku0EqVbeiUXxwzeX2HsbnAoGb04fYg==; 31:d2gAcv/cqZR6J0MEv3n4sRznmxNNdpceuJWF3bn+WmpNRsxjCUCCVQImwpSHciQSUrI+TPEMnMhqqNg7jq9QLDIYtqqehIcC7y2VKXZZJ8j+X29o3PbF2MTb/O//NJHRvdU2FtNfQ85VmhWnKQCKMVeS+uCYQsNgV0cREv+ihOWoUO3fZ4iLORmA3qLxtYXsKPmZ0R1phsvVi4irH/OI9CwYbl1DvB5qVPBSn7WbP/s= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:jf56AGaDcygMG7cl+j7SLpeBaT+j2pkIyuJGiEua7nWpNEegSq1Hb+oYUZxhFI39TZFI5oZeWoZH0RbX9jUBvZ6RVKaPTbA+aeHsd7BykdTUNnPLyzWpsKfF1SL83xTjryyHMUeSbfEJy/g6L0k0rcF/GpFZdVBN0PFSyHW3LFeZhXMn4pTXXwQStzJxXrc/BznVm8aXFXukzx57dSnZ+tgyKXfy6y5WD5tLZKWw2K3DTS5eOeqsc3EH8coLXTv+E3gWk8hOxJW8sjsP4r/l77Rj/iDHBJ6cyJEYdXARnRqMKwRmwxiL6umhc4/WZQgs/Kyb6+TZjjfJW9nHL3zAMePqPfk4BUaoLIiPmexdapMVCY4wRUkl8T7KCkBgwdVCPl1RgOyNvqjjdMwbOeEVggepUJ/tmKIWT8Cy59m5tYL+EjXoIMaOcSDyjA24Fdn/luDBL49SWdE7BviRuF52f9D2kAWztKsPeFQatBFvkEC4kP4Pbd61QwMswT4RwZJVtqcQG6dqwS9EqFijuv1Bpjx4nIkX+mS/9zODZcn3ytBn+J40/6GwDyzTWh9xhNyXEZmMPq67eYlpV7cifC90Gf1woCLvkgkG5pZU/zRHLe0=; 4:2ZHqAadTW66sYrEHI0FwD+XtjsbTZKSUjSsJhdDHxh41vIKnJMDqGLjNx1znGdt5eY/y8A9TFMwTdP7+iRgyIr4VG78/Q5XT249/QU3jBW0zHJoSI4dSLiXz9DHUSdkoVodR8w7ByIgcY9VAHlt4Ne2uJo6HwgF78oHPFBuTeblDKdoB/2abfGIpQYVqMs0vrF7BjvJebDOfI0/FBkUN3Ad+pEU1A+H8tmfN/QywC5JviQD6zgzwviptJoLpgij7ctL5XR3Z+aFGYbKZ2ZFQG+9BnFcomo5cXjb0EgyKdazS50t3q3bPh8NaKRHUVeVo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(93006095)(3002001)(6041268)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(376002)(39380400002)(366004)(189003)(199004)(24454002)(53936002)(6496006)(6666003)(6246003)(97736004)(105586002)(33896004)(2950100002)(575784001)(42882006)(52116002)(386003)(59450400001)(5660300001)(106356001)(478600001)(72206003)(1076002)(9686003)(76176011)(305945005)(7736002)(3846002)(23726003)(229853002)(2906002)(8676002)(6116002)(3716004)(55016002)(16586007)(8936002)(58126008)(4326008)(81166006)(5009440100003)(316002)(50466002)(81156014)(83506002)(25786009)(33716001)(16526018)(68736007)(66066001)(47776003)(107986001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; MWHPR07MB3469; 23:2wo5OfhQfJ2HnT3Y/QSe9jY01fLHHREIMiux+G5qr?= =?us-ascii?Q?Atk4rh38WXdjibkjgKVvobeCdqWSkRoBMcM6lqPJiF/oFn7FJJnpM0w5EKjY?= =?us-ascii?Q?7MbFhNGx1IDWwjbbp5LqFXY+vnMzIygxpwmetk6AlmlUDdnxy0Nuk0vi8SeK?= =?us-ascii?Q?6KSAN2xt4LDpTZ7Y+DObjsK2QfNAbhl5oTD+bGXY6Ur6efr1ltHl9wBxXn9n?= =?us-ascii?Q?D5Rks6GyDLzjv6hITrkw0+xDvuhUu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nzVRvZiZoGEAD1i7qgYcHOOCCfjU02UvSILvJXQCmTuC6zlvYhhksFNbu2aNsuLQaKTL0Pae+LjSRmTFcEqJM7c5jxUgsefdxD13bJDPbZNPvhw9qt1u+Q6bCohPgt7u6Vp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:23:34.7197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5c5c403-d07c-4fc2-089c-08d558143671 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: Re: [dpdk-dev] [PATCH v4 1/2] service: fix lcore role after delete 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: Wed, 10 Jan 2018 10:23:40 -0000 On Tue, Jan 09, 2018 at 01:37:40PM +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 > > --- > > v4: > - Improve commit title (Bruce) > > v3: > - Fix whitespace issue introduced in v2 (Doh :) > > v2: > - Only update state on service core ids (Pavan) > > @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 | 36 +++++++++++++++++++----------------- > 1 file changed, 19 insertions(+), 17 deletions(-) > > diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c > index 372d0bb..44a988a 100644 > --- a/lib/librte_eal/common/rte_service.c > +++ b/lib/librte_eal/common/rte_service.c > @@ -554,23 +554,6 @@ rte_service_map_lcore_get(uint32_t id, uint32_t lcore) > return ret; > } > > -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; > - lcore_states[i].runstate = RUNSTATE_STOPPED; > - } > - for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) > - rte_atomic32_set(&rte_services[i].num_mapped_cores, 0); > - > - rte_smp_wmb(); > - > - return 0; > -} > - > static void > set_lcore_state(uint32_t lcore, int32_t state) > { > @@ -585,6 +568,25 @@ set_lcore_state(uint32_t lcore, int32_t state) > lcore_states[lcore].is_service_core = (state == ROLE_SERVICE); > } > > +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++) { > + 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; > + } > + } > + for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) > + rte_atomic32_set(&rte_services[i].num_mapped_cores, 0); > + > + rte_smp_wmb(); > + > + return 0; > +} > + > int32_t > rte_service_lcore_add(uint32_t lcore) > { > -- > 2.7.4 > LGTM Series-Acked-by: Pavan Nikhilesh