From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 632C4137C for ; Mon, 28 Aug 2017 12:59:55 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2017 03:59:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,441,1498546800"; d="scan'208";a="1008327023" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga003.jf.intel.com with ESMTP; 28 Aug 2017 03:59:52 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.59]) by IRSMSX107.ger.corp.intel.com ([169.254.10.65]) with mapi id 14.03.0319.002; Mon, 28 Aug 2017 11:59:51 +0100 From: "Van Haaren, Harry" To: Pavan Nikhilesh , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: added new `rte_lcore_is_service_lcore` API. Thread-Index: AQHTHCIRejLk4K1hBEGkGqXEqpO/LKKZoOZA Date: Mon, 28 Aug 2017 10:59:51 +0000 Message-ID: References: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> In-Reply-To: <1503501027-11046-1-git-send-email-pbhagavatula@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTZhN2E4OGYtNWZmMS00ZDBhLTkxNmMtMTk2YmZhODMyOGQwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImIwMFNnYWpsMitlejJEWUtHUENmUHVTb0lVK3B6NlpvYVNuYll3UzZCS009In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 10:59:55 -0000 > 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` A= PI. >=20 > This API can be used to test if an lcore(EAL thread) is a service lcore. >=20 > Signed-off-by: Pavan Nikhilesh > --- > lib/librte_eal/common/include/rte_lcore.h | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > 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) > } >=20 > /** > + * 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 =3D rte_eal_get_configuration(); > + if (lcore_id >=3D RTE_MAX_LCORE) > + return 0; > + return cfg->lcore_role[lcore_id] =3D=3D 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. Or am I mis-understanding the intent? -Harry