Message ID | 20210410224732.20234-1-dmitry.kozliuk@gmail.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23299A0547; Sun, 11 Apr 2021 00:47:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D94A4014E; Sun, 11 Apr 2021 00:47:41 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 1C6F04003D for <dev@dpdk.org>; Sun, 11 Apr 2021 00:47:41 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id n8so15411983lfh.1 for <dev@dpdk.org>; Sat, 10 Apr 2021 15:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bQjrlMQOlSIkeMuFJtJgVIgaCJy67rpBgWJ9OLam0QI=; b=HIq61FiJJdYWYvqLwNOvrgnbUxpiucwieceGkAr73Fnne87r3maCNZFXXppqQnEon8 gKJQxzCgCrJdxxBVtkIv4rR0nqOWPktTI8F8GDGlqZaySIu5kH8ADC/jtVvFcuGKZjis Cw5b1Tc5GrXee0L+aJVFdKP2Qsb77dl02KCok63rUkt8z5e3gea+qfqCn5K66WZ3RrBy LLRcooBPFaFtqV7kaBvndhhIXqT6G4h06EE4sgfSmsNddQjhwFVAQDZPmQy1SKQiFaEE FAM5trC9QQIXQ752HgugS5mRKo2Z/0EfxRuznxmcZ88DCO6MAhRu3PiiPv2TQfIq0SlD SOxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bQjrlMQOlSIkeMuFJtJgVIgaCJy67rpBgWJ9OLam0QI=; b=BH/xqes2y8vawCnpZnvarL41GJ//emrK1vcL2qShj+sEOM93yYqxbUHpqoajrgVCtC ZQvAf3P/YRcv+3dCjnS0tEmWvj3eLzIjQ2AdddqF25dBCvk6JptUUj7LZP9bwV5pLumF A8VrVxztjosWhthn8Fyjt8cijnVXavrBo1v24msro7riSyXiXxkz7Ph0P7MZqKQyYBTf WglqkNQ5yEdAOXaUr8/p+/rQ2yWDnZ0SeyEdN2/ictdBzr1JGH0Ra+GkDhvcz0cDeF9D 44LUDMZuc34am3c2CBD0DIbXlhuW9sU4bOBNpTDYj6U9+ErzORBU35WIflBkgBjls1VD l6Ug== X-Gm-Message-State: AOAM532WF79KdDyIGcm4Bbn+Agfy0PAj9lq3xSTHGFYP5df8bakFQ3wv 6gkRB6er+iHUvrw6RbkK6kMh+ipjEcuxFA== X-Google-Smtp-Source: ABdhPJzJTHTSXKWB2goMzRtpbUrfwuvs6Ouw7fKgT/J9rb/O0Q1pmioLmJOZwkk8wg/tAZoNOTJu5g== X-Received: by 2002:a05:6512:c02:: with SMTP id z2mr14607535lfu.595.1618094860277; Sat, 10 Apr 2021 15:47:40 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id o15sm370270lfu.155.2021.04.10.15.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 15:47:39 -0700 (PDT) From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> To: dev@dpdk.org Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Date: Sun, 11 Apr 2021 01:47:28 +0300 Message-Id: <20210410224732.20234-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210407222249.6729-1-dmitry.kozliuk@gmail.com> References: <20210407222249.6729-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v9 0/4] eal/windows: do not expose POSIX symbols X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
eal/windows: do not expose POSIX symbols
|
|
Message
Dmitry Kozlyuk
April 10, 2021, 10:47 p.m. UTC
On Windows, EAL contains two sets of functions and macros for POSIX compatibility: <rte_os.h> and a networking shim (socket headers). The latter conflicts with system headers and should not exist. Exposing the former from EAL can break consumer own POSIX compatibility layer and is against standards in general. Hide these symbols from external consumers, while keeping them available for DPDK code. v9: * Fix missing <rte_os_shim.h> include in rte_common_log.c. (This will happen again. Going to add a checkpatch test after this series is merged.) v8: * Drop rte_thread_sleep API, use rte_delay_us_sleep (Morten Brørup). Dmitry Kozlyuk (4): eal/windows: hide asprintf() shim eal: make OS shims internal net: work around s_addr macro on Windows net: provide IP-related API on any OS drivers/bus/pci/private.h | 4 +- drivers/bus/vdev/vdev_private.h | 2 + drivers/common/mlx5/mlx5_common.h | 1 + drivers/net/i40e/i40e_ethdev.c | 1 + 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 | 5 -- lib/librte_cmdline/cmdline_os_windows.c | 2 - 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_cmdline/cmdline_private.h | 1 + lib/librte_cmdline/cmdline_socket.c | 4 - lib/librte_eal/common/eal_common_config.c | 1 - lib/librte_eal/common/eal_common_errno.c | 4 + lib/librte_eal/common/eal_common_log.c | 1 + lib/librte_eal/common/eal_common_options.c | 2 +- lib/librte_eal/common/eal_common_timer.c | 4 +- lib/librte_eal/common/eal_internal_cfg.h | 1 + lib/librte_eal/common/eal_private.h | 11 +++ lib/librte_eal/freebsd/include/rte_os_shim.h | 14 +++ lib/librte_eal/linux/include/rte_os_shim.h | 14 +++ lib/librte_eal/windows/eal.c | 30 +++++++ lib/librte_eal/windows/eal_hugepages.c | 1 - lib/librte_eal/windows/eal_lcore.c | 1 - lib/librte_eal/windows/eal_memalloc.c | 1 - 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.h | 92 +------------------- lib/librte_eal/windows/include/rte_os_shim.h | 36 ++++++++ lib/librte_eal/windows/include/sys/socket.h | 24 ----- lib/librte_ethdev/ethdev_private.h | 2 + lib/librte_ethdev/rte_ethdev.c | 12 +-- lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_kvargs/rte_kvargs.c | 1 + lib/librte_net/rte_ether.h | 26 ++++-- lib/librte_net/rte_ip.h | 7 ++ lib/librte_net/rte_net.c | 1 + 45 files changed, 165 insertions(+), 253 deletions(-) create mode 100644 lib/librte_eal/freebsd/include/rte_os_shim.h create mode 100644 lib/librte_eal/linux/include/rte_os_shim.h 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 create mode 100644 lib/librte_eal/windows/include/rte_os_shim.h delete mode 100644 lib/librte_eal/windows/include/sys/socket.h
Comments
Hi Dmitry, On 4/10/2021 3:47 PM, Dmitry Kozlyuk wrote: > On Windows, EAL contains two sets of functions and macros for POSIX > compatibility: <rte_os.h> and a networking shim (socket headers). > The latter conflicts with system headers and should not exist. > Exposing the former from EAL can break consumer own POSIX compatibility > layer and is against standards in general. Hide these symbols from > external consumers, while keeping them available for DPDK code. > > v9: > * Fix missing <rte_os_shim.h> include in rte_common_log.c. > (This will happen again. Going to add a checkpatch test > after this series is merged.) > v8: > * Drop rte_thread_sleep API, use rte_delay_us_sleep (Morten Brørup). > > Dmitry Kozlyuk (4): > eal/windows: hide asprintf() shim > eal: make OS shims internal > net: work around s_addr macro on Windows > net: provide IP-related API on any OS > > <Snip> The change to remove the networking shim breaks l2fwd compilation on Windows, since l2fwd/main.c includes netinet/in.h explicitly. How do you propose we fix this, only for Windows? ranjit m.
Hi Ranjit, 2021-04-12 21:46 (UTC-0700), Ranjit Menon: [...] > The change to remove the networking shim breaks l2fwd compilation on > Windows, since l2fwd/main.c includes netinet/in.h explicitly. > > How do you propose we fix this, only for Windows? This include is redundant for this file on all platforms, it can be removed. Since -Dexamples=all doesn't work on Windows because of missing dependencies, I wonder which of them need fixing.
13/04/2021 09:00, Dmitry Kozlyuk: > Hi Ranjit, > > 2021-04-12 21:46 (UTC-0700), Ranjit Menon: > [...] > > The change to remove the networking shim breaks l2fwd compilation on > > Windows, since l2fwd/main.c includes netinet/in.h explicitly. > > > > How do you propose we fix this, only for Windows? > > This include is redundant for this file on all platforms, it can be removed. > Since -Dexamples=all doesn't work on Windows because of missing dependencies, > I wonder which of them need fixing. Let's fix the examples which are supported on Windows. Other examples may require more updates anyway.
On 4/14/2021 2:12 PM, Thomas Monjalon wrote: > 13/04/2021 09:00, Dmitry Kozlyuk: >> Hi Ranjit, >> >> 2021-04-12 21:46 (UTC-0700), Ranjit Menon: >> [...] >>> The change to remove the networking shim breaks l2fwd compilation on >>> Windows, since l2fwd/main.c includes netinet/in.h explicitly. >>> >>> How do you propose we fix this, only for Windows? >> This include is redundant for this file on all platforms, it can be removed. >> Since -Dexamples=all doesn't work on Windows because of missing dependencies, >> I wonder which of them need fixing. > Let's fix the examples which are supported on Windows. > Other examples may require more updates anyway. > Thanks, Thomas. For now, this is only required in l2fwd. Dmitry, can you please include this in your patch 4/4? thanks, ranjit m. >
14/04/2021 23:34, Ranjit Menon: > On 4/14/2021 2:12 PM, Thomas Monjalon wrote: > > 13/04/2021 09:00, Dmitry Kozlyuk: > >> Hi Ranjit, > >> > >> 2021-04-12 21:46 (UTC-0700), Ranjit Menon: > >> [...] > >>> The change to remove the networking shim breaks l2fwd compilation on > >>> Windows, since l2fwd/main.c includes netinet/in.h explicitly. > >>> > >>> How do you propose we fix this, only for Windows? > >> This include is redundant for this file on all platforms, it can be removed. > >> Since -Dexamples=all doesn't work on Windows because of missing dependencies, > >> I wonder which of them need fixing. > > Let's fix the examples which are supported on Windows. > > Other examples may require more updates anyway. > > > Thanks, Thomas. For now, this is only required in l2fwd. Only l2fwd is supported on Windows? > Dmitry, can you please include this in your patch 4/4? Ranjit, if you tell me what exactly is needed, I can do it and merge the series quickly.
On 4/14/2021 2:42 PM, Thomas Monjalon wrote: > 14/04/2021 23:34, Ranjit Menon: >> On 4/14/2021 2:12 PM, Thomas Monjalon wrote: >>> 13/04/2021 09:00, Dmitry Kozlyuk: >>>> Hi Ranjit, >>>> >>>> 2021-04-12 21:46 (UTC-0700), Ranjit Menon: >>>> [...] >>>>> The change to remove the networking shim breaks l2fwd compilation on >>>>> Windows, since l2fwd/main.c includes netinet/in.h explicitly. >>>>> >>>>> How do you propose we fix this, only for Windows? >>>> This include is redundant for this file on all platforms, it can be removed. >>>> Since -Dexamples=all doesn't work on Windows because of missing dependencies, >>>> I wonder which of them need fixing. >>> Let's fix the examples which are supported on Windows. >>> Other examples may require more updates anyway. >>> >> Thanks, Thomas. For now, this is only required in l2fwd. > Only l2fwd is supported on Windows? > >> Dmitry, can you please include this in your patch 4/4? > Ranjit, if you tell me what exactly is needed, I can do it > and merge the series quickly. Sure, Thomas. In l2wfd/main.c, all we need to do is remove the #include <netinet/in.h> line. This include file will not exist on Windows anymore, and Dmitry determined that this include is not required in l2fwd on all platforms. ranjit m. >
2021-04-14 14:47 (UTC-0700), Ranjit Menon: > On 4/14/2021 2:42 PM, Thomas Monjalon wrote: > > 14/04/2021 23:34, Ranjit Menon: > >> On 4/14/2021 2:12 PM, Thomas Monjalon wrote: > >>> 13/04/2021 09:00, Dmitry Kozlyuk: > >>>> Hi Ranjit, > >>>> > >>>> 2021-04-12 21:46 (UTC-0700), Ranjit Menon: > >>>> [...] > >>>>> The change to remove the networking shim breaks l2fwd compilation on > >>>>> Windows, since l2fwd/main.c includes netinet/in.h explicitly. > >>>>> > >>>>> How do you propose we fix this, only for Windows? > >>>> This include is redundant for this file on all platforms, it can be removed. > >>>> Since -Dexamples=all doesn't work on Windows because of missing dependencies, > >>>> I wonder which of them need fixing. > >>> Let's fix the examples which are supported on Windows. > >>> Other examples may require more updates anyway. > >>> > >> Thanks, Thomas. For now, this is only required in l2fwd. > > Only l2fwd is supported on Windows? > > > >> Dmitry, can you please include this in your patch 4/4? > > Ranjit, if you tell me what exactly is needed, I can do it > > and merge the series quickly. I've just sent v10 with all required fixes. > Sure, Thomas. In l2wfd/main.c, all we need to do is remove the #include > <netinet/in.h> line. > > This include file will not exist on Windows anymore, and Dmitry > determined that this include is not required in l2fwd on all platforms. For the reference, complete list of examples that can build for Windows: helloworld cmdline flow_filtering ipv4_multicast l2fwd link_status_interrupt qos_meter rxtx_callbacks (-Wformat with clang) service_cores skeleton
15/04/2021 00:08, Dmitry Kozlyuk: > 2021-04-14 14:47 (UTC-0700), Ranjit Menon: > > On 4/14/2021 2:42 PM, Thomas Monjalon wrote: > > > 14/04/2021 23:34, Ranjit Menon: > > >> On 4/14/2021 2:12 PM, Thomas Monjalon wrote: > > >>> 13/04/2021 09:00, Dmitry Kozlyuk: > > >>>> Hi Ranjit, > > >>>> > > >>>> 2021-04-12 21:46 (UTC-0700), Ranjit Menon: > > >>>> [...] > > >>>>> The change to remove the networking shim breaks l2fwd compilation on > > >>>>> Windows, since l2fwd/main.c includes netinet/in.h explicitly. > > >>>>> > > >>>>> How do you propose we fix this, only for Windows? > > >>>> This include is redundant for this file on all platforms, it can be removed. > > >>>> Since -Dexamples=all doesn't work on Windows because of missing dependencies, > > >>>> I wonder which of them need fixing. > > >>> Let's fix the examples which are supported on Windows. > > >>> Other examples may require more updates anyway. > > >>> > > >> Thanks, Thomas. For now, this is only required in l2fwd. > > > Only l2fwd is supported on Windows? > > > > > >> Dmitry, can you please include this in your patch 4/4? > > > Ranjit, if you tell me what exactly is needed, I can do it > > > and merge the series quickly. > > I've just sent v10 with all required fixes. Thank you Some acks were removed from this v10, I am re-adding them. > > Sure, Thomas. In l2wfd/main.c, all we need to do is remove the #include > > <netinet/in.h> line. > > > > This include file will not exist on Windows anymore, and Dmitry > > determined that this include is not required in l2fwd on all platforms. > > For the reference, complete list of examples that can build for Windows: > > helloworld > cmdline > flow_filtering > ipv4_multicast > l2fwd > link_status_interrupt > qos_meter > rxtx_callbacks (-Wformat with clang) > service_cores > skeleton devtools/test-meson-builds.sh should be updated to compile these examples with MinGW.