From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0051.outbound.protection.outlook.com [104.47.42.51]) by dpdk.org (Postfix) with ESMTP id 0999D7D5A for ; Wed, 23 Aug 2017 17:11:04 +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=/veZf96vTgDXER4Tj8OFsh/1Uq7jXrzEyTY1rnDTBiE=; b=OEbMiKDzAeZScwUGsRDzRzIZGJ/nbltyFBi8F3QLykiwWTxT0qgfPEa756HcxSRlIE6XhF4IVA14Yt4wqcmSl86do9FNDgL2R10wkrcfDrWTRFlwmptdWCE+8WDWuVL9XgXgB/ub9qnqKmyc7vObcJLQ0BlTAHtM7exozwjSO8M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) 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.1362.18; Wed, 23 Aug 2017 15:11:02 +0000 From: Pavan Nikhilesh To: dev@dpdk.org Cc: harry.van.haaren@intel.com, Pavan Nikhilesh Date: Wed, 23 Aug 2017 20:40:27 +0530 Message-Id: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0099.INDPRD01.PROD.OUTLOOK.COM (10.174.144.15) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aae17935-dd52-43e8-53ec-08d4ea392bb0 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:BaUiNJcXIx5eneV5PmPXscVufTeCPOb8RUpDduGXVLE5ex12kDMhX3bnBxlvXX9qM5HH4wCwo+ucPCXDZlst7/cqyKBH8sUTlGq+DDGBNywoxbnLdhnZwgH+hjVz+zNRNGddwi251Ps3ZyPtXt9veGm7Ijz9y/mQzvpNj3uGOHUklkwW16J9ikk8kWlhmZi1M3dP9ZVtSGeac2d9Zh1PuWYiGJOY3fULUpeJ36ppVgNIn83WKZatrxaTHqE4pId3; 25:k0qhUd4/NpF8NuKKBmS5IeGxpW2meCc6kwAHk0wqkOqdymCZXH3eboTOPT/OeTlJ6eTNPKYh1yqaLhkEPVwYTqq1cSgqLosUvVoWTCABVCTwi7c2rJ/SSDBlyd00V9VlI/Roo1o16asa1Scqnm09wDYjJuu6eqt2fYGWRZKnBaN/kAN+z9czA2no9AN6pfD9gYB3fbFCUo4PxXqMn9qmnegRTSzc7DKAkMI09Z/v05NYaz1O3uZqtNcOZyHK84dPriq9jmKEHmYpFzaF7lAupwLoj3WYQ9zCzCFYYc8s3rIUNtF4i3lPzN07Mi5RIYitYIMK3fcMapLXp0vKUA88Tw==; 31:H/eR7nwFFHpbRLcWdx+iUxc9PVd2ITBa0ZR6o+9UWWpnZRyvuEAxOGRLzSpGqNQEMLcY0+hDRuXbZj8lFnHkC4rWqVVpKq0RLjdeF8KDI+nZ418rYKRZ7t/gA/CqxXMknZ/Q43JjVY+31PZZgszZh/dQyW6q0h8eKhytjUVu557tjDzACbL+wpRcuj7ffSvQo/JQAwfEjIbz8jUAKIQdAj2JTj4NhkcAarFqDp8aXz4= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:JNX7Dn6C0mvQlW1iOuySamxaZ4U9Grmfr4OmOK7hVdY+POiCDyzggMMzayhcZz8Xz5dpkfZ+wbn77n5+V2CMMmqO5Mb0x+WCDBsPjI1NFNp5CmUu/6vK2IT11NnBBPfotXroIq0vHPFuqkkcWPRF8tahOvdW0V0SdTQS+z8A/YUgbW9YlwEzQr+6S7r0Vq3/3UH5O8ly3uKgKVQzuR7UGqq5pHBlp1nTrKnqL4jec6wWeiqwf1Q3TPfg0uf82rOLC4UEJ50ZPj/aRE/9dVqP8tQqNazqWfSu2tMCNcdoS1C3OCtBVnWZafvxjIv4ACZ2zS6f1lqOSTzzfZGhddDFOejncIl1YnwV55FrT571pKBEwl/HhQt0rK59qH4vFQ1VocqpUno2yWG/tcDXz+agZebGI22CD/8u8Bd4ZBA3otk51F07/VbG2S960QsYnldkL22wTZhy3/CYLmLLobY1YkzAcrVl9aq7+7NHQXDTKjoC7iKJNzB0BGZTM/MIoJw0im9ntc/Om/qD/9Wp/GHYyuuRYS35wkxsxe1LghygNXiqhL3DmeApyKvqCiZERtAa2Rtb1FXvdx2XU7m2Slb3G9etfJvob0ULPyb5FF0M93Y=; 4:JJcwr7YZQ2OgNETvkuHv0DD3STlSFmAUhVH6EutvZd3dxBDKvmLPCPoC9Te2VlRKZ3aned3sdLL+tAzHf7CuuXq8aAMxkrfsAOW0eu/ZzZ+YGrqtM15XKSu2DkTeBJmuRBBnF13wnGUpCs3YVLDaXgYKK8AQCJaN0tGZ+viF0p7JuOvykuUyQXI3Y4Bd3IIeNrBb442Gd+DOG9IcgSMKqQFTvjSxPon1ulONIVl0QcowMMYcKDb1RfYEh7m1qUm/ X-Exchange-Antispam-Report-Test: UriScan:; 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)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(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: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(189002)(199003)(2361001)(2351001)(110136004)(8676002)(6666003)(42882006)(106356001)(478600001)(72206003)(81156014)(33646002)(53416004)(6916009)(6116002)(36756003)(575784001)(105586002)(3846002)(305945005)(81166006)(6486002)(69596002)(6506006)(7736002)(50466002)(107886003)(189998001)(5003940100001)(50986999)(7350300001)(48376002)(68736007)(66066001)(53936002)(2906002)(42186005)(97736004)(47776003)(6512007)(4326008)(5660300001)(101416001)(25786009)(50226002)(5009440100003)(81973001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; H:PBHAGAVATULA-LT.caveonetworks.com; 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:t6hfPOITnqZ0x6272bWj4H/Avne6u95XVJdoITvgb?= =?us-ascii?Q?G1wAOj0VoSRZ9X9JbspFzAKEJIJRkqcPU9TvOu5UyTiHkaB5adXa4aO0Hg8v?= =?us-ascii?Q?ladWZcyMUeYnZnV83AVLQyz0KpwiqA50qKvH53rqo5u13Xqn6koHRSgpscAu?= =?us-ascii?Q?HQHrtbKIjFuFu/j8guFBsDHlOnC9y9KmTPwaSOMJZz84SpBAObR8RR5yqG2n?= =?us-ascii?Q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E0MJ6NNhphQPwE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 15:11:02.1531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: [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: Wed, 23 Aug 2017 15:11:05 -0000 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; +} + +/** * Get the next enabled lcore ID. * * @param i -- 2.7.4