From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9022211F5 for ; Tue, 29 Aug 2017 11:57:14 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 29 Aug 2017 02:57:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,444,1498546800"; d="scan'208";a="895117633" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by FMSMGA003.fm.intel.com with ESMTP; 29 Aug 2017 02:57:12 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.59]) by IRSMSX154.ger.corp.intel.com ([169.254.12.83]) with mapi id 14.03.0319.002; Tue, 29 Aug 2017 10:57:11 +0100 From: "Van Haaren, Harry" To: Pavan Nikhilesh CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] service: add API for service count per lcore Thread-Index: AQHTIBiM0ZUs0GAfpEyTfkiD2w8+XaKbGPfg Date: Tue, 29 Aug 2017 09:57:11 +0000 Message-ID: References: <1503936405-23839-1-git-send-email-pbhagavatula@caviumnetworks.com> In-Reply-To: <1503936405-23839-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDk2YjgxZDQtNzUwMC00MzFiLWExNTQtZTFkMTNjNGY5NDJiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im9BY0l5S0xNTDZuK0pSYVRhRk1yM1lUSkdGTlc0amNyaVk0c1AzQ1dDZDA9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] service: add API for service count per lcore 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: Tue, 29 Aug 2017 09:57:15 -0000 > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Monday, August 28, 2017 5:07 PM > To: Van Haaren, Harry > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v2] service: add API for service count per lco= re >=20 > This new API returns the number of services that are running on a specifi= c > service core. It allows an application to decide which service core to ru= n > a new service on. >=20 > Signed-off-by: Pavan Nikhilesh > --- >=20 > v2 changes: > - reword the commit title according to the check-git-log.sh > - modify return types > - add function to .map file Generally looks good, compile testing flags an error in the .map files (inl= ine comment below). Perhaps mark the v1 patch as "Superseeded" in patchwork - keeps things tidy= :) > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++++ > lib/librte_eal/common/include/rte_service.h | 13 +++++++++++++ > lib/librte_eal/common/rte_service.c | 13 +++++++++++++ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++++ > 4 files changed, 40 insertions(+) >=20 > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index aac6fd7..5fe8d79 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -237,3 +237,10 @@ EXPERIMENTAL { > rte_service_unregister; >=20 > } DPDK_17.08; > + > +EXPERIMENTAL { > + global: > + > + rte_service_lcore_count_services; > + > +} DPDK_17.11; The compile test output shows something here (and in linuxapp .map file) to= be an issue: http://dpdk.org/ml/archives/test-report/2017-August/027931.html I think that the function can just be added in the "Experimental" section b= ased on "DPDK_17.08". No need to define a new experimental section. > diff --git a/lib/librte_eal/common/include/rte_service.h > b/lib/librte_eal/common/include/rte_service.h > index 7c6f738..9537ae5 100644 > --- a/lib/librte_eal/common/include/rte_service.h > +++ b/lib/librte_eal/common/include/rte_service.h > @@ -374,6 +374,19 @@ int32_t rte_service_lcore_list(uint32_t array[], uin= t32_t n); > * @warning > * @b EXPERIMENTAL: this API may change without prior notice > * > + * Get the numer of services running on the supplied lcore. > + * > + * @param Lcore Id of the service core. > + * @retval >=3D0 Number of services registered to this core. > + * @retval -EINVAL Invalid lcore provided > + * @retval -ENOTSUP The provided lcore is not a service core. > + */ > +int32_t rte_service_lcore_count_services(uint32_t lcore); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > * Dumps any information available about the service. If service is NULL= , > * dumps info for all services. > */ > diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/= rte_service.c > index 7efb76d..616bad3 100644 > --- a/lib/librte_eal/common/rte_service.c > +++ b/lib/librte_eal/common/rte_service.c > @@ -397,6 +397,19 @@ rte_service_lcore_list(uint32_t array[], uint32_t n) > } >=20 > int32_t > +rte_service_lcore_count_services(uint32_t lcore) > +{ > + if (lcore >=3D RTE_MAX_LCORE) > + return -EINVAL; > + > + struct core_state *cs =3D &lcore_states[lcore]; > + if (!cs->is_service_core) > + return -ENOTSUP; > + > + return __builtin_popcountll(cs->service_mask); > +} > + > +int32_t > rte_service_start_with_defaults(void) > { > /* create a default mapping from cores to services, then start the > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > index 3a8f154..e848c45 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -242,3 +242,10 @@ EXPERIMENTAL { > rte_service_unregister; >=20 > } DPDK_17.08; > + > +EXPERIMENTAL { > + global: > + > + rte_service_lcore_count_services; > + > +} DPDK_17.11; > -- > 2.7.4