From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0086.outbound.protection.outlook.com [104.47.42.86]) by dpdk.org (Postfix) with ESMTP id 664D41B53 for ; Mon, 28 Aug 2017 13:33:33 +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=pOW6UVWdieP+B3DiHnh+QdTDGUtrAxPipDWm4N7Kr9A=; b=kdEa2lgx0EXLkqGMCmga17bjt7Awc6gJyq9co61xNNbdZzCSd76ai1xdXFiswrN0Rv9o+//XTZpHGoXVkb8Z7oqEZa0jW6komh3PrcL7DdTGEAdQJzAeQ9OdCaM9DWll59WloqJUYjUn4sFxzYaqcgOLWi4FxeZLQVY/AXslciQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) 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:33:29 +0000 Date: Mon, 28 Aug 2017 17:03:03 +0530 From: Pavan Nikhilesh Bhagavatula To: "Van Haaren, Harry" Cc: dev@dpdk.org Message-ID: <20170828113302.GA22141@PBHAGAVATULA-LT> References: <1503501027-11046-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: PN1PR01CA0090.INDPRD01.PROD.OUTLOOK.COM (10.174.144.158) To BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 394432d5-bf6a-4541-00c3-08d4ee089bab 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:BN6PR07MB3460; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 3:bT2g6NhCE/am63rGf5o2ZeNscmXH3i+K8Rouz1x61eP4DgHt6LhroHbX96bwockC6CRkgJRdXQy6sncdhwdeSPh4aB5MF9CBF765l0Y3ivvTI0LX7yqzORCHcy239vk8edUhsaoUQInzGYnnq5hAxtHEnNbfcQeEfq+XtQMAAtn5Z3uKZiiiQXT8GADVymvv0Xsv6CfEnIGqtXu4wNLtTqyRGzlETAh1HwPys7S2HiJByACRW22cHdzGNc2cSTOe; 25:KvUqvcgSVEZPYVPPLM224qb5uzMtl5hkEDJKqRj5bnOcAgRk2DkAxBlQCOqCxePiONMVcNITfsg9NAf2QXY2psBiwlkVBSykCcJQYdCh5AMgB/uparPa05NJ1MtRDPl1GC89NnZS9MVL0ijwC8zK2jMBwUJTsWRydK7vBsKzmuHDuKEwykehaK+/qbjoS1ZDShYLPL7nwrV7o6qNSzsh5YI4c9ScWjIbmXtuTf5CvALvEWqoY8U1QFXFevGeG4puSmkYnHaH7nPxyc15Al0ox3p1+1Ow5Pd4dFqeApIYzZTybbwwaYwK1dUgFc6pwEdHHXKconGLwgyAmd9SxjVfZQ==; 31:gfvB8JyoTSBtOk2YyRlZa4X/w0vU/wyWGXthNcspjmoOKjaNIYxtfPAMpUxce+ZOi61oK8kxyG6yAqlevYjCb+4DSqPJiCcydNKyTLBDlKZ0I/qO8k4cl3BIYm0CX1RzVrn2zSoSAaCfaICLihmNwTdgL4nIIo9Fr0n+rXLOu4pXL2+rvxdLhf9EEX2riNVSqevrFAivLk6WVGtKK6IOmkbCZbbwY+6za0BtXc9Tb+U= X-MS-TrafficTypeDiagnostic: BN6PR07MB3460: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 20:Y5TDzfN4iry2wVgIeDD7mu1h2BJ3rcN/Mir+wsPY4dLVRfUVp4+8LIigMyuQxAWFmco/j2RpFu2ukqK5hMDTw8Hi3rLwOQZVXP9erMGJBS940m2wAIQlGkLAmoToqoh933LEOrhXx1S61O0gadIhEFcF9pcB1IPY+TyYccDQRCDnUAgZNjIBU/NXjenwuI4WEAp3R+9a21OlSh+2o+0o69BWxhqCZM8Z1IrPk9IOsTOIZV5ZIa2KdnOC9ENqAQBcMYpjqbYPSpJjVfxous52iRBYxpMw71qHVRDtrZUEKS1eZt1gHAoPdxdhjPBhgCmKsABBJjc+FsckvEPLvOynE8rIcXmsZY1Ta3ZI0JV+8qNiWtsoBBLhPdJ1AyfS6vcOWVlas3MQo5Y2zpsG2dpefdSsv4uMmA++s8MlXeU+CaZVwdFhgIyQORLJKWcpMuqAXYgkFV2tin4pCGN5yCEer2jn4bAXLQcCodG7FjyKQyeBIojaJInTDzlzXoq3R4FrtzAEFjqYJ4usEpZw9nJh+vvbBWMjoRoEZJblHZhTx1PYalLclV/VWnjGxKk3sCPNyP88BRDp4olWDgJfud8iBcQtpBUEiW7x2UwCCOc/l38=; 4:vi9J+VsKn+d1oATja1LbjSMReVzH7XKnDEf87Zc701Ms7VCkq1RWx0M7igFQeXi44xRwwwjapcivIuhd6UQAotwN8FRozxTfiRgVftoyn/x5L2wck3mzNa06e26uIyhNcP/Gcp+xOcmoIu3HYzwu0sNb5K31uVG9IqSE2Evu9MAFMMWPczG8VcqZxhCkPMroOBEyyJqsgG+d3EJ5h8DsK8doI/mfojo40cwCzi0a7EgmwIKds4mWB6+pj5VJoy8XgUBGBr0ZtIP44tMMqXllP84bVXQCgIxKljv8dc6uv9M= 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)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3460; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3460; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(189002)(24454002)(377454003)(199003)(305945005)(47776003)(5660300001)(5009440100003)(6246003)(53546010)(6306002)(53936002)(7736002)(110136004)(25786009)(2906002)(81166006)(53376002)(81156014)(66066001)(6116002)(83506001)(55016002)(8676002)(1076002)(6916009)(42882006)(2950100002)(3846002)(966005)(23726003)(33716001)(54356999)(76176999)(72206003)(50466002)(106356001)(105586002)(6666003)(101416001)(4326008)(6496005)(9686003)(50986999)(97736004)(229853002)(478600001)(33656002)(68736007)(189998001)(4001350100001)(7350300001)(575784001)(42186005)(18370500001)(107986001)(81973001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3460; 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; BN6PR07MB3460; 23:GTPLb1jxzbBbEG29uu2frXBAp0MhUvkDSSH0vkJcT?= =?us-ascii?Q?+n91nmD1iQt79g/0LNffLcmIOJCrKT0A7ABfqc7Cvy2H5Ueb+Zt+0lBqW8oC?= =?us-ascii?Q?NY1HPV0KpjYwhewPKZ2Omdee6JCTzKddxNv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2h4wj2JZb+eyp2alQs7CjWDA==; 24:Bzv102LEwRsqc2fSh3KFXqDn8XiIh7mFE+JiaLi2KFy8MhFLIvpAc5UJyGaMIKpebycoSO1tZnMdZjTlM8NyTSAC4DUGH0WekPhLuaLVqdc=; 7:awYL08jQKgUT/O3QfIu/TOgMQPnLYXsz5HCs/Xv5TiwZZQi/YKdXP186P2Niwh8SQo5oXoVKPtyeQJYHM8h2zoF8VZDHPR8TggzXgMfyTumPUXRWVs8Z5EJPA9ZQuIL+rJoesdFKAG/9cxqiERMEO4ueE/l3B0iMwS63iFGJ7huGc7UWkU7/c4ZynWsNoSsYHsaTPQylTimBZxbqH/VV+as9Q6+yXCYJBiLEijMOJuk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 11:33:29.5063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3460 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 11:33:34 -0000 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. 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. This new function allows such libraries to check if the role is ROLE_SERVICE and allow those operations. 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.