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 C4A7AA32A8 for ; Sat, 26 Oct 2019 16:59:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C1BA1BF67; Sat, 26 Oct 2019 16:59:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 5A3D81BF60 for ; Sat, 26 Oct 2019 16:59:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572101947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/znLoQ1e6IPp/Tx4DAEh5Ej3M5rELiq0enzGlBYwXMw=; b=JkwP3Uv76/qIyTOYq4tZy7eJdQ671InFRUgB/1g60skd2aZJUPLQNVxd6uL2eS8PW8ZC2L y8XjAexcItgv3agzOd9CFmJe3ojnRYIT9TEu9tR/+pyD/mDsUdxAbTmKsYIhY+ETNFsBEU SeEbZLjIX+p/a1cVSjcawdr68gYZHHg= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-wY0d0VuHNwqJyg7VjlfcdQ-1; Sat, 26 Oct 2019 10:59:06 -0400 Received: by mail-vk1-f198.google.com with SMTP id r128so2322889vke.17 for ; Sat, 26 Oct 2019 07:59:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1kg5BYfu3a4mRJ6ZU00bj5C5LIL1Qrpa0svr+wcrN1g=; b=iLXhPImXOLwtrksDlvV5bA/6Ud6LQkcbeTK03XGH7AwCreZAUNAG6AjgtfXMjKN2k7 htKnvKTGQeCFrw5XcimrCzeoKL6pctYrdB74Qt4CeQ4Ow6OGWtPiOljfgndDXuxF4X+Q srbOPYDm03IbZYdmBgkA/6jCmjuIkj23e+jkHBWTLiaGLjDLs3cHI1sFXtegaA3uv85K Bqbvid1yS4WEtwFeMwuV6tswgDJPCElqRDHvPbE0w+2PUHlpcvqDgpwwEyaAJcZUvJqo eWNlg7ansEkkDY2Eg4BvM9LeqcNRBV47lOK4fYgnA+Wlw9pW16zxTnOY/5Z+R2WAI/9x vP5A== X-Gm-Message-State: APjAAAUd7h0Pg7Ouh45SAH5o2qv2xg/szx2obCRm+zPISuIBgFgwxmXB phTAkHHhRMJiPcbc587jtbNgK5t9sy3Xz1iY8r8dp+H7+tNQfG0XG5JkO43b1W2V8JmLbqeHNtV mUyZKWVbVSxWDT5rP7vw= X-Received: by 2002:a67:7d95:: with SMTP id y143mr4996083vsc.39.1572101945700; Sat, 26 Oct 2019 07:59:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+9bM0jkqMhnfkkQiRTJxWNcLWsbuqqg3QzytuDsx9AZWBwjzt04Pgb8AxRVO5gqN7RgVkfew+lbWimE5ErPk= X-Received: by 2002:a67:7d95:: with SMTP id y143mr4996077vsc.39.1572101945427; Sat, 26 Oct 2019 07:59:05 -0700 (PDT) MIME-Version: 1.0 References: <20190930170934.9680-1-pallavi.kadam@intel.com> In-Reply-To: <20190930170934.9680-1-pallavi.kadam@intel.com> From: David Marchand Date: Sat, 26 Oct 2019 16:58:54 +0200 Message-ID: To: Pallavi Kadam Cc: dev , Thomas Monjalon , Jerin Jacob , Harini.Ramakrishnan@microsoft.com, "Wiles, Keith" , Bruce Richardson , ranjit.menon@intel.com, antara.ganesh.kolar@intel.com X-MC-Unique: wY0d0VuHNwqJyg7VjlfcdQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [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" On Mon, Sep 30, 2019 at 7:35 PM Pallavi Kadam wro= te: > > 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 Took into account Jerin suggestion for title. Reviewed-by: Jerin Jacob > --- > 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/c= ommon/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 =3D 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 Including pthread_np.h is enough. > + > +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/l= inux/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 cpu_set_t and the CPU macros come from sched.h. No need for rte_per_lcore.h. > + > +typedef cpu_set_t rte_cpuset_t; Fixed indent. > +#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 =3D 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 > Applied, thanks. -- David Marchand