From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: Re: [PATCH 1/1] eal: return true or false from lcore role check function Date: Thu, 4 Jan 2018 14:17:45 +0530 Message-ID: <20180104084744.5o355aweb6g232oc@Pavan-LT> References: <1515005015-31990-1-git-send-email-erik.g.carrillo@intel.com> <1515005015-31990-2-git-send-email-erik.g.carrillo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Erik Gabriel Carrillo , harry.van.haaren@intel.com Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0041.outbound.protection.outlook.com [104.47.40.41]) by dpdk.org (Postfix) with ESMTP id 77CD12951 for ; Thu, 4 Jan 2018 09:47:58 +0100 (CET) Content-Disposition: inline In-Reply-To: <1515005015-31990-2-git-send-email-erik.g.carrillo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jan 03, 2018 at 12:43:35PM -0600, Erik Gabriel Carrillo wrote: > Update rte_lcore_has_role() so that it returns true/false instead of > success/failure. > > Fixes: 78666372fa2b ("eal: add function to check lcore role") > > Signed-off-by: Erik Gabriel Carrillo > --- > lib/librte_eal/common/eal_common_thread.c | 5 +---- > lib/librte_eal/common/include/rte_lcore.h | 2 +- > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c > index 55e9696..28ee6d0 100644 > --- a/lib/librte_eal/common/eal_common_thread.c > +++ b/lib/librte_eal/common/eal_common_thread.c > @@ -59,12 +59,9 @@ rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role) > struct rte_config *cfg = rte_eal_get_configuration(); > > if (lcore_id >= RTE_MAX_LCORE) > - return -EINVAL; > - > - if (cfg->lcore_role[lcore_id] == role) > return 0; > > - return -EINVAL; > + return cfg->lcore_role[lcore_id] == role; > } > > int eal_cpuset_socket_id(rte_cpuset_t *cpusetp) > diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h > index c89e6ba..fba04f1 100644 > --- a/lib/librte_eal/common/include/rte_lcore.h > +++ b/lib/librte_eal/common/include/rte_lcore.h > @@ -271,7 +271,7 @@ int rte_thread_setname(pthread_t id, const char *name); > * @param role > * The role to be checked against. > * @return > - * On success, return 0; otherwise return a negative value. > + * True if the given core has the specified role; false otherwise. > */ > int > rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role); > -- > 2.6.4 > LGTM. Acked-by: Pavan Nikhilesh