From patchwork Sat Mar 13 02:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89057 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 48528A0547; Sat, 13 Mar 2021 03:57:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E734E1608F2; Sat, 13 Mar 2021 03:57:00 +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 029361608E6 for ; Sat, 13 Mar 2021 03:56:59 +0100 (CET) Received: by mail-lj1-f169.google.com with SMTP id z8so9717728ljm.12 for ; Fri, 12 Mar 2021 18:56:59 -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=DESFMXbSxRW5SsZQPMGIQDkLmnyQmAMLSTz1eqLgBLU=; b=bthjAcjkYHc28WsK3bGWNmDdMAtYMfPanhqsY4rtR6nlQs23WkxEpVHh34xSNf5jLx PwvWg7NYcx4cPV95jU1B3gRnJn5/Vl/wQ/1BpVBjO84gUPfQl1/1Bgirod47JaBMdayU 2KJA2J99Im0807e1A9Ctf4WcgMr/kkRp5t2k9H0Li/99JXZOC/Knlg5YPq1RDSMpy7pR Gd0TfkuaGnFsTFA6Rzvs+nvr+H/fzckF/xLgZg76c7QXIUYRfVCYELE7CWJrjXeHlSRL /j136WyBSEfQs1gIUuJbK2rr8CaBf2ELo8Ih52fkUeaevi2qn1AK2wtHnu4/7NRMqn0w DAow== 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=DESFMXbSxRW5SsZQPMGIQDkLmnyQmAMLSTz1eqLgBLU=; b=qL7nhu6fPnECFtAZoCeMfj6df1XA7+oejegzTQZsFMM3nQlOQSzFNzrcR6lv9lXykm KGpHwI+dclUdesGu1LYmDPb40eGcN7SaZYEyqIjgpbp/CApd8PZTbRGEO6Mb52rhZoQN AwMHvpMlgVL8LOdlTOXkA4Rg5aKC200LTzdFHxnlPr1HyUf5AvhfTuBR7asnfrRdCFn8 IgagVSecZSNl31ePpN6Ju5MJ1m7FJ4dCpYGLo6dJwwUoxbKAh0bqLa9z5etMDcO2HbCT PI3bIaDlSDYkOmY/HcDMi65wPDkz2hqcVwLv5eCBwTs8ktIKjnDJYTmPzq168LiD+3hJ 2eTg== X-Gm-Message-State: AOAM533r+whCwmOcLk7JCnZIzlCkZ50ALSLkFSd+gpm/UN1jh4N1n3rh gzzoc+Nwe0J13ZOZ4aDA/Wi/8tWBXsTdEK+d X-Google-Smtp-Source: ABdhPJzoPjs7bJXZZy8jZ1AIL3ek3cPqCRqJwht/pIJUwIr6eeu8+zNbVgxPs8keIYxKcj+YDG40sw== X-Received: by 2002:a2e:9ec6:: with SMTP id h6mr4069641ljk.12.1615604219317; Fri, 12 Mar 2021 18:56:59 -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 a18sm2113290ljj.106.2021.03.12.18.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 18:56:58 -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 05:56:42 +0300 Message-Id: <20210313025645.6034-2-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> <20210313025645.6034-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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 | 2 ++ 8 files changed, 3 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..3ab4de2ec0 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -16,7 +16,9 @@ */ #include + #include +#include #include #include From patchwork Sat Mar 13 02:56:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89058 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 293E0A0547; Sat, 13 Mar 2021 03:57:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 152461608F8; Sat, 13 Mar 2021 03:57:04 +0100 (CET) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mails.dpdk.org (Postfix) with ESMTP id CC9E71608ED for ; Sat, 13 Mar 2021 03:57:00 +0100 (CET) Received: by mail-lj1-f174.google.com with SMTP id 16so9718833ljc.11 for ; Fri, 12 Mar 2021 18:57:00 -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=avGRlmL4Aq6iSf3cru2ZTKU0uLTky8LjqgPhk+k9qTY47XfoZ1VEpVVQjRWOugHOJ3 JT60WM8yRyK+zIxdEaZVH2nmIPhK45vl4Nu/THOo3D1w4Gl8mr2tj/TMl2rRBtDls+SD iqhKniQ0+NaFo2srBkGvYlRtqxqV2FEAG3yy0Z8soZ8IaB7UEGZjEuX2KejVMDmhoHmA RxeaWushELtU3vwXlW3JfiCUoPrcE0T1rr5Odg+CmSovBJ4yrpuy6kJqVkADFRmWgSSW ESb9zoDJ4DawIKzBoe6a796WG80vrCEz/ZAKlDsPX8i0NHdVzUv+GCbLTdA8b4ivVF9C 74yQ== 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=jP0kxJ1sgFr0vAABB2yMIcj18EAGVfW3KPbMWuwwKUT/mIT9yJmYjnmGACOZpTamLb CcHvlx/YcFKsr/1ngotn6Kq3wwx5UKSdJdcS0JmE2NCOnu8+2ynCOux/rvsVDxtlbGt1 O2ad7+sXL1+AL3mAyZGtO3zoVKSZFnudlcBBWRldc/SJ8lK2twuO5vcHJrfiqkmmWjn1 IejgRdco4kwwhRhAzjQHdHo5WXtkne5v/dxUpQIEUyADrZ/j3YMdGvtOkzrEr2HdP8AO pEPCtCxemV+eMGoHKvy3iwrTomUA0rbd1+AP6Vu2LAYZVAljo9KIxf1rvVTniu0upsQH xr4Q== X-Gm-Message-State: AOAM532x3lRYBPFsCDEuOILKILpVG4yTBCcFSHC6Pr1SGxRNVt3XituS wjh6JoY/whIUyieEO0ZgEW6lihFbbQFHuFrK X-Google-Smtp-Source: ABdhPJynCS1wSJ9rafJNOGSkwc7tcdnseDwSlI05zLHXPuTu2lUC4V35g3yt8RxbTp9Uut6V5HRpHA== X-Received: by 2002:a2e:9908:: with SMTP id v8mr4234278lji.460.1615604220250; Fri, 12 Mar 2021 18:57:00 -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 a18sm2113290ljj.106.2021.03.12.18.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 18:56:59 -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 05:56:43 +0300 Message-Id: <20210313025645.6034-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> <20210313025645.6034-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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 02:56:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89059 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 3C635A0547; Sat, 13 Mar 2021 03:57:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6041A160900; Sat, 13 Mar 2021 03:57:05 +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 E005E1608F6 for ; Sat, 13 Mar 2021 03:57:01 +0100 (CET) Received: by mail-lf1-f52.google.com with SMTP id q25so48399963lfc.8 for ; Fri, 12 Mar 2021 18:57:01 -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=MV54sPcBfKq3xDF/oE6wJU/dZtiTgL5q3tFkumHdgqNh9rIwQfMDd+Cpx+rIZTdB2Z 9Qetkisb+gH8oBFm3+dO4MJS6zq6DNv7Hy0eOznRDM3LGQxWp5LQa6WaBKAG9kpumY6Q QxvZRrjvSDHGbAmuQkF0cOE4gvByFIYvVchwU9xygW9zjNzlL6EysV/e6Ogr530ZqJjD xkxgv8e//YPh/gifCUurYSmhLDyePsFwZY7UMCrwYg4iws2PmyxxG/QB5LEYbRVvLaaM oY4KHzCF7shF5zJiA5NQbeGez+WrRkgmw30dVhkBQFMys9iGjCOdAacS2GXsTf0oaVTt zH1g== 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=a8gTy6Wk+m+GvPOsCiSNQ03IjawdLqvBujWuEopI8v81Wr6sVMwBq5WLEEICMaGmP7 EymmDADAQsYtNFs84hBgVe/yhTb02eZJ8BLvwUNFoAtl/EIsxXTzt5qZjYXZ/As+o2wF Cv14RDDVnFs+BouVG27k3PnGSkfH1ELHjqwmQdKLuFx5ulbQXLIvLqEj3nNaEkigFzlU ReUMxHQsxMZMt53ksh0/+wr7iz8CMya3p7s6XCEoZI+lWwLmj6MTsOsUh2QAsfahVOl1 M1d5cd3pm2HRALXZDPeR7gYBn0YgrLSSbjh6XztGd0BnqwQor8k3lWZa5SZusoz9Za9+ lYFg== X-Gm-Message-State: AOAM530OFTho4lISxEQy+g9U26W6BGEE9+3TEOPeG90Xugx3X/Gak+yj XB5YumfL2K47MMmkVZnmgWJW46FHtWfElJEv X-Google-Smtp-Source: ABdhPJxa5fCowFDsUZhzq2BFtMw+qWG8m/XXWlPhvDZG41soKANIHSxFU6CrTa3Qdvw/a5a/Zldfjg== X-Received: by 2002:ac2:4309:: with SMTP id l9mr1313412lfh.226.1615604221352; Fri, 12 Mar 2021 18:57:01 -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 a18sm2113290ljj.106.2021.03.12.18.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 18:57:01 -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 05:56:44 +0300 Message-Id: <20210313025645.6034-4-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> <20210313025645.6034-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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 02:56:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 89060 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 B9DFCA0547; Sat, 13 Mar 2021 03:57:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93993160909; Sat, 13 Mar 2021 03:57:06 +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 EA80A1608F6 for ; Sat, 13 Mar 2021 03:57:02 +0100 (CET) Received: by mail-lf1-f47.google.com with SMTP id n16so48456044lfb.4 for ; Fri, 12 Mar 2021 18:57:02 -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=QWcI4oM3V5rw2FMK/1yTPRH1mg86juPBW+idpKw+1gs=; b=aFp/towlX5qFGGWgJQ2JZXKYdTXKMShmVbSDPVVt6Ao4xFg4LLgG+24vBxschr0o1L y8cfcvs1esBGPNnDKccOpXNqZus/WZw/J3yPzGncCrqy3QpsPDvYmIyWYLr015ls09lb jIRzVq7nhpUfFtsut4dc/FfNGP7xPtVjI4nZ0dZIs5tIa+ypthCX3hYG5Fs50Y2Z7U9F AfX1DbgPEUcL6Q4GC08KRXOuqE9Q4AL3jUxKCx5zPbxd1KQq8PwLi/pqt3ZJZdfGuIbX SyD43DNK4rnw4VAPbIp3VUeII4aHjLFLRqhZGLUmRop5vgRCAIYxCvXFTC3P1ifYY/kr 2gZw== 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=QWcI4oM3V5rw2FMK/1yTPRH1mg86juPBW+idpKw+1gs=; b=r6ZtPIU9Z+88eOy7wVq0br9xrUVhVhErL1XNqKYILVpRkUsgbr7OSCthyQDwr2Lu2i AqvOYfW20JPgpY2313bQBIjSvX4nsGau5EYqU7wW6bdcWMwuNxbGq1EG60VSXjyIuMY4 rtliMnmTkg26UhfQOFtiwfKK9j6YIUurAukOnqwTgFYDLEHX4t0OfpS7myrI64TZtmmc 35Rs2pYO6uKC+3YO+itLrKY9JILOiYATaGkfo20GSaFS/P5NZmSInLPTnoiF09hJdscZ G1E61BxEOL+ryXEpIH5W+I4jZJ5JvdQl8St4ph63yQRMD+Ow3PFyJhCslCjOrbfPU6T1 R2gw== X-Gm-Message-State: AOAM531fVoa0H4O/z9qhoJwzpxSznaFalbh6yCDV/mdmV+JI2O9MkiE+ nBHhkVlGt3m6rG+4SnKBmrmGuAyLiQJ7K1ZJ X-Google-Smtp-Source: ABdhPJx1kfRFyr6b5AA1k1EprU2K9oACnKVMKqj+eGF6psYz99S2uJGkAxcQOxXh2F/vEyHHHvTJBQ== X-Received: by 2002:ac2:4576:: with SMTP id k22mr1348565lfm.523.1615604222314; Fri, 12 Mar 2021 18:57:02 -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 a18sm2113290ljj.106.2021.03.12.18.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 18:57:01 -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 05:56:45 +0300 Message-Id: <20210313025645.6034-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210313025645.6034-1-dmitry.kozliuk@gmail.com> References: <20210313015616.29790-1-dmitry.kozliuk@gmail.com> <20210313025645.6034-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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 3ab4de2ec0..8c138c1b91 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -17,11 +17,26 @@ #include +#ifndef RTE_EXEC_ENV_WINDOWS + #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