From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F0AD1A2EDB for ; Mon, 30 Sep 2019 19:34:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 777AD1BEA5; Mon, 30 Sep 2019 19:34:53 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8769B1BE90 for ; Mon, 30 Sep 2019 19:34:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Sep 2019 10:34:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,568,1559545200"; d="scan'208";a="194257602" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.58]) by orsmga003.jf.intel.com with ESMTP; 30 Sep 2019 10:34:48 -0700 From: Pallavi Kadam To: dev@dpdk.org, thomas@monjalon.net Cc: jerinjacobk@gmail.com, Harini.Ramakrishnan@microsoft.com, keith.wiles@intel.com, bruce.richardson@intel.com, ranjit.menon@intel.com, antara.ganesh.kolar@intel.com, pallavi.kadam@intel.com Date: Mon, 30 Sep 2019 10:09:34 -0700 Message-Id: <20190930170934.9680-1-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [dpdk-dev] [PATCH] eal: move rte_cpu definitions to os specific files 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" Moving RTE_CPU* definitions from the common code to the Linux, FreeBSD rte_os.h file to avoid #ifdef clutter. Signed-off-by: Pallavi Kadam Signed-off-by: Antara Ganesh Kolar Reviewed-by: Ranjit Menon --- lib/librte_eal/common/include/rte_lcore.h | 44 --------------------- lib/librte_eal/freebsd/eal/include/rte_os.h | 27 +++++++++++++ lib/librte_eal/linux/eal/include/rte_os.h | 19 +++++++++ 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index c86f72eb1..63ad4af13 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -22,50 +22,6 @@ extern "C" { #define LCORE_ID_ANY UINT32_MAX /**< Any lcore. */ -#if defined(__linux__) -typedef cpu_set_t rte_cpuset_t; -#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) -#define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) -#define RTE_CPU_FILL(set) do \ -{ \ - unsigned int i; \ - CPU_ZERO(set); \ - for (i = 0; i < CPU_SETSIZE; i++) \ - CPU_SET(i, set); \ -} while (0) -#define RTE_CPU_NOT(dst, src) do \ -{ \ - cpu_set_t tmp; \ - RTE_CPU_FILL(&tmp); \ - CPU_XOR(dst, &tmp, src); \ -} while (0) -#elif defined(__FreeBSD__) -#include -typedef cpuset_t rte_cpuset_t; -#define RTE_CPU_AND(dst, src1, src2) do \ -{ \ - cpuset_t tmp; \ - CPU_COPY(src1, &tmp); \ - CPU_AND(&tmp, src2); \ - CPU_COPY(&tmp, dst); \ -} while (0) -#define RTE_CPU_OR(dst, src1, src2) do \ -{ \ - cpuset_t tmp; \ - CPU_COPY(src1, &tmp); \ - CPU_OR(&tmp, src2); \ - CPU_COPY(&tmp, dst); \ -} while (0) -#define RTE_CPU_FILL(set) CPU_FILL(set) -#define RTE_CPU_NOT(dst, src) do \ -{ \ - cpuset_t tmp; \ - CPU_FILL(&tmp); \ - CPU_NAND(&tmp, src); \ - CPU_COPY(&tmp, dst); \ -} while (0) -#endif - /** * Structure storing internal configuration (per-lcore) */ diff --git a/lib/librte_eal/freebsd/eal/include/rte_os.h b/lib/librte_eal/freebsd/eal/include/rte_os.h index 49cd4d4d9..b414f6989 100644 --- a/lib/librte_eal/freebsd/eal/include/rte_os.h +++ b/lib/librte_eal/freebsd/eal/include/rte_os.h @@ -11,4 +11,31 @@ * freebsd OS. Functions will be added in future releases. */ +#include +#include + +typedef cpuset_t rte_cpuset_t; +#define RTE_CPU_AND(dst, src1, src2) do \ +{ \ + cpuset_t tmp; \ + CPU_COPY(src1, &tmp); \ + CPU_AND(&tmp, src2); \ + CPU_COPY(&tmp, dst); \ +} while (0) +#define RTE_CPU_OR(dst, src1, src2) do \ +{ \ + cpuset_t tmp; \ + CPU_COPY(src1, &tmp); \ + CPU_OR(&tmp, src2); \ + CPU_COPY(&tmp, dst); \ +} while (0) +#define RTE_CPU_FILL(set) CPU_FILL(set) +#define RTE_CPU_NOT(dst, src) do \ +{ \ + cpuset_t tmp; \ + CPU_FILL(&tmp); \ + CPU_NAND(&tmp, src); \ + CPU_COPY(&tmp, dst); \ +} while (0) + #endif /* _RTE_OS_H_ */ diff --git a/lib/librte_eal/linux/eal/include/rte_os.h b/lib/librte_eal/linux/eal/include/rte_os.h index bc6ad14d2..dd487a830 100644 --- a/lib/librte_eal/linux/eal/include/rte_os.h +++ b/lib/librte_eal/linux/eal/include/rte_os.h @@ -11,4 +11,23 @@ * linux OS. Functions will be added in future releases. */ +#include + +typedef cpu_set_t rte_cpuset_t; +#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) +#define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) +#define RTE_CPU_FILL(set) do \ +{ \ + unsigned int i; \ + CPU_ZERO(set); \ + for (i = 0; i < CPU_SETSIZE; i++) \ + CPU_SET(i, set); \ +} while (0) +#define RTE_CPU_NOT(dst, src) do \ +{ \ + cpu_set_t tmp; \ + RTE_CPU_FILL(&tmp); \ + CPU_XOR(dst, &tmp, src); \ +} while (0) + #endif /* _RTE_OS_H_ */ -- 2.18.0.windows.1