Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/89055/?format=api
https://patches.dpdk.org/api/patches/89055/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210313015616.29790-5-dmitry.kozliuk@gmail.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210313015616.29790-5-dmitry.kozliuk@gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210313015616.29790-5-dmitry.kozliuk@gmail.com", "date": "2021-03-13T01:56:16", "name": "[4/4] net: replace Windows networking shim", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "239457f899dd87630e0c4d322f85f2c14aec3bbb", "submitter": { "id": 1581, "url": "https://patches.dpdk.org/api/people/1581/?format=api", "name": "Dmitry Kozlyuk", "email": "dmitry.kozliuk@gmail.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210313015616.29790-5-dmitry.kozliuk@gmail.com/mbox/", "series": [ { "id": 15638, "url": "https://patches.dpdk.org/api/series/15638/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15638", "date": "2021-03-13T01:56:12", "name": "net: replace Windows networking shim", "version": 1, "mbox": "https://patches.dpdk.org/series/15638/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/89055/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/89055/checks/", "tags": {}, "related": [], "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DA3A8A0547;\n\tSat, 13 Mar 2021 02:56:54 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BFC46160902;\n\tSat, 13 Mar 2021 02:56:32 +0100 (CET)", "from mail-lj1-f176.google.com (mail-lj1-f176.google.com\n [209.85.208.176])\n by mails.dpdk.org (Postfix) with ESMTP id 419CA1608F9\n for <dev@dpdk.org>; Sat, 13 Mar 2021 02:56:29 +0100 (CET)", "by mail-lj1-f176.google.com with SMTP id 9so9626645ljd.7\n for <dev@dpdk.org>; Fri, 12 Mar 2021 17:56:29 -0800 (PST)", "from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.\n [37.110.65.23])\n by smtp.gmail.com with ESMTPSA id d2sm1901296lfl.89.2021.03.12.17.56.27\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 12 Mar 2021 17:56:28 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=4dd0C9OhM/RmeEXu3j+NaCf/46GmgFdAuSTE3yIPltY=;\n b=PSMznsAdNmP5Evk5k409sxW0WuKmj0gqnBGn2J+kJqCDp75FM6CMXcrP82GYhZQD9c\n pgIpsNLw1zSd3yuJl9qF00Sgcjs52dAuBSC/vLOcpMgsx/cUzP/TBSonCNMwhqn29Fmg\n XJItZhx6krZmIqDUlIm7ICYunRrRtN06sIYrJObuzT77wgUVZ4FN2wDSxEVN68+mfiKE\n B+QA6IeftLaevl9X2gc72HYUAj3umbCQzCzr99T9XfwwK2PtoNtnFn5didfOHwRCgZJm\n 90pg3v9oJ7GUYUSzzwBWKSjk5HWgVPvsmCQbGlzPZS1HunQ1fSYAzY84BV9lfX5Ti6Ry\n GFzA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=4dd0C9OhM/RmeEXu3j+NaCf/46GmgFdAuSTE3yIPltY=;\n b=opdPUOYob2ploOLDp5JdGEysO+NTXppI+h7Hw9LcqNl4Hds8im31DfuVV28NrrK5ZZ\n RFXJwL/MklidgmQAQpecjBMK4uF/mYjBiHM9tajIv+j3W+qwsxg7HyOOZCgL3lQJXl8c\n 4yKCQSaIJRW3wY55WmTRl+vHF4TTWRv2olHF7WjcwYNaB9DNXs+6Y45hysoYFSLbR4Cz\n Ckk6baqFSIlez89xeMQUvGFJixebAzwfY3X6cbqUFbf0ajZP5n6yUOw6shfI3Koa+h1Y\n rvGwOfzpf7zN4+oVg4JT0NLPZfGm5OjLcxw7B8nM0D93O1t5aotnB81ceUciptaJqxel\n 1LJA==", "X-Gm-Message-State": "AOAM5321rF4QxMCnaRmTGA/sXtuXhb/nm+42nP77w3BrU7eC5247XREn\n 6IGGijMrF3VtLHwFkBElt+bYoEeJXqT1nA==", "X-Google-Smtp-Source": "\n ABdhPJwE44SnqOoOEVGDMzHUOh4/1eWRwA4+290jtCPY39kMUtA6oQyi0+Ca72BOGPbN+bj6tD6jNw==", "X-Received": "by 2002:a2e:9a98:: with SMTP id p24mr3984699lji.86.1615600588583;\n Fri, 12 Mar 2021 17:56:28 -0800 (PST)", "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>", "To": "dev@dpdk.org", "Cc": "Pallavi Kadam <pallavi.kadam@intel.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Olivier Matz <olivier.matz@6wind.com>", "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", "Content-Transfer-Encoding": "8bit", "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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Remove networking shim from Windows EAL.\n\nReplace it with system headers with two workarounds:\n\n1. Windows Sockets headers contain `#define s_addr S_un.S_addr`, which\n conflicts with `s_addr` field of `struct rte_ether_hdr`. Undefining\n this macro in <rte_ether.h> had been breaking some usages of DPDK\n and Windows headers in one file.\n\n Renaming is planned:\n https://mails.dpdk.org/archives/dev/2021-March/201444.html\n\n Temporarily disable `s_addr` macro around `struct rte_ether_hdr`\n definition to avoid conflict. Place source MAC address in both\n `s_addr` and `S_un.S_addr` fields, so that access works either\n directly or through the macro.\n\n2. Provide some IPPROTO_* constants and IPVERSION, missing on Windows.\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n---\n lib/librte_eal/windows/include/arpa/inet.h | 30 ----------------\n lib/librte_eal/windows/include/netinet/in.h | 38 ---------------------\n lib/librte_eal/windows/include/netinet/ip.h | 10 ------\n lib/librte_eal/windows/include/sys/socket.h | 24 -------------\n lib/librte_net/rte_ether.h | 26 ++++++++++----\n lib/librte_net/rte_ip.h | 15 ++++++++\n 6 files changed, 35 insertions(+), 108 deletions(-)\n delete mode 100644 lib/librte_eal/windows/include/arpa/inet.h\n delete mode 100644 lib/librte_eal/windows/include/netinet/in.h\n delete mode 100644 lib/librte_eal/windows/include/netinet/ip.h\n delete mode 100644 lib/librte_eal/windows/include/sys/socket.h", "diff": "diff --git a/lib/librte_eal/windows/include/arpa/inet.h b/lib/librte_eal/windows/include/arpa/inet.h\ndeleted file mode 100644\nindex 96b6984383..0000000000\n--- a/lib/librte_eal/windows/include/arpa/inet.h\n+++ /dev/null\n@@ -1,30 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright (c) 2020 Dmitry Kozlyuk\n- */\n-\n-#ifndef _ARPA_INET_H_\n-#define _ARPA_INET_H_\n-\n-/**\n- * @file\n- *\n- * Compatibility header\n- *\n- * Although symbols declared here are present on Windows,\n- * including <winsock2.h> would expose too much macros breaking common code.\n- */\n-\n-#include <netinet/in.h>\n-#include <sys/socket.h>\n-\n-/* defined in ws2_32.dll */\n-__attribute__((stdcall))\n-int\n-inet_pton(int af, const char *src, void *dst);\n-\n-/* defined in ws2_32.dll */\n-__attribute__((stdcall))\n-const char *\n-inet_ntop(int af, const void *src, char *dst, socklen_t size);\n-\n-#endif /* _ARPA_INET_H_ */\ndiff --git a/lib/librte_eal/windows/include/netinet/in.h b/lib/librte_eal/windows/include/netinet/in.h\ndeleted file mode 100644\nindex 6455b9ba51..0000000000\n--- a/lib/librte_eal/windows/include/netinet/in.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright 2020 Mellanox Technologies, Ltd\n- */\n-\n-#ifndef _IN_H_\n-#define _IN_H_\n-\n-#include <stdint.h>\n-#include <sys/socket.h>\n-\n-#define IPPROTO_IP 0\n-#define IPPROTO_HOPOPTS 0\n-#define IPPROTO_ICMP 1\n-#define IPPROTO_IPIP 4\n-#define IPPROTO_TCP 6\n-#define IPPROTO_UDP 17\n-#define IPPROTO_IPV6 41\n-#define IPPROTO_ROUTING 43\n-#define IPPROTO_FRAGMENT 44\n-#define IPPROTO_GRE 47\n-#define IPPROTO_ESP 50\n-#define IPPROTO_AH 51\n-#define IPPROTO_ICMPV6 58\n-#define IPPROTO_NONE 59\n-#define IPPROTO_DSTOPTS 60\n-#define IPPROTO_SCTP 132\n-\n-#define INET6_ADDRSTRLEN 46\n-\n-struct in_addr {\n-\tuint32_t s_addr;\n-};\n-\n-struct in6_addr {\n-\tuint8_t s6_addr[16];\n-};\n-\n-#endif\ndiff --git a/lib/librte_eal/windows/include/netinet/ip.h b/lib/librte_eal/windows/include/netinet/ip.h\ndeleted file mode 100644\nindex 2126498797..0000000000\n--- a/lib/librte_eal/windows/include/netinet/ip.h\n+++ /dev/null\n@@ -1,10 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright 2020 Mellanox Technologies, Ltd\n- */\n-\n-#ifndef _IP_H_\n-#define _IP_H_\n-\n-#define IPVERSION 4\n-\n-#endif\ndiff --git a/lib/librte_eal/windows/include/sys/socket.h b/lib/librte_eal/windows/include/sys/socket.h\ndeleted file mode 100644\nindex 9536cf8e62..0000000000\n--- a/lib/librte_eal/windows/include/sys/socket.h\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright (c) 2020 Dmitry Kozlyuk\n- */\n-\n-#ifndef _SYS_SOCKET_H_\n-#define _SYS_SOCKET_H_\n-\n-/**\n- * @file\n- *\n- * Compatibility header\n- *\n- * Although symbols declared here are present on Windows,\n- * including <winsock2.h> would expose too much macros breaking common code.\n- */\n-\n-#include <stddef.h>\n-\n-#define AF_INET 2\n-#define AF_INET6 23\n-\n-typedef size_t socklen_t;\n-\n-#endif /* _SYS_SOCKET_H_ */\ndiff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h\nindex 060b63fc9b..a303c24a8c 100644\n--- a/lib/librte_net/rte_ether.h\n+++ b/lib/librte_net/rte_ether.h\n@@ -23,10 +23,6 @@ extern \"C\" {\n #include <rte_mbuf.h>\n #include <rte_byteorder.h>\n \n-#ifdef RTE_EXEC_ENV_WINDOWS /* Workaround conflict with rte_ether_hdr. */\n-#undef s_addr /* Defined in winsock2.h included in windows.h. */\n-#endif\n-\n #define RTE_ETHER_ADDR_LEN 6 /**< Length of Ethernet address. */\n #define RTE_ETHER_TYPE_LEN 2 /**< Length of Ethernet type field. */\n #define RTE_ETHER_CRC_LEN 4 /**< Length of Ethernet CRC. */\n@@ -257,16 +253,34 @@ __rte_experimental\n int\n rte_ether_unformat_addr(const char *str, struct rte_ether_addr *eth_addr);\n \n+/* Windows Sockets headers contain `#define s_addr S_un.S_addr`.\n+ * Temporarily disable this macro to avoid conflict at definition.\n+ * Place source MAC address in both `s_addr` and `S_un.S_addr` fields,\n+ * so that access works either directly or through the macro.\n+ */\n+#pragma push_macro(\"s_addr\")\n+#ifdef s_addr\n+#undef s_addr\n+#endif\n+\n /**\n * Ethernet header: Contains the destination address, source address\n * and frame type.\n */\n struct rte_ether_hdr {\n \tstruct rte_ether_addr d_addr; /**< Destination address. */\n-\tstruct rte_ether_addr s_addr; /**< Source address. */\n-\tuint16_t ether_type; /**< Frame type. */\n+\tRTE_STD_C11\n+\tunion {\n+\t\tstruct rte_ether_addr s_addr; /**< Source address. */\n+\t\tstruct {\n+\t\t\tstruct rte_ether_addr S_addr;\n+\t\t} S_un; /**< Do not use directly; use s_addr instead.*/\n+\t};\n+\tuint16_t ether_type; /**< Frame type. */\n } __rte_aligned(2);\n \n+#pragma pop_macro(\"s_addr\")\n+\n /**\n * Ethernet VLAN Header.\n * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type\ndiff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h\nindex f8a08deed5..6c9904698a 100644\n--- a/lib/librte_net/rte_ip.h\n+++ b/lib/librte_net/rte_ip.h\n@@ -17,10 +17,25 @@\n \n #include <stdint.h>\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n+\n #include <arpa/inet.h>\n #include <netinet/in.h>\n #include <netinet/ip.h>\n \n+#else\n+\n+#include <ws2tcpip.h>\n+\n+#ifdef RTE_BUILD_INTERNAL\n+#define IPVERSION\t4 /* missing from Windows SDK */\n+#define IPPROTO_IPIP\t4 /* missing from Windows SDK and MinGW */\n+#define IPPROTO_GRE\t47 /* ditto */\n+#define IPPROTO_SCTP\t132 /* missing from MinGW */\n+#endif\n+\n+#endif /* RTE_EXEC_ENV_WINDOWS */\n+\n #include <rte_byteorder.h>\n #include <rte_mbuf.h>\n \n", "prefixes": [ "4/4" ] }{ "id": 89055, "url": "