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 E25B111F5 for ; Tue, 29 Aug 2017 14:05:22 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 05:05:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,444,1498546800"; d="scan'208";a="123637377" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2017 05:05:14 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.59]) by IRSMSX103.ger.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0319.002; Tue, 29 Aug 2017 13:05:13 +0100 From: "Van Haaren, Harry" To: Pavan Nikhilesh CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] service: add API for service count per lcore Thread-Index: AQHTILYV5Z8szZV16UaFYGe13thLc6KbO/oQ Date: Tue, 29 Aug 2017 12:05:12 +0000 Message-ID: References: <1504004405-22532-1-git-send-email-pbhagavatula@caviumnetworks.com> In-Reply-To: <1504004405-22532-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTFiN2I5ZTEtMzk1OS00MGQyLWIzZTQtNWJjZDc4NDJlN2E2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkN0WmgrZGJ2RG4yS2I3SE9sNFdWdEgzZ2VscXhvcGpEcTFWZVlIUSt3eVk9In0= 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 v3] 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 12:05:23 -0000 > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Tuesday, August 29, 2017 12:00 PM > To: Van Haaren, Harry > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3] 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 > v3 changes: > - fix compilation issues with .map files >=20 > v2 changes: > - reword the commit title according to the check-git-log.sh > - modify return types > - add function to .map file >=20 > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + > 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 | 1 + > 4 files changed, 28 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..79e7d31 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -222,6 +222,7 @@ EXPERIMENTAL { > rte_service_is_running; > rte_service_lcore_add; > rte_service_lcore_count; > + rte_service_lcore_count_services; > rte_service_lcore_del; > rte_service_lcore_list; > rte_service_lcore_reset_all; > 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); Building the documentation[1] fails, the @param Lcore should have be @par= am lcore (note the non-capital L, to keep doxygen happy). Sorry for missing that last review. With that fix; Acked-by: Harry van Haaren [1] I tested using this command: ./devtools/test-build.sh x86_64-native-lin= uxapp-clang+shared+next+debug > + > +/** > + * @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..468c706 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -227,6 +227,7 @@ EXPERIMENTAL { > rte_service_is_running; > rte_service_lcore_add; > rte_service_lcore_count; > + rte_service_lcore_count_services; > rte_service_lcore_del; > rte_service_lcore_list; > rte_service_lcore_reset_all; > -- > 2.7.4