From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0062.outbound.protection.outlook.com [104.47.34.62]) by dpdk.org (Postfix) with ESMTP id B231A1E20 for ; Mon, 28 Aug 2017 17:10:15 +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=HBY9Au82j0JLE0qi1wTJO7ZwlbkcbBYZvP0GcP0pRj0=; b=j7nvT0GdvBPBLlrPn98iwyyQ37fLKYODqSlU9f9jmIYU0wpfmYTNSSXKGR/X5yOd+48nSY4tg46fRkKavqSb5+OcUppVwwfdZ/s9LxHSgTZnQnVPlBkb+fhMgrKxNhBmE9jHurorm/IJ1gHI26/5ZLO6wprBcyuu2y0NCZTv3yU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (103.16.71.100) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) 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:10:12 +0000 Date: Mon, 28 Aug 2017 20:39:47 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: dev@dpdk.org Message-ID: <20170828150946.GA18980@PBHAGAVATULA-LT> References: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> <20170828113302.GA22141@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: KL1PR0601CA0012.apcprd06.prod.outlook.com (10.170.160.150) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f2ac623-c96d-4bcb-4106-08d4ee26e242 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:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:bh/BnH8dIc2AxtsXANfNq080bQ2k14+E/j1dXpnjSJq872MnnkUBuUzikO3eMAIKcqas3+mdTdufmdBHhHZXf76PMWRLFv9rcAMU6bsUkFd0VG3TL4JZsrsevjO/fLoBaeVekgmcXuj5tpTLqvMIO+9V1PIh9pNpgEx9swsLemzcgr6oZkQw6CAw9ZEg129eEgKw34htDwMw750WC9ct9Rk1pCsYnOpN8k0fjeJFAtq1aollMsBLSq4VKRNCRDu6; 25:Qc+7UmUfm8lU2BHzI6Pt08hxx2Tnpvj9CnKcVRLzEOjYjVhJ9hY1xiBct1ntSkUVWot1LZfsJGY3yhnjQDsgzbfuzTGhUc5+EYi6oL9DVppkpweMjqKcMyK2YKdCTnREB/uGf3KMFOtw/6kKhu63TgnK4/kWdg73w/2qVUARYSjoHh0skGjAsSZFxU36z4R6+TuDvn2c6N95PkwlA4xq5VQUYXeW4RsWX3GDLRbhT8q364+6Gh67faStK3hk8OCNQKSluUwDC93nKnpJI3ssQQ1nJADx5TH/uVTP/w+FfeIqBW/Z4ewC9H5T03MzgVIJVlIx9QnUHFTepzA8dmofmQ==; 31:vlwKCHGc+ZrhFZj2wZtBlUKL9ikeR9qXdr6rtJMSZTbbIQDT2pxrVmH1Jq3FZqB8rqL3ptXOV7ONIs0PhwZVMEKNvzFea3r11J1mRLEImceNy1arVQgH7Wi4WtWUdB4bM5G0jVnnzlt3pMuu7A4tBApdQMdTZ2k+2Nkes+qHxQCVJE6S0rr2DeA986vIoXFODwphma7IbJqGnRXpKpK68OFrd310N0DZmaqlAZzDvCw= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:eXc9Iv8jcFWX8JbRSBh3pampuzhscPSijJ3hl/kcdz7KffF9S5bZDgdff+K2uKXBF4h4A1pffQ9/JFStNCKBv88qb8/cxNcDJPYlm6PxlPx2qPvBegeSdN1sd90MLhYB9AZWhELkDaPlLRb/UN/aEhV1Tagw2ESJuI57UHy3Dr4Yj29rXIRyv6ZLPSWr6aZnW/Yav0NXt9p6aMT3gWvVSpflQtQoFgoAU4lunzhyw7LJPktBVIi40pA57ftAHge1GnZGyZQZZmefiDGJi4kIeM3v4NWuH7BYs79Z9cuRVy25veTt7QaM0fel0QIE6z5xU4WNWQUg81LOBeCLV0+mM+P3YSBcDcZ67x6NgKbvLy3qZjR6qDxK3G1dt1QPN7mIxfQNMGRI3PVUArS1or4y/WP7qfuAUf4GOV471DiStl4Q01AWqZSJW1GhLm14frE77PlfWsyyAgHcTFcx6iR+XAzOl4lwvOk28x5cZFJQq+Tu8WywMdNSBMVJkZtsDnZ8ohru0iRJaZmm6S75qOf9iKeRl+ni5WNaahj5sWnY35nGkTKkS+yfe8QWajc/luCxMHMvS3ph+JxNa3pqqtR+A+4oUDzyEPKWRG38JB80BhM=; 4:rJrMJNHX4EaxElax4t+H7wMH4k+Y2hcKiIvcuoblqbMWx0Lpj6LJORteRP1QS4MagJKji3+tf68Ib5nXTjUm1z9XLY3OV9WRBEXavQ66PbaalLvb8y5CLVe8Bh3Kwonu5GKuwlnjWLPvINZ2e8LJEXza0bYJ6XKRjwItR5x0ITc9lZpXl7+or4QE1nq9zsCQQGL3AHx8gpZmsne7IXFR16oNdkFgTSTIdWj118EdXQspDmgrV09Gjl9kbicrKrvfU9e/i5cWSRXRzHCeOICeNWIdSHr7yynivWj8SIKF8+w= 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:BN6PR07MB3457; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3457; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(189002)(377454003)(24454002)(199003)(6306002)(9686003)(5660300001)(53936002)(6496005)(83506001)(50466002)(33716001)(25786009)(110136004)(53376002)(3846002)(1076002)(23726003)(6116002)(7736002)(93886005)(97736004)(72206003)(55016002)(6246003)(4001350100001)(7350300001)(229853002)(42186005)(106356001)(105586002)(68736007)(81166006)(81156014)(478600001)(189998001)(8676002)(47776003)(66066001)(101416001)(6916009)(42882006)(2950100002)(33656002)(4326008)(6666003)(305945005)(76176999)(2906002)(575784001)(50986999)(966005)(53546010)(54356999)(18370500001)(107986001)(81973001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; 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; BN6PR07MB3457; 23:DLRyo9lvmwdtf7dBpF/+GHkS0BRgjBKezLdnh/0D+?= =?us-ascii?Q?bHzLpjeBjnJI9Y0Y0igK74oWFoiNcBGfg+KqShb+6dX58b/T6kjw9JaoYWzv?= =?us-ascii?Q?TbsuDkM1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A==; 24:9g9d43xJxj8Y4isEpWKlW1nq3cQ549HI0Fj3CRNI4mlTr5zxq1xcg4wbG8oPV9qXIzd4LivmO9jyrYlMGQQYVEigs/KAMC0Pv+wq3lqx31U=; 7:oyV0nDA07EKM0ZC7irCcZNNxm3aqJrHaVREWXFlA94jBmtNLkGuPdVblHz25005781R140b5VN/RQROEKC3KdalrairZRdxsFrv/FAJmSwopTMw2TGIaW0XXiZLnai35Pqyf84c31yRzR9GPWffu2TMDq4QPrtMEYlT9EOIn7mzjrE+wTBwjINw37uTVGSg0NsQ3aunyGW8WP/SiBeog+JggXlFTT24+6g6/y5OCuvI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 15:10:12.5586 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 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:10:16 -0000 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 > > > 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.