DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Fady Bader <fady@mellanox.com>
Cc: dpdk-dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
	tbashar@mellanox.com,  Tal Shnaiderman <talshn@mellanox.com>,
	yohadt@mellanox.com,  Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	 Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>,
	Omar Cardona <ocardona@microsoft.com>,
	 Anand Rawat <anand.rawat@intel.com>,
	"Menon, Ranjit" <ranjit.menon@intel.com>,
	 Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] net: add htons to minGW for Windows
Date: Wed, 10 Jun 2020 18:03:54 +0530
Message-ID: <CALBAE1MU1jH65R+Nk-G21DGzMV7RL56dHnWe=Amz_jYPZk2ueA@mail.gmail.com> (raw)
In-Reply-To: <20200610120040.17968-3-fady@mellanox.com>

On Wed, Jun 10, 2020 at 5:31 PM Fady Bader <fady@mellanox.com> wrote:
>
> htons wasnt defined in Windows for the minGW compiler.
> Definition of htons was added in order to use htons.
>
> Signed-off-by: Fady Bader <fady@mellanox.com>
> ---
>  lib/librte_eal/windows/include/rte_os.h | 4 ++++
>  lib/librte_net/rte_arp.c                | 2 ++
>  2 files changed, 6 insertions(+)
>
> diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h
> index bab011a5c..95525123f 100644
> --- a/lib/librte_eal/windows/include/rte_os.h
> +++ b/lib/librte_eal/windows/include/rte_os.h
> @@ -28,6 +28,10 @@ extern "C" {
>
>  #define strerror_r(a, b, c) strerror_s(b, c, a)
>
> +#ifdef RTE_TOOLCHAIN_GCC
> +#define htons(x) (rte_cpu_to_be_16(x))
> +#endif
> +
>  /* strdup is deprecated in Microsoft libc and _strdup is preferred */
>  #define strdup(str) _strdup(str)
>
> diff --git a/lib/librte_net/rte_arp.c b/lib/librte_net/rte_arp.c
> index 784b7f48f..8fd431c54 100644
> --- a/lib/librte_net/rte_arp.c
> +++ b/lib/librte_net/rte_arp.c
> @@ -2,7 +2,9 @@
>   * Copyright(c) 2018 Intel Corporation
>   */
>
> +#ifndef RTE_EXEC_ENV_WINDOWS
>  #include <arpa/inet.h>
> +#endif

I think, replacing  htons() with rte_cpu_to_be_16() in rte_arp.c will
the clean solution to avoid #ifndef.


>
>  #include <rte_arp.h>
>
> --
> 2.16.1.windows.4
>

  reply	other threads:[~2020-06-10 12:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <'20200610112326.18576-1-fady@mellanox.com'>
2020-06-10 12:00 ` [dpdk-dev] [PATCH v2 0/3] compile librte_net for windows Fady Bader
2020-06-10 12:00   ` [dpdk-dev] [PATCH v2 1/3] net: fix s_addr redefinition in Windows Fady Bader
2020-06-10 12:00   ` [dpdk-dev] [PATCH v2 2/3] net: add htons to minGW for Windows Fady Bader
2020-06-10 12:33     ` Jerin Jacob [this message]
2020-06-10 12:00   ` [dpdk-dev] [PATCH v2 3/3] eal/windows: librte_net build on Windows Fady Bader
2020-06-16  9:04     ` Thomas Monjalon
2020-07-06  8:44       ` Fady Bader
2020-06-20 19:22     ` Dmitry Kozlyuk
2020-06-28  9:48       ` Fady Bader
2020-07-17 22:22         ` Narcisa Ana Maria Vasile
2020-07-20 12:54           ` Fady Bader
2020-07-20 16:26             ` Dmitry Kozlyuk
2020-07-22 10:20               ` Fady Bader
2020-07-22 10:30                 ` Bruce Richardson
2020-07-27  8:54                   ` Fady Bader
2020-07-27  8:53                 ` Fady Bader
2020-07-08  8:25   ` [dpdk-dev] [PATCH v3 0/3] compile librte_net for windows Fady Bader
2020-07-08  8:25     ` [dpdk-dev] [PATCH v3 1/3] net: fix s_addr redefinition in Windows Fady Bader
2020-07-13 14:38       ` Olivier Matz
2020-07-15  6:26         ` Fady Bader
2020-07-08  8:25     ` [dpdk-dev] [PATCH v3 2/3] net: replace htons with rte_cpu_to_be_16 Fady Bader
2020-07-09 13:39       ` Morten Brørup
2020-07-13 14:38       ` Olivier Matz
2020-07-15  6:04         ` Fady Bader
2020-07-08  8:25     ` [dpdk-dev] [PATCH v3 3/3] eal/windows: librte_net build on Windows Fady Bader
2020-07-08  9:10       ` Thomas Monjalon
2020-07-08 10:19         ` Fady Bader
2020-07-23  7:08   ` [dpdk-dev] [PATCH v4 0/3] compile librte_net for windows Fady Bader
2020-07-23  7:08     ` [dpdk-dev] [PATCH v4 1/3] net: fix s_addr redefinition in Windows Fady Bader
2020-07-23  7:08     ` [dpdk-dev] [PATCH v4 2/3] net: replace htons with RTE_BE16 Fady Bader
2020-07-23  7:08     ` [dpdk-dev] [PATCH v4 3/3] eal/windows: librte_net build on Windows Fady Bader
2020-09-08  8:14       ` Ophir Munk
2020-07-24  1:11     ` [dpdk-dev] [PATCH v4 0/3] compile librte_net for windows Ranjit Menon
2020-09-10 19:55       ` Thomas Monjalon
2020-07-24 15:52     ` Kadam, Pallavi

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='CALBAE1MU1jH65R+Nk-G21DGzMV7RL56dHnWe=Amz_jYPZk2ueA@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=anand.rawat@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=fady@mellanox.com \
    --cc=harini.ramakrishnan@microsoft.com \
    --cc=ocardona@microsoft.com \
    --cc=olivier.matz@6wind.com \
    --cc=ranjit.menon@intel.com \
    --cc=talshn@mellanox.com \
    --cc=tbashar@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=yohadt@mellanox.com \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git