From patchwork Sat Mar 13 22:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89062 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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 A0885A00C2; Sat, 13 Mar 2021 23:22:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB372160891; Sat, 13 Mar 2021 23:22:28 +0100 (CET) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 88B2816087A for ; Sat, 13 Mar 2021 23:22:25 +0100 (CET) Received: by mail-lf1-f52.google.com with SMTP id q25so51102384lfc.8 for ; Sat, 13 Mar 2021 14:22:25 -0800 (PST) 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=WaGnis+jUi0M3mVr21C0dpOWCeAtMuV3/OoNfOxsxTg=; b=tUaqwoL65cnqNHitMSJoy0gcgIWARtUKZUZSrSAFYSragX4ZH834GJBT3Pte4nRAkN jQG2S/MsBB/mfkVfblS1Okcyz6QTt6sn9FzSkMoK2Vb33YbduRujytfSL61/g4PAgvQX ngqbMsQg5hVbaj8jCKC/4xj9Yx8UW7pSnVhhqt3tatjmpGz5VS6q1iWSRdfR5/dL/Qs+ hYIwZIbjhlOWRs6DKEfCYudc9Wj8jDZH27Ak9Lg9FV9m0wWvBlqnZNfQoyce9SvTpTvm 8wi7Qg2BrXC8eZG8LUBody0gu4LhgnRQ6Yewn3dRS2iz3zxjdGbz0qgkM0Ao3/Q2MFT5 kjfA== 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=WaGnis+jUi0M3mVr21C0dpOWCeAtMuV3/OoNfOxsxTg=; b=ly1WVZdqIpLaFrBRpAjQUKUHqXx+eOaUlBVyQ534YEbDVOhIbzryoy6xpRAKOUPxfD hVQLKpmQQoJh9CZqkw3nMSFSwrJFf9Hp5t8t6b0skIA3IejDXEYl9RnZY+BADJIKrFgP qXBTu59LsqnDpniioKCbxWJq1oNq/Im4l3ewikMeqi5OkA6GUKk+Nmk3cYZ7KTb1rw3U 9aM+jOtgHxC/qtfsGbm87sxQFqhC4ZL/Dk1+WdSwNOIVhd1IlDole6NrYxSR3nhokOww TvGjYrKoKPx35ZmvfMDqefEHBjPYBGZqvIG/RwRsDrIjx7aVraDYIKYotX6j6Zf29GjM sO4g== X-Gm-Message-State: AOAM533OwWLERGthdTkRcUQmrMt3n3CQzgHhU1h6jfV6pblffPW5jNx/ ZvCAGtuLqp6y2rNdg5dPFzaC2mI+2RD6lNM3 X-Google-Smtp-Source: ABdhPJyHXqVwVauP1XHCS8VE4uqeAIPX4cAuypdi5oLatrnRTpmKtOql227wZDpQHkQ3MS0WnUF3qA== X-Received: by 2002:ac2:5a0b:: with SMTP id q11mr3570505lfn.391.1615674144980; Sat, 13 Mar 2021 14:22:24 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t200sm2176685lff.280.2021.03.13.14.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 14:22:24 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Tyler Retzlaff , Dmitry Kozlyuk , Olivier Matz Date: Sun, 14 Mar 2021 01:22:13 +0300 Message-Id: <20210313222217.18271-2-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313222217.18271-1-dmitry.kozliuk@gmail.com> References: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> <20210313222217.18271-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/4] cmdline: remove POSIX dependency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use for IP-related defines instead of POSIX headers. Signed-off-by: Dmitry Kozlyuk Acked-by: Tyler Retzlaff --- Depends-on: series-15513 ("eal/windows: do not expose POSIX symbols") examples/cmdline/commands.c | 1 - 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_net/rte_ip.h | 3 +++ 8 files changed, 4 insertions(+), 19 deletions(-) diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c index f43eacfbad..2c62d04fb0 100644 --- a/examples/cmdline/commands.c +++ b/examples/cmdline/commands.c @@ -10,7 +10,6 @@ #include #include #include -#include #ifdef RTE_EXEC_ENV_FREEBSD #include #endif diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c index b04adbea58..959bcd1452 100644 --- a/examples/cmdline/parse_obj_list.c +++ b/examples/cmdline/parse_obj_list.c @@ -6,11 +6,9 @@ #include #include -#include #include #include #include -#include #include #include diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c index 49770869bb..a176d15130 100644 --- a/lib/librte_cmdline/cmdline.c +++ b/lib/librte_cmdline/cmdline.c @@ -12,7 +12,6 @@ #include #include #include -#include #include diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c index fe366841cd..f5cc934782 100644 --- a/lib/librte_cmdline/cmdline_parse.c +++ b/lib/librte_cmdline/cmdline_parse.c @@ -11,8 +11,6 @@ #include #include -#include - #include #include "cmdline_private.h" diff --git a/lib/librte_cmdline/cmdline_parse_etheraddr.c b/lib/librte_cmdline/cmdline_parse_etheraddr.c index 5cb10de321..433b828a72 100644 --- a/lib/librte_cmdline/cmdline_parse_etheraddr.c +++ b/lib/librte_cmdline/cmdline_parse_etheraddr.c @@ -5,13 +5,7 @@ */ #include -#include -#include -#include -#include -#include #include -#include #include #include diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c index f8dbdf204c..5e278c963f 100644 --- a/lib/librte_cmdline/cmdline_parse_ipaddr.c +++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c @@ -6,14 +6,8 @@ #include #include -#include -#include -#include #include #include -#include -#include -#include #include diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.h b/lib/librte_cmdline/cmdline_parse_ipaddr.h index 0ba81647bc..0118c31d44 100644 --- a/lib/librte_cmdline/cmdline_parse_ipaddr.h +++ b/lib/librte_cmdline/cmdline_parse_ipaddr.h @@ -8,7 +8,7 @@ #define _PARSE_IPADDR_H_ #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 212ff2c4fd..2cf7b0bd28 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -16,7 +16,10 @@ */ #include + +#include #include +#include #include #include From patchwork Sat Mar 13 22:22:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89063 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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 C39D9A00C2; Sat, 13 Mar 2021 23:22:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D5EE1608C7; Sat, 13 Mar 2021 23:22:30 +0100 (CET) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mails.dpdk.org (Postfix) with ESMTP id 8400C16088A for ; Sat, 13 Mar 2021 23:22:26 +0100 (CET) Received: by mail-lj1-f169.google.com with SMTP id u20so11801347lja.13 for ; Sat, 13 Mar 2021 14:22:26 -0800 (PST) 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=lqwnMr/P2x48r+d9m2CH6He/s8TrIijRKN3WYnAxorQ=; b=HXg2EPzU8HAFMuCBq6JS3Sz/zoWfQIQR3ivwtAZoZjSmCldo0WISFy9/BrSJCamaAD AQUFtinq1UDww3EqarFlKYqvd5vXMm+4MExOogb57vSWGBHwzkyEZ4otsLWmoPrS+YLe SEKXqbURkfRkaln4PtmYbdmQz9suXlt+SL6MCOq/3kuwlUz4cypHiO9vaHLLEwfPWLzC TcbFUk58GP+b4RTEoOxBLF+ApIpffqYFL96XOkcAdvT8ND5rfJYNbbovZ3Ou7056FXu8 ddpFsl+50t4iE2Xxu7lNKxxrPDuy3rk3kP9dY3hmfVSEWVOY6c7HojyNTpITZZ+R6isy CcAQ== 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=lqwnMr/P2x48r+d9m2CH6He/s8TrIijRKN3WYnAxorQ=; b=OISYgoExx+Qhn1D5TUfquYvtuk2R/XXwuBdKvgWGjNLaVmSf61tBiG03W7onL8Imme olry8HmqjwTQJNsOiQy4QVvMEbfdE+2UBCKZHesRdrElnOH1t3h6yyRCSF9fhHQHpc0L by7q4Lq+jd4vvUuqJ3LS5DwrKVv3R7YJkDDxzgB/0ALtYnoOzndDzOtOYfnqN1ltb+lD a5HaXvBj2rOYkPXYpX1sAwpgODC2WSkLfsq6EEWJtwRZizWfKNuhrpcVB4/4w1SmjV9s zjiL1ALXB7Z2vB7eJRJi0sSpzolFJmNhNyFdfGKBAWOUbbN6LNWsOI6d3v0hgeqQOOfw Qlmg== X-Gm-Message-State: AOAM5329nAMRmZrmALLWe9+xb5zLffxdGfIuvfEQHlSxm5OHgZwLZ4pr 6vvCdX6929eUji1g0EySiNlyeik22nXOX8hn X-Google-Smtp-Source: ABdhPJyjbB+kIJmFHX6d5pIqJIyUt4yAdsYAf1TglafG/MdyLNiRLHjJarFewNKf5sgp0c+dIpNldg== X-Received: by 2002:a2e:8e91:: with SMTP id z17mr6242679ljk.384.1615674145886; Sat, 13 Mar 2021 14:22:25 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t200sm2176685lff.280.2021.03.13.14.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 14:22:25 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Tyler Retzlaff , Dmitry Kozlyuk , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Sun, 14 Mar 2021 01:22:14 +0300 Message-Id: <20210313222217.18271-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313222217.18271-1-dmitry.kozliuk@gmail.com> References: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> <20210313222217.18271-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 2/4] ethdev: remove POSIX dependency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use for IP-related defines instead of POSIX headers. Keep , because it is incorporated into DPDK. Cleanup, group, and sort remaining includes per coding style. Signed-off-by: Dmitry Kozlyuk Acked-by: Tyler Retzlaff --- lib/librte_ethdev/rte_ethdev.c | 13 +++++-------- lib/librte_ethdev/rte_ethdev_core.h | 1 - 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 6f514c388b..f363794369 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2,18 +2,15 @@ * Copyright(c) 2010-2017 Intel Corporation */ -#include -#include #include -#include -#include -#include -#include #include +#include #include #include -#include -#include +#include +#include + +#include #include #include diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 918a34ed1f..4679d948fa 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -6,7 +6,6 @@ #define _RTE_ETHDEV_CORE_H_ #include -#include /** * @file From patchwork Sat Mar 13 22:22:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89064 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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 D308FA00C2; Sat, 13 Mar 2021 23:22:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 422E11608E8; Sat, 13 Mar 2021 23:22:31 +0100 (CET) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by mails.dpdk.org (Postfix) with ESMTP id 6001516088A for ; Sat, 13 Mar 2021 23:22:27 +0100 (CET) Received: by mail-lf1-f47.google.com with SMTP id m22so51089576lfg.5 for ; Sat, 13 Mar 2021 14:22:27 -0800 (PST) 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=sjx90+kxk2xnsdHhDm79AipxManFO0BN0HUxZztQFbc=; b=ZtmmlVOKHzSAdf1Btd9awm0lW5ZEw2RluIchaW07JCuYMIMl1Pc+pXB75Q08USodk0 bZieETbMMEMsyLcpi27JbbETxu7uK346d8wNzvOcc1dH0+jKK0VXAKkMAy1LiUoBGNGb hoQuZflCoQdwUUK9mu1PlR382UCcLcu1eeQf9HOHSIZNpo5A+jGRiWfMUwyLLNDuLYd4 fMzDqdKlurolD6bbt62RuzhvkVdhf/W36bBFpwWM6cBM1e+XU70Ymr1vYeXLkr8Hbhre QjB4Wm4m+J/Pggy1mxNIVOFB+bn6tSAeR/cMuqUuMiDO+TCiEwuzEnaoctL46993jYK6 1c4A== 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=sjx90+kxk2xnsdHhDm79AipxManFO0BN0HUxZztQFbc=; b=dogB8IuaLjw2wN0tLsjlAg6XmzaXoG8i981q/8OUOf6eUH6FOmO7AP1JJwdFrtdJhi NNMPi9AphHWeb7iKCTXeYPoPxlshxOTAFwAk6A8LfN7xR2w6vsj6HEyHAJUCR16//F7n 8mMi/G7TFYCsU9vl5AfWaI1U9GpxReXmkRzoNjc86+4JypXcwhEJ2g9jMKP5bWDGRhh3 eG4PwmNmrE/Jo+/lp3R1vvFp7BAdyCOTTe/CSQfD/3jY3fX0mHQeDSh1QDNYh4e9sPKh Zgluax4HhWVQBYv7MpJ3/gBcKRGq7mzARz2iFDmZ0Og08yrh2GfsZIeG+aFrGiAXbnGD onNQ== X-Gm-Message-State: AOAM532c3XgJ6SSsVEF06rd/Dr+kDPk3BXAJQeQE9XJ8471B+5fwXnZG VrbxhYoOmjFktDxjUGXn59f3pPjO6M7bKJ8z X-Google-Smtp-Source: ABdhPJzP5nRUclAZPw+SpRUGAsas3ypto5QKn+jHSrjVUglTYWozbEtReqzXJqzzZybTuL07EjONpQ== X-Received: by 2002:ac2:5444:: with SMTP id d4mr3745653lfn.126.1615674146824; Sat, 13 Mar 2021 14:22:26 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t200sm2176685lff.280.2021.03.13.14.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 14:22:26 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Tyler Retzlaff , Dmitry Kozlyuk , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Sun, 14 Mar 2021 01:22:15 +0300 Message-Id: <20210313222217.18271-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313222217.18271-1-dmitry.kozliuk@gmail.com> References: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> <20210313222217.18271-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 3/4] net/mlx5: remove POSIX dependency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use for IP-related defines instead of POSIX headers. Keep , because it is incorporated into DPDK. Signed-off-by: Dmitry Kozlyuk Acked-by: Tyler Retzlaff --- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow.h | 4 ++-- drivers/net/mlx5/mlx5_mac.c | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index a281fd20ea..f04da06abd 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -10,7 +10,7 @@ #include #include #include -#include + #include #include diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index ab5be3dacc..73253bd39e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3,13 +3,13 @@ * Copyright 2016 Mellanox Technologies, Ltd */ -#include -#include #include #include #include #include +#include + #include #include #include diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 8324e188e1..c4e5f19faa 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -5,12 +5,12 @@ #ifndef RTE_PMD_MLX5_FLOW_H_ #define RTE_PMD_MLX5_FLOW_H_ -#include -#include #include #include #include +#include + #include #include diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c index 6ffcfcd97a..f0450735e2 100644 --- a/drivers/net/mlx5/mlx5_mac.c +++ b/drivers/net/mlx5/mlx5_mac.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include From patchwork Sat Mar 13 22:22:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89065 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: 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 CB7A1A00C2; Sat, 13 Mar 2021 23:22:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0CB2160906; Sat, 13 Mar 2021 23:22:32 +0100 (CET) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mails.dpdk.org (Postfix) with ESMTP id 583BC16088A for ; Sat, 13 Mar 2021 23:22:28 +0100 (CET) Received: by mail-lf1-f43.google.com with SMTP id v9so51144234lfa.1 for ; Sat, 13 Mar 2021 14:22:28 -0800 (PST) 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=EwvmS2wl6zo24TEUVyaG6PhN7Wu1VnCoqPPMwb9bUXo=; b=u2Z6+l8vTzjZs6YG1ey/NePbvhLzFndmtAZgOiENwOo2GXmfgIdNpkYasrY6BKrFc9 GtKVU7B00JvsAFgzcDqjy9uRQFvR8YIa7lOXSmBtaf9DA8HAWWofOru+MxD3SMaIKV+4 4yJDT9DH5fdE8xV+HqHl7Dy3/IE9qnnlZQo2aN0U+MpC/waX0pelSuYSjePtdrWVRSGY 5JhRT8WFkcB03dEtxDyfeq8zCNsVXE3IettEuxaNEA+aj3dP5ITxmEnJ1jnCj2slRk71 uaZ8U1AsBAWz35UDH/qpWcGHGiv4uWpczIigPWTrKVdkoW29R3Y+CFj8KAf7Pr1Pd9Ku D41Q== 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=EwvmS2wl6zo24TEUVyaG6PhN7Wu1VnCoqPPMwb9bUXo=; b=ScVV2pc7IqYcnvSZD4wBjdJadOmrl+cHO+XXmBLAwIT4N7NAZok5SL4mazeIXR7FRQ baKTqaVTQ95FLsyNxpo1zwMtNazN9DDPDPMO7rELL9Zn6ObZ7J0Oqh58BteNSMTIrMbB JOoq62EtC7vcZIgYpW+1fCg+nnTDagwDLdrR2L09MRNSzY+CNZxda2B9NotemdTm9JZS VxXshnSTwGBFnjfh/7+Ap8jVXA9V4J9pxfWpmmJwAvZbSz8qFvnBGpTy4QPUWULEziWS jALnGmNN8MlVxY4sczc9LPGLC3AKGW2xEY2EmmgQ9rsSDVpnVR3FHePI/4Ju6DL2+4lC HCuA== X-Gm-Message-State: AOAM531JEroZrLt5Od+RB6GFQ8k/VNI4qSlOz2BVvKszQJZ/sAxPfV3A OZHdm0XsfstylWZ1tlEJPfGc9shOqkCDw6B9 X-Google-Smtp-Source: ABdhPJx4X/23gAqGI9Bfzv8CLwVgj+IqF/KPVVhfneB37o1W/wSrS8+TYZyCVdIoBUcmXGLdtar0QQ== X-Received: by 2002:a05:6512:39d6:: with SMTP id k22mr3650882lfu.378.1615674147718; Sat, 13 Mar 2021 14:22:27 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id t200sm2176685lff.280.2021.03.13.14.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 14:22:27 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Tyler Retzlaff , Dmitry Kozlyuk , Olivier Matz Date: Sun, 14 Mar 2021 01:22:16 +0300 Message-Id: <20210313222217.18271-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313222217.18271-1-dmitry.kozliuk@gmail.com> References: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> <20210313222217.18271-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 4/4] net: replace Windows networking shim X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove networking shim from Windows EAL. Replace it with system headers with two workarounds: 1. Windows Sockets headers contain `#define s_addr S_un.S_addr`, which conflicts with `s_addr` field of `struct rte_ether_hdr`. Undefining this macro in had been breaking some usages of DPDK and Windows headers in one file. Renaming is planned: https://mails.dpdk.org/archives/dev/2021-March/201444.html Temporarily disable `s_addr` macro around `struct rte_ether_hdr` definition to avoid conflict. Place source MAC address in both `s_addr` and `S_un.S_addr` fields, so that access works either directly or through the macro. 2. Provide some IPPROTO_* constants and IPVERSION, missing on Windows. Signed-off-by: Dmitry Kozlyuk --- 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/sys/socket.h | 24 ------------- lib/librte_net/rte_ether.h | 26 ++++++++++---- lib/librte_net/rte_ip.h | 15 ++++++++ 6 files changed, 35 insertions(+), 108 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 diff --git a/lib/librte_eal/windows/include/arpa/inet.h b/lib/librte_eal/windows/include/arpa/inet.h deleted file mode 100644 index 96b6984383..0000000000 --- a/lib/librte_eal/windows/include/arpa/inet.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (c) 2020 Dmitry Kozlyuk - */ - -#ifndef _ARPA_INET_H_ -#define _ARPA_INET_H_ - -/** - * @file - * - * Compatibility header - * - * Although symbols declared here are present on Windows, - * including would expose too much macros breaking common code. - */ - -#include -#include - -/* defined in ws2_32.dll */ -__attribute__((stdcall)) -int -inet_pton(int af, const char *src, void *dst); - -/* defined in ws2_32.dll */ -__attribute__((stdcall)) -const char * -inet_ntop(int af, const void *src, char *dst, socklen_t size); - -#endif /* _ARPA_INET_H_ */ diff --git a/lib/librte_eal/windows/include/netinet/in.h b/lib/librte_eal/windows/include/netinet/in.h deleted file mode 100644 index 6455b9ba51..0000000000 --- a/lib/librte_eal/windows/include/netinet/in.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2020 Mellanox Technologies, Ltd - */ - -#ifndef _IN_H_ -#define _IN_H_ - -#include -#include - -#define IPPROTO_IP 0 -#define IPPROTO_HOPOPTS 0 -#define IPPROTO_ICMP 1 -#define IPPROTO_IPIP 4 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 -#define IPPROTO_IPV6 41 -#define IPPROTO_ROUTING 43 -#define IPPROTO_FRAGMENT 44 -#define IPPROTO_GRE 47 -#define IPPROTO_ESP 50 -#define IPPROTO_AH 51 -#define IPPROTO_ICMPV6 58 -#define IPPROTO_NONE 59 -#define IPPROTO_DSTOPTS 60 -#define IPPROTO_SCTP 132 - -#define INET6_ADDRSTRLEN 46 - -struct in_addr { - uint32_t s_addr; -}; - -struct in6_addr { - uint8_t s6_addr[16]; -}; - -#endif diff --git a/lib/librte_eal/windows/include/netinet/ip.h b/lib/librte_eal/windows/include/netinet/ip.h deleted file mode 100644 index 2126498797..0000000000 --- a/lib/librte_eal/windows/include/netinet/ip.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2020 Mellanox Technologies, Ltd - */ - -#ifndef _IP_H_ -#define _IP_H_ - -#define IPVERSION 4 - -#endif diff --git a/lib/librte_eal/windows/include/sys/socket.h b/lib/librte_eal/windows/include/sys/socket.h deleted file mode 100644 index 9536cf8e62..0000000000 --- a/lib/librte_eal/windows/include/sys/socket.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (c) 2020 Dmitry Kozlyuk - */ - -#ifndef _SYS_SOCKET_H_ -#define _SYS_SOCKET_H_ - -/** - * @file - * - * Compatibility header - * - * Although symbols declared here are present on Windows, - * including would expose too much macros breaking common code. - */ - -#include - -#define AF_INET 2 -#define AF_INET6 23 - -typedef size_t socklen_t; - -#endif /* _SYS_SOCKET_H_ */ diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 060b63fc9b..a303c24a8c 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -23,10 +23,6 @@ extern "C" { #include #include -#ifdef RTE_EXEC_ENV_WINDOWS /* Workaround conflict with rte_ether_hdr. */ -#undef s_addr /* Defined in winsock2.h included in windows.h. */ -#endif - #define RTE_ETHER_ADDR_LEN 6 /**< Length of Ethernet address. */ #define RTE_ETHER_TYPE_LEN 2 /**< Length of Ethernet type field. */ #define RTE_ETHER_CRC_LEN 4 /**< Length of Ethernet CRC. */ @@ -257,16 +253,34 @@ __rte_experimental int rte_ether_unformat_addr(const char *str, struct rte_ether_addr *eth_addr); +/* Windows Sockets headers contain `#define s_addr S_un.S_addr`. + * Temporarily disable this macro to avoid conflict at definition. + * Place source MAC address in both `s_addr` and `S_un.S_addr` fields, + * so that access works either directly or through the macro. + */ +#pragma push_macro("s_addr") +#ifdef s_addr +#undef s_addr +#endif + /** * Ethernet header: Contains the destination address, source address * and frame type. */ struct rte_ether_hdr { struct rte_ether_addr d_addr; /**< Destination address. */ - struct rte_ether_addr s_addr; /**< Source address. */ - uint16_t ether_type; /**< Frame type. */ + RTE_STD_C11 + union { + struct rte_ether_addr s_addr; /**< Source address. */ + struct { + struct rte_ether_addr S_addr; + } S_un; /**< Do not use directly; use s_addr instead.*/ + }; + uint16_t ether_type; /**< Frame type. */ } __rte_aligned(2); +#pragma pop_macro("s_addr") + /** * Ethernet VLAN Header. * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 2cf7b0bd28..87fbc26431 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -17,12 +17,27 @@ #include +#ifndef RTE_EXEC_ENV_WINDOWS + #include #include #include #include #include +#else + +#include + +#ifdef RTE_BUILD_INTERNAL +#define IPVERSION 4 /* missing from Windows SDK */ +#define IPPROTO_IPIP 4 /* missing from Windows SDK and MinGW */ +#define IPPROTO_GRE 47 /* ditto */ +#define IPPROTO_SCTP 132 /* missing from MinGW */ +#endif + +#endif /* RTE_EXEC_ENV_WINDOWS */ + #include #include