From patchwork Wed Jan 3 18:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Carrillo, Erik G" X-Patchwork-Id: 32859 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3CA9E1B223; Wed, 3 Jan 2018 19:43:53 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2A2FC1B212 for ; Wed, 3 Jan 2018 19:43:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 10:43:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,503,1508828400"; d="scan'208";a="16546034" Received: from txasoft-yocto.an.intel.com (HELO txasoft-yocto.an.intel.com.) ([10.123.72.111]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jan 2018 10:43:49 -0800 From: Erik Gabriel Carrillo To: pbhagavatula@caviumnetworks.com, harry.van.haaren@intel.com Cc: dev@dpdk.org Date: Wed, 3 Jan 2018 12:43:35 -0600 Message-Id: <1515005015-31990-2-git-send-email-erik.g.carrillo@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1515005015-31990-1-git-send-email-erik.g.carrillo@intel.com> References: <1515005015-31990-1-git-send-email-erik.g.carrillo@intel.com> Subject: [dpdk-dev] [PATCH 1/1] eal: return true or false from lcore role check function 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Pavan Nikhilesh --- 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);