From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0081.outbound.protection.outlook.com [104.47.38.81]) by dpdk.org (Postfix) with ESMTP id 9E00F1E20 for ; Mon, 28 Aug 2017 17:43:23 +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=73VOBq+Kncw0uf0rOBhH7goKXnQWcM2/TVerpOy229k=; b=hXbUiLOLjbHM88/aS3JAo7xfXMqFMqhseUx8Wcglnqftn7NqhPeterfktBHSVnnEmOy4RvSsxLVkr73bnJoFQWRmi0nD7IDHhZHMJzffLinfTBuELr3DDmBMIxRFMdlOIsg05kMcNaKtV1hhUW6gHckSuCcdhO716Teo9WPLjzQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (103.16.71.100) by BN6PR07MB3459.namprd07.prod.outlook.com (10.161.153.22) 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 15:43:19 +0000 Date: Mon, 28 Aug 2017 21:13:00 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: dev@dpdk.org Message-ID: <20170828154259.GA20482@PBHAGAVATULA-LT> References: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> <20170828113302.GA22141@PBHAGAVATULA-LT> <20170828150946.GA18980@PBHAGAVATULA-LT> 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: [103.16.71.100] X-ClientProxiedBy: SG2PR06CA0144.apcprd06.prod.outlook.com (10.175.208.150) To BN6PR07MB3459.namprd07.prod.outlook.com (10.161.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdd263d6-f929-40f4-b250-08d4ee2b82d3 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:BN6PR07MB3459; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3459; 3:uMpaex6+E/ef9qw3wJ2/vJiLTfTrTFmGD5pOdZpqDH+WJoKTkiFKr5K/n3Sg1QbHAdwxAr8VGAVcmlEACLT4RBg1v4OlG1sx/Cqo8RljzFW0J2h7giUZ6s9MBXHUzQSZCv1MEZ1PmfNbqnmU92UUU+6TEkLbzzXWtJsqhCrFiLeocvMxsGzoJ2nYBDKZHQuw33vJDmQw+lEvWW2hQr2LhcSKuNQ7JBkGmaH3fBv39GWjbMOONtRkGvo5xa3GcAbH; 25:4hSP0cuf/WIByEOvDzrT6abVM/C0PbHfByppJDSIAsX0Bo9GbWNFuIdutN9QATbt6X+8HZI0638c1oE3H+MLyMvhutkaX8nPN2iO0WabbMV56UQ7s661vFBbM6dMdlK6KU8rmQRaA24YIoGIzr7BboDmVWFS1R4h1ZlsC05vKeTKG8+aGauOgso6yDVMCEcttnuYpNB9/sxn6GPlTNKOxKQ1ABBNemIJuUXiAVAUk5ARIrl5Rlt0cVgAPZx1xP0Bk87CXUCta8x6TDv9YtGKzQAOnqaDG72kIuN28nBYYrSVZRCso8iIxjgdtkXlJOSTJ6q8RQpk/2CUWXotmwYPuQ==; 31:33R0imOwspBo+m7pS7+CiQ6U4XiU4LH5Mei6N7KcmdwoFQaIatP+fTH5LAUBiIeEpfiMYA/LPSazgnLiLo6ba1bm/qn4qAMBDoiWriHG+80K/Xxe3AI/PomPBtusUjsuCEYHnTBKlDwccqmG8/cPdf18/PzGwNz2Rgqopo3cdUQIQx1qUthz6OKKOBM5Hc06ajJDctndWG+a7YQ5Jk8yxopQP4YaQEz/gjex0IGSRnY= X-MS-TrafficTypeDiagnostic: BN6PR07MB3459: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3459; 20:aqJwfV+zW4pB/bcpg6OAtqqXe23sDX5ja93hYKptzEbo+D7bFDoKPcJvh/8Fq+1DyuIsNTTLr8gQzz1K1pNSmKPMudoG1jc/u8vV90LrJZSq+9zHm+kfC0+K0JsouAPto1EAOSJtYfe/f5Nd01IEJ3+2LsjINsBLPUs2s01iiEL71sNT5Xdgx1s145yza4czRClBAhz8knnKzYHkKZZTiWrQ9nNKux9m0VNtbSKusk9XBJHDN08nY8xdYVWgB6sNB+Fo0Sq36rAzcTT8GR11FpMCR9YstCLmYCShpMEgBIl+Tn0af+R9GkH51okm6t55/RgRkVq+p0zuMJakPkxKju6E3HTp47RRGhCvTjPYd5TitRJMNr2yGlrgjEK2yctTI83j1HBG36wh5oG/fjkyl0Md2rfoAIcutupVtgtNTP3uVWDbOJ3DvWa1mydwx6NJ9uXIWWIqFwKYtSulQeuVqzLXz671l5M9os1bj7Q1lBmXA+GaNLWhihsW4DcyNKD45sU+G7tl7L9pvO4aDxPy26Qxng/BqE3FYFjDCk2+3gvsbElXPs0VdBGBoW/RbaJRRyphF0EcLLHGThk9FsboIl9/npFnSV9xR/EFHAvF07M=; 4:3u7sUmxwE+jPTM7eijxOFixaYueOz485nLa7htSDqVwh2AJg0f3Ydo0sgI89ohoBR053W8wZ69mXPYEKJa/LnKgtsYipqkZMdAtST1qb2jg+8mvft83m3X+00uR7Pv7UkSXg73Qc6wDq3Lpg12LbM1zz3MQK34cI5p/cef0AyHltoiOZhsLhLz0cFg84e3HCAwkDmuAb4w78w9650Dzt3wnDViDFkRwgxBfZxeEm8JAn7Qp/5+e/HS4gB2ooF8mXIDjLw393hWlQzJBMqg7+k7a+X3G+PB8Y3Ox0xXMPbYk= 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)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3459; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3459; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(377454003)(189002)(13464003)(24454002)(51914003)(199003)(81166006)(81156014)(33716001)(50466002)(25786009)(3846002)(8676002)(83506001)(97736004)(47776003)(6496005)(6246003)(4326008)(93886005)(53376002)(110136004)(7350300001)(575784001)(6666003)(68736007)(9686003)(6916009)(42882006)(2950100002)(6306002)(53936002)(229853002)(55016002)(53546010)(33656002)(7736002)(66066001)(42186005)(966005)(305945005)(23726003)(6116002)(105586002)(189998001)(4001350100001)(478600001)(101416001)(1076002)(72206003)(5660300001)(54356999)(76176999)(106356001)(2906002)(50986999)(18370500001)(81973001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3459; H:PBHAGAVATULA-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; BN6PR07MB3459; 23:KiOqrWfS4GMwk6H27Kr0uvC3VtBJy6/y9d+aiTa1t?= =?us-ascii?Q?D7tLIXzUS0PImYM034evRbv+d7It3/7e/FFCz81v++UaAxV/yA0BQS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/TrOqqfkNfyVroFks8Q7Ly5dPJrSrEjKz+YUchEgf160l/NgWacNa3CZ//uykyPD7USVZ6VpHLT5+pfg==; 24:umlv4repNAt2RsVuQZ1pMfoBh8Jn5oob+NFQcpNrey1VWjG52TSAieziKWI465vvFMkKuoahbgC8hNszI+RL4L4vP4lanBZE3BmCFCRzUzo=; 7:7QsHVOr3vaYRRtC6ucnr3zWZpbYzdc2Ur9VX9lY4++rFa+PVfpkYQgyjMD/QwCVoFfwnfORwE5gfjHzM30cAdVMAXbR4iPaLAf1bWYFmhIo9KyxBih57tjGRl6UzcSJTe5hipvQv+72ccRfTgc58kJxIzcqW2cxkLRrETRNkqHywU0/Twc2wA0VY2sOu2InMCLdTEa6qw+kQf/TazhIpQRpZba/AZKDUnlvURUN9i/8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 15:43:19.9498 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3459 Subject: Re: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` 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 15:43:24 -0000 On Mon, Aug 28, 2017 at 03:24:06PM +0000, Van Haaren, Harry wrote: > > > > -----Original Message----- > > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Monday, August 28, 2017 4:10 PM > > To: Van Haaren, Harry > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` API. > > > > On Mon, Aug 28, 2017 at 01:49:37PM +0000, Van Haaren, Harry wrote: > > > > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com] > > > > Sent: Monday, August 28, 2017 12:33 PM > > > > To: Van Haaren, Harry > > > > Cc: dev@dpdk.org > > > > Subject: Re: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` API. > > > > > > > > On Mon, Aug 28, 2017 at 10:59:51AM +0000, Van Haaren, Harry wrote: > > > > > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > > > > > Sent: Wednesday, August 23, 2017 4:10 PM > > > > > > To: dev@dpdk.org > > > > > > Cc: Van Haaren, Harry ; Pavan Nikhilesh > > > > > > > > > > > > Subject: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` API. > > > > > > > > > > > > This API can be used to test if an lcore(EAL thread) is a service lcore. > > > > > > > > > > > > Signed-off-by: Pavan Nikhilesh > > > > > > --- > > > > > > lib/librte_eal/common/include/rte_lcore.h | 18 ++++++++++++++++++ > > > > > > 1 file changed, 18 insertions(+) > > > > > > > > > > > > diff --git a/lib/librte_eal/common/include/rte_lcore.h > > > > > > b/lib/librte_eal/common/include/rte_lcore.h > > > > > > index 50e0d0f..7854ea1 100644 > > > > > > --- a/lib/librte_eal/common/include/rte_lcore.h > > > > > > +++ b/lib/librte_eal/common/include/rte_lcore.h > > > > > > @@ -180,6 +180,24 @@ rte_lcore_is_enabled(unsigned lcore_id) > > > > > > } > > > > > > > > > > > > /** > > > > > > + * Test if an lcore is service lcore. > > > > > > + * > > > > > > + * @param lcore_id > > > > > > + * The identifier of the lcore, which MUST be between 0 and > > > > > > + * RTE_MAX_LCORE-1. > > > > > > + * @return > > > > > > + * True if the given lcore is service; false otherwise. > > > > > > + */ > > > > > > +static inline int > > > > > > +rte_lcore_is_service_lcore(unsigned lcore_id) > > > > > > +{ > > > > > > + struct rte_config *cfg = rte_eal_get_configuration(); > > > > > > + if (lcore_id >= RTE_MAX_LCORE) > > > > > > + return 0; > > > > > > + return cfg->lcore_role[lcore_id] == ROLE_SERVICE; > > > > > > +} > > > > > > > > > > No header file and Static inline - so this is only to be used internally in the service > > > > cores library? > > > > > If so, the function should actually be used, instead of only added but not used in the > > > > library itself. > > > > > > > > > > > > > The enum rte_lcore_role_t has ROLE_SERVICE which tells that a particular lcore is > > > > a service lcore as well as an EAL thread some libraries such as rte_timer allow > > > > specific operations only over EAL threads. > > > > > > Understood that role of cores is important, and that rte_timer might require this > > information. > > > > > > > > > > The rte_timer lib uses the rte_is_lcore_enabled() call to check if a lcore is an > > > > EAL thread, Which checks if the lcore role is ROLE_RTE. But it should also > > > > allow timers to be registered on a service core as processing those timers can > > > > be done on them. > > > > > > No problem from me here either - although it's the Timers library maintainer that should > > check this. > > > > > > > > > > This new function allows such libraries to check if the role is > > > > ROLE_SERVICE and allow those operations. > > > > > > If the timers library requires information about service-cores, it should use a public API > > to retrieve that information. Having "internal" functions between libraries is not nice. > > > > > > I think a better design would be to add this function as a public function, (add it to the > > .map files etc) and then call the public function from the timers library. > > > > > > Does that sound like a good solution? -Harry > > > > > > > The file rte_lcore.h is in librte_eal/common/include I couldn't find a .map > > file for eal/common and also other functions that are present in rte_lcore.h > > aren't mapped in eal/linuxapp or eal/bsdapp. > > I think it is fine as the functions are static inline. > > > > -Pavan > > OK - I was looking at this from a service core library POV. The intent seems to be to update EAL in order to allow detection of a core having a ROLE_SERVICE. Now I see your intent better, no problem with the approach. Correct that static-inline functions don't need .map file entries (cause they're inlined :) > > One technical issue: > > + if (lcore_id >= RTE_MAX_LCORE) > > + return 0; > > This should return a -ERROR value, as 0 is a valid return value that should indicate one thing (and one thing only) "not a service core". The function function follows the same structure as rte_lcore_is_enabled i.e. returns either true(1) or false(0). So, I think returning 0 would be fine?. If not I'll gladly send a v2. Thanks for the inputs :). -Pavan. > > Please spin a v2 and I'll Ack. > > > > > > > > > > Currently, the only rte_timer library has this specific role check. The > > > > following patch shows the usage in rte_timer library. > > > > > > > > http://dpdk.org/dev/patchwork/patch/27819/ > > > > > > > > > Or am I mis-understanding the intent? > > > > > > > > > > -Harry > > > > > > > > Thanks, > > > > Pavan.