From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0045.outbound.protection.outlook.com [104.47.34.45]) by dpdk.org (Postfix) with ESMTP id 278142FDD for ; Fri, 15 Sep 2017 17:00:10 +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=BK9+AHlvXi+qvjfoBTfH+RA7QlGseYhcFaYUjvEkuTQ=; b=m0/OqGR5J8A25ZMB0jBfsv1eTmx/MpHofX8WrcMT/Clw1jYXOISK4svYF1VulyUiRwHEt8xraockyGAIihqPAWZ0KvVsc46HTshacjhabuHE8wu6x3aG+fYWi+lwVriuRZcAaoqHIkNO+duvKU015czb7dhbNNm1B5MK3HY3+5A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) 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 15:00:07 +0000 Date: Fri, 15 Sep 2017 20:29:34 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: thomas@monjalon.net, dev@dpdk.org Message-ID: <20170915145933.GA16776@PBHAGAVATULA-LT> References: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> <20170828150946.GA18980@PBHAGAVATULA-LT> <7169652.mOItyNrJXL@xps> <20170915144154.GA15346@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: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62114c67-cec3-46dd-6ba1-08d4fc4a74e4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:4Y55PIV7KUVQHWBrZ+M/+7IvnQzdz33EeCKnsMLNaMcFiWCekhnWs/WKRTdy/CTn4zUdJxvRP666IfXuieWhMObzezNQYIEZ1N1zZlxid5Ebak7+3vYPC63iVY5nhgtyLbVnxs+krWGp1+fykQq50Sk8L1ewWX1P6vh3er2PyPx7FEXzb7+5913iszg6S4jvfh1wgiN0fPyJpFuCp24ZT+oM1aSfIH3F5Cyx+VYobpDSyn8gANswgW7xmBxyezxR; 25:Svkpm/E7mYV2X2reZFweTZS9PPYIKTrNFekws8pCKMMOCRmpMLLkOyMuKRvWlUAioxpovpMTJ0DPRqK0HoRy0RrqyrR6dSL7bu3jwqn6r4418zai70RrdpsDjwCgXkodfh9eP6CUgTEIIhkuCub9T/U6M78ZT0pcAQuF36yhVYrikVMpOVutk9JdRBf+WVrEkUC3WyjNImb5ozOXOmOEcJog27EZx1+QjEziQNdQALFpMK1gu7djko2l7kpwDUSmTOqgUFgdTvzlc7Ch+NdWYKTs4Fi6vF+BbXhGXr546ajrnNOUL4WD+TdokG4oGA9t8D5/jh2Dzs7c1glmjVhfRQ==; 31:Bh2+1rZKxYKQz92BZkDEpGZXk8KtO9KszcLmMhh0z79noRxHAbGjPeLFyoglcY1q77vFGtew6pTg0FY4gbug50YETXfC8n1faY19GkXQk5Pr5sqY7RKeERmspQLuNyiFpaSLrF1mN4z7I7gFoOLo4gVRR+oI+ptzYu65BocYsezDh3g4c2TjtBkqUnaHhAhphw5+h8XjcxmhRwvsN01ukg9cK/zIIljGFh/xvhrjNtY= X-MS-TrafficTypeDiagnostic: DM5PR07MB3467: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 20:6A8lxQ5OBSchdYCJ/gU1Rd4H+S+Fco0bEUSbuMdUQS+nUeyMn55NHkN9kRtxpqV2YCkpLXQs1WSM5CFjmFgHGK6TJhYncHJVQWsi5SdD93tRdEll/lwCX1QYYSn6zwbYwqwMSv27W5cGK79JK2fEpCpJuMj/tRqFtfTtsWGg6b0jlaMtUcoyYyD7yAO6ly/U+sVM5WsREo/krufn2cqbOey4c67WQVt3u+y4hcUSSNiJcuPTVdvBqi5ty4l3fInFeW8AXRBrhjyshDe7Kn2MXvPmuPSRgosM6T/XmL4E7QSou6hQqdg3nwWtqjsbUF0BdT2BE/cb+odiQcvr0ALYp4qflvyySjk10oXyulWFbMICseqbCMJrOV/cHvX9MNBho22lvqO/rNv9g8zOqfA/rDcs6bc/ocEB38FBD739vIGScxHzu1hixpeGZiLJeez1GZZ1Cl3hjgT/qpQN0gmtNERI/dfoHktCTgCIe0nKd/OS5SGt6KrSDjorucpflz6lQrYG5L+O6Xo7yVE4u51GdO6l4Wli5wvqzCnQWMS0H990WJR9zm79xhOHi52qqsA3CUzw02l90UY86kVRNZlwgKPOIL5NJrxWanU/UjHzr+M=; 4:BrLxsLnvCihb+S1CzioLOntUPBYefnDVwDUK4YcDwLZyJZtRqKqQQrlSw+OxLry8nsbh7sF8rBrTBBATfCDqxynvkul8lUirna7i8+wTkR6knyLeiHLnMDRXwwaCEa50xDV5xripEM4TQWFtn6Y9juuusd5Au7N1zdh8CccMcQzbB2tFCbTSV6Vh6VE2FN7Ki8mtZ78NZ1u78wJICdZfpTZlr0F1T+IJBEG3ug8Wn++morsofVDvm5mZPvrROzXDZ51LRiRKymYDut81LpbvM0vvoyIn36tvCL9vr+NZXoU= 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)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(24454002)(76104003)(199003)(13464003)(189002)(377454003)(101416001)(478600001)(68736007)(16586007)(54356999)(76176999)(16526017)(50986999)(47776003)(97736004)(33656002)(66066001)(33716001)(5660300001)(305945005)(7736002)(316002)(105586002)(8676002)(229853002)(25786009)(8936002)(81156014)(81166006)(106356001)(3846002)(6116002)(2906002)(53936002)(4326008)(93886005)(23726003)(83506001)(5009440100003)(1076002)(50466002)(58126008)(9686003)(6496005)(6666003)(42882006)(2950100002)(189998001)(55016002)(6916009)(110136004)(53546010)(6246003)(72206003)(18370500001)(107986001)(81973001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; 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; DM5PR07MB3467; 23:ec/h6WshlOdWn1XHTodAgH7DqCRKqMIpSBIRhrJV4?= =?us-ascii?Q?QXc8frCK/w1UgmN5ZdAVIiMmhWw2BcOtfAf+A1wmQ80W6RW2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XeHCb8JZUBA==; 24:5TMZiU+CoSQex6j9aXr+Yy5GJtCPP6/ZXOQj2Poc112rXCSEtLZ6cISJgr9edvNjTqiiGPmLLXvqR/Ra8UpW04BzC4BACFqV+WH166z7mTk=; 7:YPGT8UD4LIOf+29M7HyobIN3G8DwXMlYCXUeQaxfZD7BU52euF9MCSdkDF4AXuylKw/HL+khrvje9aY3TfjPdYPhw87r5BynJ+cscumpjnZCHnvw2Ni1ux5xi7wdzkzF0SO7rtMo941Gji2mrdfqt6kXOrO6cjSq6PE4WaqpH3a+YytcE6G6NTm/ByB+cEfQBGCdTsm/z22TRwaBAe0ACpk3HHte+A9Oq2PG/znjiqc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 15:00:07.1082 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 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 15:00:11 -0000 On Fri, Sep 15, 2017 at 02:44:57PM +0000, Van Haaren, Harry wrote: > > > > -----Original Message----- > > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Friday, September 15, 2017 3:42 PM > > To: Van Haaren, Harry > > Cc: thomas@monjalon.net; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` > > API. > > > > 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 > > *as suggested by Thomas ;) > > Initially I thought it made more sense in lcore.h too, however the application > should only require knowing if core X is a service core if it cares about > services / service-cores, hence I'm fine with rte_service.h too. > > -Harry > Agreed, will spin up a v2. Thanks, Pavan > > >