From patchwork Sat Mar 13 01:56: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: 89052 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 4CC2BA0547; Sat, 13 Mar 2021 02:56:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6CE71608F2; Sat, 13 Mar 2021 02:56:27 +0100 (CET) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id 455DB4067C for ; Sat, 13 Mar 2021 02:56:26 +0100 (CET) Received: by mail-lj1-f177.google.com with SMTP id z8so9622221ljm.12 for ; Fri, 12 Mar 2021 17:56: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=5EpzK5e0ONlL41jrS2iCCeYevvHbpqwh789E7KK+LNg=; b=P9DGfSU5lWOAK07pw9qRbd2PHzEcv3YaeAzL5vI48vebonduobIHkh7V+P/oPaxpC2 kIAfjFEp85Q2Y1elapavaiMjNE2X03DH48LVixKkSIqGrFRrmXFhWQenA63Jh5RENj2O KOi0LUeUtOTprPCWb3vtQoO2riC0gFHbR/tB/0Ti2W3YM/IIyGCDRRtWoDv6vk6PYhnw XasaJZlgDJPOyZ6Fb0/gBIvxDx0sB1Btsc+IrtUTczi/Pa3rqcqoqUeqI35+U55bkFyp ErxKOpNB/EVKlZZSQpt8+c0DchOEZP3UnQVbjxfpj4M6J+P7TmitwXev+pMhtVmsNAS6 QBKg== 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=5EpzK5e0ONlL41jrS2iCCeYevvHbpqwh789E7KK+LNg=; b=BE4UAn2CXDyNCn2qD+2bOLcR4H3cmu1O9G0RMEV8vCCcJL6iHNtLzHL4ZZGRNWrCMs aGsLiIR8cHJSiBAhuHHawQF7XquGTdTxHoIChcTo8T/BjMYYG/0JrgF/JWux8MCNcZLg 5h8IetIhlODO5Dlbaw1DnsL/MedvAAd5Eu3L3ilL66NbCy/Y8tE+5jSh+pLH650s51Jr DOrtfbyWYi1XDXcvdvd5sBgsL6ovstcL2jU7+hlVIaFZ0USLtn/5caruJtM7aqWGfiHi mCg6w4iPhOeFlv0naQDdEGB8M4mP1NtPmpguGIwIuORu3UAEWPCaj/huiDL3/G0Rqz7m kiRQ== X-Gm-Message-State: AOAM5321XxX11QxGhlV//qUwB8/DD3ErrMU8KnfVt5Qf9vCHP7Srw9I4 vSzU4JxSapEZ7SaqKvJN/cZ9+ucD6DBzqg== X-Google-Smtp-Source: ABdhPJzYW9oUPjan0UWV0dfUJb074tjRGF9aorbFoD9nwY/pR9AJ6gayROfgsnCL1UlqmHWmXMOCyg== X-Received: by 2002:a2e:900b:: with SMTP id h11mr4013301ljg.258.1615600585700; Fri, 12 Mar 2021 17:56: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 d2sm1901296lfl.89.2021.03.12.17.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 17:56:25 -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: Sat, 13 Mar 2021 04:56:13 +0300 Message-Id: <20210313015616.29790-2-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- 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, 3 insertions(+), 20 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..f8a08deed5 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -16,7 +16,8 @@ */ #include -#include + +#include #include #include From patchwork Sat Mar 13 01:56: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: 89053 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 DBD3DA0547; Sat, 13 Mar 2021 02:56:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 252421608F7; Sat, 13 Mar 2021 02:56:29 +0100 (CET) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mails.dpdk.org (Postfix) with ESMTP id 6257C1608E5 for ; Sat, 13 Mar 2021 02:56:27 +0100 (CET) Received: by mail-lf1-f42.google.com with SMTP id u4so48322344lfs.0 for ; Fri, 12 Mar 2021 17:56: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=lqwnMr/P2x48r+d9m2CH6He/s8TrIijRKN3WYnAxorQ=; b=jg6CQ+WWk5S2U5Nl2JJrJtem7tOHVD43nNlKB5c6dunfyz0gUJIMeei8LwUISLWIeK nTKzeL2NLbSZaPMjxoumbIuKjomBdk7HPQ2xSEU9Ol+ZC9inNfscUURrbYYuPGeA32Pv 6B9XbxzYFlnF8F/brGecaYwMDg5a3MPYxirZJHtOWtOby2k/mlMiRWtPrasa2zs3ajIc ZVyTDRxxWyUnwLoPSUrKTCWzvbKlKUIq8CODd599r0NwHHuErUVWoAUMS+W27EjQxilu x6t6QtOWkbSwIJEv5M4Ex9UwkLjt1GD3qUCAkBJafHIBgOgsznIB5FepuVaawjpKWb1O 1HcQ== 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=roxtfN4UFORl8Dpw/4Ghh/7nyyJfcC1WgFWimQdvXxW7acH+04VwnE82iZqiXuQ4Ql 95HC44bzUxd6z8kgw424C/4rl75DKxvonn0kJemDEMrwhS3nCL5BZGfizcovblvEk8zS 5xo/BFQCAKHxBcIp1QcUWXwbLLj022ccZIf3so2ACn+V41XGZR2Vvlahui0jewjnVdXN mTLmmIoPMUaWpGbRf0ZG6JNI4A/fLufknAd8x11h8N4ElD3CrJr9hWtr8/LxT2mOEOk0 UOJ8bjFwGuT0KuG82AFkS1nxKnoTQpgeIlQHIdV10yxuWmF5Ju+G7W3VgWqDSb0JlXkg ov2w== X-Gm-Message-State: AOAM531xviw+ayqSolfxSomtstpQ9tJ2uDKt106VXwijykv3jYImMJY8 vmCHrGJbedWdW2k7mioiKo5QjUSgm/97JA== X-Google-Smtp-Source: ABdhPJyKAAyczYvJoJTfLgSwIlgVLmCxwWGRHoHiQbU4XjoA45lwYPpSDEAgVrXqnNzN4FLhpJLVvw== X-Received: by 2002:a05:6512:3a92:: with SMTP id q18mr1208725lfu.248.1615600586707; Fri, 12 Mar 2021 17:56: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 d2sm1901296lfl.89.2021.03.12.17.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 17:56:26 -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: Sat, 13 Mar 2021 04:56:14 +0300 Message-Id: <20210313015616.29790-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- 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 01:56: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: 89054 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 80039A0547; Sat, 13 Mar 2021 02:56:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7962C1608FC; Sat, 13 Mar 2021 02:56:30 +0100 (CET) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id 357B51608F5 for ; Sat, 13 Mar 2021 02:56:28 +0100 (CET) Received: by mail-lj1-f177.google.com with SMTP id y1so9621693ljm.10 for ; Fri, 12 Mar 2021 17:56: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=sjx90+kxk2xnsdHhDm79AipxManFO0BN0HUxZztQFbc=; b=DVUm3sshEjnCP130ZcFPxzqb4ri4hGTZK6Ld+fPS8WTnfiFpqpQ+8h9xLQwxRA6cLE qyHcAVCfOwV9ULdwiIOPwiBYqS5H/3O4VbN420RI7olkSwmPBXLX36ffuAMML7K/PqqA n2t2tA3v6Ck4nlQyJISMOUui18zOItF1lh8Tbv0TJAYVw5OPP9gbLzMBdGEsufQmBghM NgOPVhEmjuh4vohqtSACzx2GL39B9l7fzprYG9aeGjc8aNIc97i+fV5X2U9hNvv77ac1 lXZMftifZo9d7M/3+11NECO/yGyZgX/ZA6SjMAx3ESE+XnHMfdItJReo/G0djW2YRdcR JeHA== 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=d/M8wCVB1nW8YwuWwqcZeSak2rLsks1gwuaEq3WRCMbpUnbfm5Z39WBwyaOIuxaGNG t51HVwOUqeqYzc8cdNGyQlHNv+h+Tbahkj27MqSZpsU3bKfuSZy/RquEXiAlkO9jig22 5LB9gk7tHM+juoWi1zQv9gejB9ZMWeMJdYp/b6ByNsw/9onHY9PUiKSWxkLU8VZk63US rRLmjrm64hswfBznVxjaNW+lZhsLQMxskYyvr9CoPkG5f2MeOZmCcqoLl7f23G5l6rbN rlOSapOFbC99Zx4oGdTN0+NpdyiQgapcMvxx9+HthM/JLNiXp8LuDtn6bkfb3nbGqO+3 84wA== X-Gm-Message-State: AOAM530woOUpU0mP/2a/Oh99QmYIvncNDV0Urg7rPxkX57xReD43tt2y TERtKvhIsZEWZenlJ4si95eWIaueXUFBQw== X-Google-Smtp-Source: ABdhPJyzplkbaem1evLzHXCIvl3P+/hOcH0emQc2JXgIprNNe6I9YakhK0DSdnPx4EpnuJMJDLM7Zw== X-Received: by 2002:a05:651c:201d:: with SMTP id s29mr3895081ljo.315.1615600587654; Fri, 12 Mar 2021 17:56: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 d2sm1901296lfl.89.2021.03.12.17.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 17:56:27 -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: Sat, 13 Mar 2021 04:56:15 +0300 Message-Id: <20210313015616.29790-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- 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 01:56: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: 89055 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 DA3A8A0547; Sat, 13 Mar 2021 02:56:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFC46160902; Sat, 13 Mar 2021 02:56:32 +0100 (CET) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id 419CA1608F9 for ; Sat, 13 Mar 2021 02:56:29 +0100 (CET) Received: by mail-lj1-f176.google.com with SMTP id 9so9626645ljd.7 for ; Fri, 12 Mar 2021 17:56:29 -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=4dd0C9OhM/RmeEXu3j+NaCf/46GmgFdAuSTE3yIPltY=; b=PSMznsAdNmP5Evk5k409sxW0WuKmj0gqnBGn2J+kJqCDp75FM6CMXcrP82GYhZQD9c pgIpsNLw1zSd3yuJl9qF00Sgcjs52dAuBSC/vLOcpMgsx/cUzP/TBSonCNMwhqn29Fmg XJItZhx6krZmIqDUlIm7ICYunRrRtN06sIYrJObuzT77wgUVZ4FN2wDSxEVN68+mfiKE B+QA6IeftLaevl9X2gc72HYUAj3umbCQzCzr99T9XfwwK2PtoNtnFn5didfOHwRCgZJm 90pg3v9oJ7GUYUSzzwBWKSjk5HWgVPvsmCQbGlzPZS1HunQ1fSYAzY84BV9lfX5Ti6Ry GFzA== 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=4dd0C9OhM/RmeEXu3j+NaCf/46GmgFdAuSTE3yIPltY=; b=opdPUOYob2ploOLDp5JdGEysO+NTXppI+h7Hw9LcqNl4Hds8im31DfuVV28NrrK5ZZ RFXJwL/MklidgmQAQpecjBMK4uF/mYjBiHM9tajIv+j3W+qwsxg7HyOOZCgL3lQJXl8c 4yKCQSaIJRW3wY55WmTRl+vHF4TTWRv2olHF7WjcwYNaB9DNXs+6Y45hysoYFSLbR4Cz Ckk6baqFSIlez89xeMQUvGFJixebAzwfY3X6cbqUFbf0ajZP5n6yUOw6shfI3Koa+h1Y rvGwOfzpf7zN4+oVg4JT0NLPZfGm5OjLcxw7B8nM0D93O1t5aotnB81ceUciptaJqxel 1LJA== X-Gm-Message-State: AOAM5321rF4QxMCnaRmTGA/sXtuXhb/nm+42nP77w3BrU7eC5247XREn 6IGGijMrF3VtLHwFkBElt+bYoEeJXqT1nA== X-Google-Smtp-Source: ABdhPJwE44SnqOoOEVGDMzHUOh4/1eWRwA4+290jtCPY39kMUtA6oQyi0+Ca72BOGPbN+bj6tD6jNw== X-Received: by 2002:a2e:9a98:: with SMTP id p24mr3984699lji.86.1615600588583; Fri, 12 Mar 2021 17:56:28 -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 d2sm1901296lfl.89.2021.03.12.17.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 17:56:28 -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: Sat, 13 Mar 2021 04:56:16 +0300 Message-Id: <20210313015616.29790-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 f8a08deed5..6c9904698a 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -17,10 +17,25 @@ #include +#ifndef RTE_EXEC_ENV_WINDOWS + #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