DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: dev@dpdk.org, Tyler Retzlaff <roretzla@linux.microsoft.com>,
	Jie Zhou <jizh@linux.microsoft.com>,
	Nick Connolly <nick.connolly@mayadata.io>,
	Beilei Xing <beilei.xing@intel.com>, Jeff Guo <jia.guo@intel.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH v8 4/4] net: provide IP-related API on any OS
Date: Thu, 8 Apr 2021 13:45:41 +0200	[thread overview]
Message-ID: <20210408114541.GV1650@platinum> (raw)
In-Reply-To: <20210407222249.6729-5-dmitry.kozliuk@gmail.com>

Hi Dmitry,

On Thu, Apr 08, 2021 at 01:22:49AM +0300, Dmitry Kozlyuk wrote:
> Users of <rte_ip.h> relied on it to provide IP-related defines,
> like IPPROTO_* constants, but still had to include POSIX headers
> for inet_pton() and other standard IP-related facilities.
> 
> Extend <rte_ip.h> so that it is a single header to gain access
> to IP-related facilities on any OS. Use it to replace POSIX includes
> in components enabled on Windows. Move missing constants from Windows
> networking shim to OS shim header and include it where needed.
> 
> Remove Windows networking shim that is no longer needed.
> 
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> ---
>  drivers/net/i40e/i40e_fdir.c                 |  1 +
>  drivers/net/mlx5/mlx5.h                      |  1 -
>  drivers/net/mlx5/mlx5_flow.c                 |  4 +--
>  drivers/net/mlx5/mlx5_flow.h                 |  3 +-
>  drivers/net/mlx5/mlx5_mac.c                  |  1 -
>  examples/cmdline/commands.c                  |  5 ---
>  examples/cmdline/parse_obj_list.c            |  2 --
>  lib/librte_cmdline/cmdline.c                 |  1 -
>  lib/librte_cmdline/cmdline_parse.c           |  2 --
>  lib/librte_cmdline/cmdline_parse_etheraddr.c |  6 ----
>  lib/librte_cmdline/cmdline_parse_ipaddr.c    |  6 ----
>  lib/librte_cmdline/cmdline_parse_ipaddr.h    |  2 +-
>  lib/librte_eal/windows/include/arpa/inet.h   | 30 ----------------
>  lib/librte_eal/windows/include/netinet/in.h  | 38 --------------------
>  lib/librte_eal/windows/include/netinet/ip.h  | 10 ------
>  lib/librte_eal/windows/include/rte_os_shim.h |  8 +++++
>  lib/librte_eal/windows/include/sys/socket.h  | 24 -------------
>  lib/librte_ethdev/rte_ethdev.c               | 12 +++----
>  lib/librte_ethdev/rte_ethdev_core.h          |  1 -
>  lib/librte_net/rte_ip.h                      |  7 ++++
>  lib/librte_net/rte_net.c                     |  1 +
>  21 files changed, 24 insertions(+), 141 deletions(-)
>  delete mode 100644 lib/librte_eal/windows/include/arpa/inet.h
>  delete mode 100644 lib/librte_eal/windows/include/netinet/in.h
>  delete mode 100644 lib/librte_eal/windows/include/netinet/ip.h
>  delete mode 100644 lib/librte_eal/windows/include/sys/socket.h

I see it has already been discussed for posix functions like close() or
strdup(), so I won't reopen the door too long ;)

Since DPDK is a network-oriented project, it provides network defines or
structure, prefixed with rte_. This API is on some aspects more complete
than the one provided in libc (for instance, more protocol headers are
available) . So, to me, it would make sense to define RTE_IPPROTO_* and
replace usages of IPPROTO_*, and avoid inclusions of network libc
headers in DPDK code.

This can be done later, if there is a consensus.

> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> index c572d003cb..e7361bf520 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -22,6 +22,7 @@
>  #include <rte_sctp.h>
>  #include <rte_hash_crc.h>
>  #include <rte_bitmap.h>
> +#include <rte_os_shim.h>
>  

If I understand the logic, rte_ip.h provides OS-specific IP-related
stuff (like IPPROTO_*), and rte_os_shim.h provides the POSIX definitions
that are missing after including rte_ip.h.

Would it make sense to include rte_os_shim.h from rte_ip.h, so that
including rte_ip.h is always sufficient? Or is it because we want to
avoid implicit inclusion of rte_os_shim.h?

Thanks,
Olivier

  reply	other threads:[~2021-04-08 11:45 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 23:29 [dpdk-dev] [PATCH 0/7] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 1/7] eal: add wrappers for POSIX string functions Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 2/7] eal: add macro for maximum path length Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 3/7] eal: add sleep API Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 4/7] eal: add asprintf() internal wrapper Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 5/7] lib: remove POSIX dependencies Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 6/7] drivers: " Dmitry Kozlyuk
2021-02-20 23:29 ` [dpdk-dev] [PATCH 7/7] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-02-21  1:28 ` [dpdk-dev] [PATCH v2 0/7] " Dmitry Kozlyuk
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 1/7] eal: add wrappers for POSIX string functions Dmitry Kozlyuk
2021-02-22 11:47     ` Bruce Richardson
2021-02-22 12:48       ` Nick Connolly
2021-02-22 14:26         ` Bruce Richardson
2021-02-22 18:21           ` Nick Connolly
2021-02-22 22:57           ` Dmitry Kozlyuk
2021-02-23  9:45             ` Bruce Richardson
2021-02-27 20:23               ` Dmitry Kozlyuk
2021-03-01 21:31                 ` Nick Connolly
2021-03-02  0:22                   ` Dmitry Kozlyuk
2021-03-02 11:27                     ` Nick Connolly
2021-03-16  9:51                 ` Thomas Monjalon
2021-02-22 18:07         ` Tyler Retzlaff
2021-02-22 18:36           ` Nick Connolly
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 2/7] eal: add macro for maximum path length Dmitry Kozlyuk
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 3/7] eal: add sleep API Dmitry Kozlyuk
2021-02-21  8:58     ` Tal Shnaiderman
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 4/7] eal: add asprintf() internal wrapper Dmitry Kozlyuk
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 5/7] lib: remove POSIX dependencies Dmitry Kozlyuk
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 6/7] drivers: " Dmitry Kozlyuk
2021-02-21  8:59     ` Tal Shnaiderman
2021-02-21 15:54       ` Andrew Rybchenko
2021-02-21 17:05         ` Dmitry Kozlyuk
2021-02-21  1:28   ` [dpdk-dev] [PATCH v2 7/7] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-02-21  8:59     ` Tal Shnaiderman
2021-02-21 10:24       ` Dmitry Kozlyuk
2021-02-21 11:58         ` Tal Shnaiderman
2021-02-21 14:33           ` Dmitry Kozlyuk
2021-02-21 14:28   ` [dpdk-dev] [PATCH v3 0/7] " Dmitry Kozlyuk
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 1/7] eal: add wrappers for POSIX string functions Dmitry Kozlyuk
2021-02-23  7:11       ` Andrew Rybchenko
2021-02-23 21:53         ` Nick Connolly
2021-02-24  7:21           ` Andrew Rybchenko
2021-03-04  6:47       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 2/7] eal: add macro for maximum path length Dmitry Kozlyuk
2021-03-04  6:47       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 3/7] eal: add sleep API Dmitry Kozlyuk
2021-02-23 22:06       ` Nick Connolly
2021-03-04  6:47       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 4/7] eal: add asprintf() internal wrapper Dmitry Kozlyuk
2021-03-04  6:48       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 5/7] lib: remove POSIX dependencies Dmitry Kozlyuk
2021-03-04  6:48       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 6/7] drivers: " Dmitry Kozlyuk
2021-03-04  6:49       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-02-21 14:28     ` [dpdk-dev] [PATCH v3 7/7] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-03-04  6:49       ` [dpdk-dev] [EXTERNAL] " Khoa To
2021-03-04  6:46     ` [dpdk-dev] [EXTERNAL] [PATCH v3 0/7] " Khoa To
2021-03-06  0:04     ` [dpdk-dev] [PATCH v4 0/4] " Dmitry Kozlyuk
2021-03-06  0:04       ` [dpdk-dev] [PATCH v4 1/4] eal: add sleep API Dmitry Kozlyuk
2021-03-06  0:04       ` [dpdk-dev] [PATCH v4 2/4] eal: add asprintf() internal wrapper Dmitry Kozlyuk
2021-03-06 15:27         ` Lance Richardson
2021-03-06  0:04       ` [dpdk-dev] [PATCH v4 3/4] build: indicate usage at build time for public headers Dmitry Kozlyuk
2021-03-16  9:59         ` Thomas Monjalon
2021-03-06  0:05       ` [dpdk-dev] [PATCH v4 4/4] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-03-17 19:23       ` [dpdk-dev] [PATCH v4 0/4] " Ranjit Menon
2021-03-20 11:27       ` [dpdk-dev] [PATCH v5 0/5] " Dmitry Kozlyuk
2021-03-20 11:27         ` [dpdk-dev] [PATCH v5 1/5] eal: add sleep API Dmitry Kozlyuk
2021-03-22  8:57           ` Kinsella, Ray
2021-03-20 11:27         ` [dpdk-dev] [PATCH v5 2/5] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-03-20 11:27         ` [dpdk-dev] [PATCH v5 3/5] eal: make OS shims internal Dmitry Kozlyuk
2021-03-20 11:27         ` [dpdk-dev] [PATCH v5 4/5] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-03-20 11:27         ` [dpdk-dev] [PATCH v5 5/5] net: replace Windows networking shim Dmitry Kozlyuk
2021-03-20 13:05         ` [dpdk-dev] [PATCH v6 0/5] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-03-20 13:05           ` [dpdk-dev] [PATCH v6 1/5] eal: add sleep API Dmitry Kozlyuk
2021-03-20 13:05           ` [dpdk-dev] [PATCH v6 2/5] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-03-26  9:04             ` Thomas Monjalon
2021-03-20 13:05           ` [dpdk-dev] [PATCH v6 3/5] eal: make OS shims internal Dmitry Kozlyuk
2021-03-26  9:12             ` Thomas Monjalon
2021-03-31 21:05               ` Nick Connolly
2021-03-31 21:19                 ` Thomas Monjalon
2021-03-31 21:45                   ` Nick Connolly
2021-03-31 21:55                     ` Thomas Monjalon
2021-04-01 23:10                       ` Dmitry Kozlyuk
2021-04-01 23:18                         ` Thomas Monjalon
2021-03-20 13:05           ` [dpdk-dev] [PATCH v6 4/5] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-03-26  9:22             ` Thomas Monjalon
2021-03-20 13:05           ` [dpdk-dev] [PATCH v6 5/5] net: replace Windows networking shim Dmitry Kozlyuk
2021-03-26  9:28             ` Thomas Monjalon
2021-04-01 23:03               ` Dmitry Kozlyuk
2021-04-03 23:41           ` [dpdk-dev] [PATCH v7 0/5] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-04-03 23:41             ` [dpdk-dev] [PATCH v7 1/5] eal: add sleep API Dmitry Kozlyuk
2021-04-06 14:34               ` Morten Brørup
2021-04-06 23:29                 ` Dmitry Kozlyuk
2021-04-07  7:31                   ` Morten Brørup
2021-04-29 17:09                     ` Tyler Retzlaff
2021-04-03 23:41             ` [dpdk-dev] [PATCH v7 2/5] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-04-10  7:05               ` Nick Connolly
2021-04-03 23:41             ` [dpdk-dev] [PATCH v7 3/5] eal: make OS shims internal Dmitry Kozlyuk
2021-04-03 23:41             ` [dpdk-dev] [PATCH v7 4/5] net: work around s_addr macro on Windows Dmitry Kozlyuk
2021-04-03 23:41             ` [dpdk-dev] [PATCH v7 5/5] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-04-07 22:22             ` [dpdk-dev] [PATCH v8 0/4] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-04-07 22:22               ` [dpdk-dev] [PATCH v8 1/4] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-04-07 22:22               ` [dpdk-dev] [PATCH v8 2/4] eal: make OS shims internal Dmitry Kozlyuk
2021-04-07 22:22               ` [dpdk-dev] [PATCH v8 3/4] net: work around s_addr macro on Windows Dmitry Kozlyuk
2021-04-08 11:26                 ` Olivier Matz
2021-04-07 22:22               ` [dpdk-dev] [PATCH v8 4/4] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-04-08 11:45                 ` Olivier Matz [this message]
2021-04-08 19:51                   ` Dmitry Kozlyuk
2021-04-09 13:33                     ` Olivier Matz
2021-04-14 21:47                   ` Thomas Monjalon
2021-04-10 22:47               ` [dpdk-dev] [PATCH v9 0/4] eal/windows: do not expose POSIX symbols Dmitry Kozlyuk
2021-04-10 22:47                 ` [dpdk-dev] [PATCH v9 1/4] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-04-10 22:47                 ` [dpdk-dev] [PATCH v9 2/4] eal: make OS shims internal Dmitry Kozlyuk
2021-04-14 21:33                   ` Thomas Monjalon
2021-04-10 22:47                 ` [dpdk-dev] [PATCH v9 3/4] net: work around s_addr macro on Windows Dmitry Kozlyuk
2021-04-10 22:47                 ` [dpdk-dev] [PATCH v9 4/4] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-04-13  4:46                 ` [dpdk-dev] [PATCH v9 0/4] eal/windows: do not expose POSIX symbols Ranjit Menon
2021-04-13  7:00                   ` Dmitry Kozlyuk
2021-04-14 21:12                     ` Thomas Monjalon
2021-04-14 21:34                       ` Ranjit Menon
2021-04-14 21:42                         ` Thomas Monjalon
2021-04-14 21:47                           ` Ranjit Menon
2021-04-14 22:08                             ` Dmitry Kozlyuk
2021-04-14 22:58                               ` Thomas Monjalon
2021-04-14 22:06                 ` [dpdk-dev] [PATCH v10 " Dmitry Kozlyuk
2021-04-14 22:06                   ` [dpdk-dev] [PATCH v10 1/4] eal/windows: hide asprintf() shim Dmitry Kozlyuk
2021-04-14 22:06                   ` [dpdk-dev] [PATCH v10 2/4] eal: make OS shims internal Dmitry Kozlyuk
2021-04-14 22:06                   ` [dpdk-dev] [PATCH v10 3/4] net: work around s_addr macro on Windows Dmitry Kozlyuk
2021-04-14 22:06                   ` [dpdk-dev] [PATCH v10 4/4] net: provide IP-related API on any OS Dmitry Kozlyuk
2021-04-14 22:50                   ` [dpdk-dev] [PATCH v10 0/4] eal/windows: do not expose POSIX symbols Ranjit Menon
2021-04-14 23:57                     ` Thomas Monjalon
2021-03-17 19:19 ` [dpdk-dev] [PATCH 0/7] " Ranjit Menon

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=20210408114541.GV1650@platinum \
    --to=olivier.matz@6wind.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=ferruh.yigit@intel.com \
    --cc=jia.guo@intel.com \
    --cc=jizh@linux.microsoft.com \
    --cc=matan@nvidia.com \
    --cc=navasile@linux.microsoft.com \
    --cc=nick.connolly@mayadata.io \
    --cc=pallavi.kadam@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.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
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).