DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Pallavi Kadam <pallavi.kadam@intel.com>
Cc: dpdk-dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	Harini.Ramakrishnan@microsoft.com,  "Wiles,
	Keith" <keith.wiles@intel.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	 "Menon, Ranjit" <ranjit.menon@intel.com>,
	 "Kolar, Antara Ganesh" <antara.ganesh.kolar@intel.com>
Subject: Re: [dpdk-dev] [PATCH] eal: move rte_cpu definitions to os specific files
Date: Tue, 1 Oct 2019 09:29:33 +0530	[thread overview]
Message-ID: <CALBAE1OzMuSrXPouMEZk5ExJB-fykXvzS-R-0R69mK6ZAQOakw@mail.gmail.com> (raw)
In-Reply-To: <20190930170934.9680-1-pallavi.kadam@intel.com>

On Mon, Sep 30, 2019 at 11:04 PM Pallavi Kadam <pallavi.kadam@intel.com> wrote:
>
> 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 <pallavi.kadam@intel.com>
> Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>

Nit:

[master][dpdk.org] $ ./devtools/check-git-log.sh
Wrong headline format:
        eal: move rte_cpu definitions to os specific files

probably, we could fix the above warning with following or similar headline

eal: move OS-specific CPU operations from common code

With check-git-log.sh fix:

Reviewed-by: Jerin Jacob <jerinj@marvell.com>



> ---
>  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 <pthread_np.h>
> -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 <rte_per_lcore.h>
> +#include <pthread_np.h>
> +
> +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 <rte_per_lcore.h>
> +
> +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
>

  reply	other threads:[~2019-10-01  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 17:09 Pallavi Kadam
2019-10-01  3:59 ` Jerin Jacob [this message]
2019-10-26 14:58 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBAE1OzMuSrXPouMEZk5ExJB-fykXvzS-R-0R69mK6ZAQOakw@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=Harini.Ramakrishnan@microsoft.com \
    --cc=antara.ganesh.kolar@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=pallavi.kadam@intel.com \
    --cc=ranjit.menon@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).