[dpdk-dev] [PATCH v2 5/9] eal: add additional function overrides in windows header files

Jerin Jacob jerinjacobk at gmail.com
Fri Sep 27 10:06:43 CEST 2019


On Fri, Sep 27, 2019 at 2:25 AM Pallavi Kadam <pallavi.kadam at intel.com> wrote:
>
> Adding additional function definitions for pthread, cpuset
> implementation, asprintf implementation, in order to support
> common code.
>
> Signed-off-by: Pallavi Kadam <pallavi.kadam at intel.com>
> Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar at intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon at intel.com>
> Reviewed-by: Keith Wiles <keith.wiles at intel.com>
> ---
>  lib/librte_eal/common/include/rte_lcore.h     |  5 ++
>  lib/librte_eal/windows/eal/include/pthread.h  | 66 +++++++++++++++++++
>  lib/librte_eal/windows/eal/include/rte_os.h   | 28 ++++++++
>  lib/librte_eal/windows/eal/include/sched.h    | 58 ++++++++++++++--
>  .../windows/eal/include/sys/queue.h           |  8 +++
>  5 files changed, 159 insertions(+), 6 deletions(-)
>
> diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
> index c86f72eb1..d5e7e3e33 100644
> --- a/lib/librte_eal/common/include/rte_lcore.h
> +++ b/lib/librte_eal/common/include/rte_lcore.h
> @@ -64,6 +64,11 @@ typedef cpuset_t rte_cpuset_t;
>         CPU_NAND(&tmp, src); \
>         CPU_COPY(&tmp, dst); \
>  } while (0)
> +#elif defined(_WIN64)
> +#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) CPU_FILL(set)
> +#define RTE_CPU_NOT(dst, src) CPU_NOT(dst, src)

RTE_CPU* definitions are OS-specific. Instead of adding new #elif and
make the common
code less readable. Please create eal abstraction for the same and
move Linux, FreeBSD, Windows to the specific
directory to avoid #ifdef clutter in lib/librte_eal/common/include/rte_lcore.h.

>  #endif
>


More information about the dev mailing list