From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0061.outbound.protection.outlook.com [104.47.33.61]) by dpdk.org (Postfix) with ESMTP id EDE6425E5 for ; Fri, 15 Sep 2017 16:42:24 +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=1ln3hZqbq6AhdcoY5aYbdY+mP5EK5gIH7YkG+qZgQ7c=; b=ifX+dojRIxF8LRJP5x3gQgT47iY9lRZLvIDyVxqYI/nrbDsakProtGmIDIk9aNp2+eyrQPsQDP4fy12yw2GIb6G1EAchghMPoN499rRgZ/AQpoxaeTiSnMSC0/Z4KqBMELGv6AjVmHYlPeRaHle8cTURoIRLJmMwYPNzdbXVUhk= 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.20.56.11; Fri, 15 Sep 2017 14:42:20 +0000 Date: Fri, 15 Sep 2017 20:11:55 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: thomas@monjalon.net, dev@dpdk.org Message-ID: <20170915144154.GA15346@PBHAGAVATULA-LT> References: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> <20170828150946.GA18980@PBHAGAVATULA-LT> <7169652.mOItyNrJXL@xps> 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: BMXPR01CA0036.INDPRD01.PROD.OUTLOOK.COM (10.174.214.22) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f6511d2-b7b0-4377-7511-08d4fc47f92b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:0p7++CP2VvUNnoI1L5efBcqQqsFXIeMlqD+GBmh0KzlLJ/x3u3Sqa9DNzRdYZO41QfuJLnmRbxo4g8A0snq1k0w7/GzMADnBo8wonRKoBJGsfQtDr8NmPEogiVSpLqcZnwEJ4064ZFuI0dvpzpSGGB4OOKSCFodtqoCZnlS8Ic83lz4n1Obixwse7zOa2fyBj8tG90/kL6czYZBqpD/Ofxv2mkrG0wp2XU3jQjwvCBaH47RtzWjNce4VG/Iv9AgV; 25:uF+k8Egt4rABkFrZfT2G59mdV0iAo1+FbF6Vd0H5luhmPOTbmHUJ/AGCLCcsZgOQrw11IAfVRKJuxPCXMOzETT2/6eeQJiPIH93T9HdH7KN0uaR/vVHAAQ6Qrbcmg7QzBSLfmCoZ0EkLObn05GJNonqQqLpCBUI/xJ552XKJ/kJnvxriKwsU0pEnJdlu2POMkqtKkSPu0K/lTpskBYBBufFTj7x0nSJdZAvwRDIDsKJUkyBJ2ZPf+utoSE8NXmbeXuFwNj9wvlej6krWCDS23vRlTlSHsNOnTrccncZXOwQm/fD76GP0ttvUVgqUJ4AmWNr1j9W8FNSegBXivXUs/Q==; 31:xTf0EfglH2D/on+zf91el4JtrVeVN4SDarH1I8g1oqEV9/5J3kAAgVbjv5yBsOdiucQE8LTon8205WBONOvx5tIGPVmQ+MFQLX70RQd3mRfJpQCigupS8RTTqmbU0xv0Mh++++cLVTGP1yO/yD2O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wAwwOfuVGFHg4= 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)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(10201501046)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(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: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(24454002)(377454003)(199003)(76104003)(189002)(5009440100003)(16526017)(106356001)(16586007)(72206003)(478600001)(53546010)(33716001)(58126008)(105586002)(47776003)(25786009)(83506001)(50986999)(76176999)(54356999)(8676002)(316002)(93886005)(305945005)(81156014)(66066001)(8936002)(81166006)(7736002)(101416001)(9686003)(189998001)(68736007)(1076002)(229853002)(2950100002)(42882006)(6916009)(53936002)(50466002)(5660300001)(6496005)(33656002)(110136004)(97736004)(6246003)(55016002)(2906002)(6666003)(3846002)(4326008)(23726003)(6116002)(18370500001)(107986001)(81973001); 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:dEy87cap3hZyx6o9NqYcZztLUYBcJHyOaWk6QVAMl?= =?us-ascii?Q?i7JogGdvdDAyyHDVaL0hdQbBUixg9V9q7aIw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sx5KkywyRJDOylfg==; 24:5RJ5YXMELMpA1P67YZfx72HmUbBUbc2BUmgOt6idbZbdXVIU7ki4GnQLdAKkubwKgLFHvBAZR7BjP1fLz+11DB64UbKFXKWZbrYfZfSEOlw=; 7:4fvEUR7zY/9nIo8xlKEhMNYxv5gzMAU560HRlufdcpvCczyY5+VRGCl6lPv2mT0MQqEzbMuN2yizj19JnISaMa1KTcCCyXO3Y7kJv5H7yuylfUcYiOMJuZlefJg0gYpPVape1BEayOOUYUnQe/KSBNn/cIEc0MICgtZftTZ+QFJG+3PoxeA+g4L33NRikozE7kbX2IqYqYWmXhekK2T5dohNKOrBFPzrtQSnc8JDXV8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 14:42:20.4647 (UTC) 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] 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: Fri, 15 Sep 2017 14:42:25 -0000 On Fri, Sep 15, 2017 at 01:57:42PM +0000, Van Haaren, Harry wrote: > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Friday, September 15, 2017 2:53 PM > > To: Pavan Nikhilesh Bhagavatula ; Van Haaren, > > Harry > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` > > API. > > > > 28/08/2017 17:09, Pavan Nikhilesh Bhagavatula: > > > On Mon, Aug 28, 2017 at 01:49:37PM +0000, Van Haaren, Harry wrote: > > > > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com] > > > > > On Mon, Aug 28, 2017 at 10:59:51AM +0000, Van Haaren, Harry wrote: > > > > > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > > > > > > --- 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. > > > > We must avoid adding more inline functions without a good justification. > > The inline functions are tolerated for performance reasons only. > > > > We could also choose to add this function to rte_service.h ? > > Yes that is an option, and OK with me. > > @Pavan what do you think of adding it to service.h, implement in .c and add to .map? > The ROLE_SERVICE/ROLE_RTE defines the role of a lcore so it made sense to put it in rte_lcore.h as lcore properties are accessed mostly through this header. I'm fine with adding it to service.h as suggested by Harry. -Pavan