From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0051.outbound.protection.outlook.com [104.47.33.51]) by dpdk.org (Postfix) with ESMTP id 6DC0D137C for ; Mon, 28 Aug 2017 13:07:27 +0200 (CEST) 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=5CQpMl7zTSqKu3ZTSWpvcoos7/EMPXMW7wiVV+3cVso=; b=T3CxXm2L5NC02iypWM0n3XHEUQU3s/SJXKttudhnISsAAcZmF1dOwVVlBItinnqJGZdvOaZQAhbp9kXuJ/kx/IVeDognyXf1pxjBgTuAlaBsvpT5Q9wHHAJ64JvU5e9KbRaMoenMi9D3LezmxgKub3vFafuvXYJyRjEjz/248Sc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-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.1.1385.9; Mon, 28 Aug 2017 11:07:25 +0000 Date: Mon, 28 Aug 2017 16:36:09 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: dev@dpdk.org Message-ID: <20170828110607.GA21424@PBHAGAVATULA-LT> References: <1503487012-20247-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0024.INDPRD01.PROD.OUTLOOK.COM (10.174.214.162) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ceb23b71-a75d-4c26-4e53-08d4ee04f750 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:L1JV2GREH7smK5G0BrurGdXy4MLeg78Kd3RZPsSumN+oRT+NluCtyKIyTV1Ul1bdafRynLhNxcNQfd23v1wwipcRXfpuiv3Gsg+Uqh1mUl5lE913nox/augWuDoCIhvqcIhu68CxzREvW5eVg7T3Sc4bo+tHnPN6Ro6CI6tzgFrmAcWeWbsEKsEEHXg2dutexNk5yezAJy/I+KsuU0PQ6QmUrEHkCyDRw+aTzxZfaVgWHleAho2iRwqJIpA4S6lN; 25:7gOBuxhD1AiPj+raVbZrXi+x/i2ZqwoRWCiMpMhaFOjdvxkiiFLnmIhTNTknN6yHmrmiPD512w99twmiepILoPOrkYO7eBEgku8oACUGRQRQHrWcrsBEBXuEn8xKRf+5zJei0ql6Zwxsmd489oTY0h2iXF3PguE8C02SGPHI5fiXpP6JTx/WHx1Ff4WAtlDbWlil/czr5BaJzVUNGI/E356rqzwroBfHZjUyX1N2jZPDUm0wN1Uj5+PYfvperlzMH9YugT2YGK+/JTX7s1lkdPWUvRp6S1OA2Pr1ecRdI1q1rNxY7Dphg/0lLYIUYdHiARL85vYTNoWDhrgxSR00iQ==; 31:PWmiRpx8BC3nys6rRrPo4Eryr3GUmlkQSGj3B8yc4q0jVZQleM+dTGeZABPWYoOJFcSc8gZfBBwMVKYqpQvR1MrzvnMYN++o61xX9bUj5AHh9sP75wSX0wI8GeQ2T6Y9yE5ZYTpt8OWRYnmtHfuuwvwMcolZnUp1ttU98FgcRpylYIlT37jOonZ9IHdT8jwKLWJMKkb0+2p+K1tCWQn6Y2aRXMiprS7sdIE6fTDjAyw= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:ROGRHpJ5rNhftnuIP1cPkxSoGHdkLLQQkdLQAephSstmLKZ47hbzdWGvxmjl1HmHnMvdp/wzLdqSeqi7AQB1W5vzEOdX7+/aYE8CduEhevyBqdeGBY/UI5XefLwoetwuU4blM/9Q2FEJy0yKuKN0UGCJKcKAxnGQBmUaz7uHigfwHdTl0SeE+NbRo8aSBRGY30zMyBdTK1Nobft7CCXrL8eHeRXoccQk88q4VcW8IdaPmEYu3ePoSxEdNKyxnopqvMuen9v0WA7f2+VSOpD+G04nBf6hG/gV43UKtEg4pPpFzsVbTqjh/D3szSEOQDj1UvJLeYvmTbPHgRvNrdht+fyuzLUlIBgY+yJYPTYbMHSicylrByJsLk27v1/HO2RXRZyPNfZ6T7PvX098prnUE33A1BCeQYMU2AHYzHhAkPJtiTRR1IEpw75/vbrULsP+8GbEoqs/nmbSvmtckCS23f9eCZnskBtRpyOLnI8mrhZ0kFBqkiSTGHnzJwvZO7Af82vyJsjHrNYeSuP0NKw9gpGeulXrJkRQoDFdiruYrUf+ToJrd4d4jW0IHrIrNoWN4Xa9kAIR8yZzwPWJMrsx4KPTi+vFmdElI4j8NfJ/3nI=; 4:o/YdaJNYe1x62jyA4P5AJaSNIQxf1evd+UdjrZX/mNnzYbX6nZ5usicmMCIzSCDQbDbNhofWNrA0RPUV+Lu+1M7bBMF9Huq+ubDqHI7pNKddnPIhr8Pvh8nLrpp8apu9FR4BZjY5TenS34Wi0HFL87pEqoVhvPyvEheUAG7H575Bz7ewvfluMYrtC30YLcU9ufxaOCGkHwys3YDx2GBsb4UkM1ijUWD+CqS0Aw5MwsY4a700n0IXKqZwBk4JaRzXYk7pIojwECBe1ZkhNhAaNjnD08W54pXHQAoeN3iF5pM= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(24454002)(51914003)(377454003)(50986999)(76176999)(105586002)(106356001)(305945005)(101416001)(54356999)(4326008)(50466002)(68736007)(189998001)(5660300001)(33656002)(5009440100003)(72206003)(7350300001)(3846002)(6116002)(1076002)(23726003)(42186005)(53546010)(47776003)(33716001)(66066001)(229853002)(6666003)(4001350100001)(478600001)(2950100002)(42882006)(6916009)(8676002)(81156014)(81166006)(83506001)(25786009)(110136004)(55016002)(9686003)(6496005)(7736002)(6246003)(53936002)(2906002)(97736004)(18370500001)(81973001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:PBHAGAVATULA-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:4i89xkP6RnKGACqw5qIUJHYlAn9ErDV6XmQL3hjEn?= =?us-ascii?Q?p84/TE3CxxxWDZj1D6EChjh45YYOJXTcTLwM5U1cDlM2xPX8h8aeXxmLgv3L?= =?us-ascii?Q?8U2uVwcRxLpp3gYU0FLQwGnE6dlA0b/cdX82aLWL1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P2dqaNUesD+cbn1VfaSQuvmk4Ec=; 7:06tUuU9FMWwarilYaf1c9B2B78/Ug9tMHeVhJwgmck2lOUZ0p60o6f4phcUBVbIMoQshHDrzEGJdaLnteGY7KhCjfnX8WPTdbM7N8xZGqu/H69/ok9F6hHnkQ0iRsuiukNqWrL5woCfmROCX7sq9re8mCxZm8mpjOU2bYa0J72V9urLdoitJs/U5OYcVwCP+17/oDjap5YXD7f1wgPwGh8o5YKasJsuWYw64v39VczU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 11:07:25.0097 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: Re: [dpdk-dev] [PATCH] service: add new `rte_service_lcore_count_services` API 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: Mon, 28 Aug 2017 11:07:27 -0000 On Mon, Aug 28, 2017 at 10:55:05AM +0000, Van Haaren, Harry wrote: > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Wednesday, August 23, 2017 12:17 PM > > To: Van Haaren, Harry > > Cc: dev@dpdk.org; Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH] service: add new `rte_service_lcore_count_services` API > > > > This new API returns the number of services that are running on a specific > > service core. It allows an application to decide which service core to run > > a new service on. > > > > Signed-off-by: Pavan Nikhilesh > > Hi, Hi Harry, > > Thanks - yes a useful addition to the API. Comments inline below, apart from that, thanks for the addition! > > -H Thanks for the inputs, will modify the return types appropriately. > > > --- > > lib/librte_eal/common/include/rte_service.h | 12 ++++++++++++ > > lib/librte_eal/common/rte_service.c | 11 +++++++++++ > > 2 files changed, 23 insertions(+) > > > > diff --git a/lib/librte_eal/common/include/rte_service.h > > b/lib/librte_eal/common/include/rte_service.h > > index 7c6f738..5f0904f 100644 > > --- a/lib/librte_eal/common/include/rte_service.h > > +++ b/lib/librte_eal/common/include/rte_service.h > > @@ -374,6 +374,18 @@ int32_t rte_service_lcore_list(uint32_t array[], uint32_t n); > > * @warning > > * @b EXPERIMENTAL: this API may change without prior notice > > * > > + * Get the numer of services running on the supplied lcore. > > + * > > + * @param Lcore Id of the service core. > > + * @retval >=0 Number of services registered to this core. > > + * @retval -EINVAL The provided lcore is not a service core. > > + */ > > +int32_t rte_service_lcore_count_services(uint32_t lcore); > > Perhaps -ENOTSUP would be clearer for "not a service core"? > Then -EINVAL becomes available to indicate an invalid lcore-id pass in? > > > + > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change without prior notice > > + * > > * Dumps any information available about the service. If service is NULL, > > * dumps info for all services. > > */ > > diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c > > index 7efb76d..ddaed22 100644 > > --- a/lib/librte_eal/common/rte_service.c > > +++ b/lib/librte_eal/common/rte_service.c > > @@ -397,6 +397,17 @@ rte_service_lcore_list(uint32_t array[], uint32_t n) > > } > > > > int32_t > > +rte_service_lcore_count_services(uint32_t lcore) > > +{ > > /* need to error check lcore here, return -EINVAL if not valid. */ > > > + struct core_state *cs = &lcore_states[lcore]; > > + > > + if (!cs->is_service_core) > > + return -EINVAL; > > /* suggesting to use -ENOTSUP instead here */ > > > + > > + return __builtin_popcountll(cs->service_mask); > > +} > > + > > +int32_t > > rte_service_start_with_defaults(void) > > { > > /* create a default mapping from cores to services, then start the > > -- > > 2.7.4 >