Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/124163/?format=api
http://patches.dpdk.org/api/patches/124163/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230219231416.22524-9-stephen@networkplumber.org/", "project": { "id": 1, "url": "http://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": "<20230219231416.22524-9-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230219231416.22524-9-stephen@networkplumber.org", "date": "2023-02-19T23:14:15", "name": "[v4,8/9] pcapng: windows compatibility", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "47e7fd0480840201a87b592b26c31d9247e84a0d", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230219231416.22524-9-stephen@networkplumber.org/mbox/", "series": [ { "id": 27076, "url": "http://patches.dpdk.org/api/series/27076/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27076", "date": "2023-02-19T23:14:07", "name": "Enable building more libraries on Windows", "version": 4, "mbox": "http://patches.dpdk.org/series/27076/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/124163/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/124163/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 0B1A541CE4;\n\tMon, 20 Feb 2023 00:15:08 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7976E42DBF;\n\tMon, 20 Feb 2023 00:14:36 +0100 (CET)", "from mail-pj1-f46.google.com (mail-pj1-f46.google.com\n [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 5035C42D8D\n for <dev@dpdk.org>; Mon, 20 Feb 2023 00:14:28 +0100 (CET)", "by mail-pj1-f46.google.com with SMTP id\n o10-20020a17090a744a00b00233ba727724so1258236pjk.1\n for <dev@dpdk.org>; Sun, 19 Feb 2023 15:14:28 -0800 (PST)", "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n l10-20020a170902d34a00b00192fe452e17sm683336plk.162.2023.02.19.15.14.26\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 19 Feb 2023 15:14:26 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=83D8iYul/29Bw+0iYP33DhWO1Z0u1oDFprj7fb/7FtA=;\n b=jRhq1YSL0TZVC6iJTPDlWRUb9CMwcFj34S3iiZUjhQ63SeUPC+dT5X5EaGSOgkwdCz\n /jXPEcPbQ06GZ6fAZU6ImXQ0BifwNUEn876aOJD/LGicirZZvKFiAB26nLXh+0o/fiMm\n pcpnUXJJPdEDMD0N903O4Hl5pTtcHsiufXoF1DWtcHj2ib5hEMpGTBxyCTnX8wORzq5G\n 482DcYcMncbh8wxmb1PbiOxA+zrOmG0/qTb39BTUwLbidQ50OBsq6rklCVphS5Vhl6o+\n MNxUMs485nwvYpxfi4zxZuI9WYfC+IQL9WqzGifWOH/DJXzAl90PY7OKnpbup3SiGc4F\n aADQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=83D8iYul/29Bw+0iYP33DhWO1Z0u1oDFprj7fb/7FtA=;\n b=dO4wc9/lF6OMdDLSB8dsWyrbGyluphCSHFiKeHO1sbiwfRXVwCtTKGi4M1pxjmppXj\n llsCH0d5QF+CRBOdmkhomK15Zi348YDb5wI/oUPQciLyp9KamKEl1gfnVRAb0UFqjwHJ\n rO04VXBzvOgNs+fgQZcCrCMHV1UnM9tx2CABqxHstM6VdpSJx5F0c6PzRGqnJM/0+kup\n aNWXTgGOt4xJy8cOKfmC69hdx578vYJkAYvlNORn7iekzFpQ3fp2tYaNsJRRafbSnOSE\n edGqpF0qaVsRBwcOJz8ZvxgCOyOitrtCMYf4nx+7qYgxPE4C21wgeePEs+Qdb0QM4Bzx\n Q+1A==", "X-Gm-Message-State": "AO0yUKUs/HCXLdm+pOSC2/ejRnAo2ppfvIUTcATw9TECCbg/8Rv2v28U\n VhCQ/jR0g6UJ9/HHJnv8ST7tW2+MfVEWEydUnNM=", "X-Google-Smtp-Source": "\n AK7set9RHvLAvVnqGqxwA6AmGpsX1v8RFAxSqbEZPP8GLTTrkTb7Rwqd3lqifH1SMca/+sm7a2V51g==", "X-Received": "by 2002:a17:902:da90:b0:19a:a9d8:e49f with SMTP id\n j16-20020a170902da9000b0019aa9d8e49fmr2781250plx.39.1676848467141;\n Sun, 19 Feb 2023 15:14:27 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n Reshma Pattan <reshma.pattan@intel.com>", "Subject": "[PATCH v4 8/9] pcapng: windows compatibility", "Date": "Sun, 19 Feb 2023 15:14:15 -0800", "Message-Id": "<20230219231416.22524-9-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.39.1", "In-Reply-To": "<20230219231416.22524-1-stephen@networkplumber.org>", "References": "<20230207001937.875608-1-stephen@networkplumber.org>\n <20230219231416.22524-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "Allow building on Windows, need to provide some comparability\nwrappers for writev() and if_nametoindex.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/pcapng/meson.build | 6 -----\n lib/pcapng/rte_pcapng.c | 59 +++++++++++++++++++++++++++++++++++++++--\n 2 files changed, 57 insertions(+), 8 deletions(-)", "diff": "diff --git a/lib/pcapng/meson.build b/lib/pcapng/meson.build\nindex da938bbcb733..4549925d41b6 100644\n--- a/lib/pcapng/meson.build\n+++ b/lib/pcapng/meson.build\n@@ -1,12 +1,6 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2019 Microsoft Corporation\n \n-if is_windows\n- build = false\n- reason = 'not supported on Windows'\n- subdir_done()\n-endif\n-\n sources = files('rte_pcapng.c')\n headers = files('rte_pcapng.h')\n \ndiff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c\nindex 65c8c77fa405..3c91fc77644a 100644\n--- a/lib/pcapng/rte_pcapng.c\n+++ b/lib/pcapng/rte_pcapng.c\n@@ -3,15 +3,18 @@\n */\n \n #include <errno.h>\n-#include <net/if.h>\n #include <stdbool.h>\n #include <stdio.h>\n #include <stdlib.h>\n #include <string.h>\n-#include <sys/uio.h>\n #include <time.h>\n #include <unistd.h>\n \n+#ifndef RTE_EXEC_ENV_WINDOWS\n+#include <net/if.h>\n+#include <sys/uio.h>\n+#endif\n+\n #include <bus_driver.h>\n #include <rte_common.h>\n #include <rte_cycles.h>\n@@ -20,6 +23,7 @@\n #include <rte_ethdev.h>\n #include <rte_ether.h>\n #include <rte_mbuf.h>\n+#include <rte_os_shim.h>\n #include <rte_pcapng.h>\n #include <rte_reciprocal.h>\n #include <rte_time.h>\n@@ -47,6 +51,57 @@ static struct pcapng_time {\n \tstruct rte_reciprocal_u64 tsc_hz_inverse;\n } pcapng_time;\n \n+\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+/*\n+ * Windows does not have writev() call.\n+ * Emulate this by copying to a new buffer.\n+ * The copy is necessary since pcapng needs to be thread-safe\n+ * and do atomic write operations.\n+ */\n+\n+#define IOV_MAX 128\n+struct iovec {\n+\tvoid *iov_base;\n+\tsize_t iov_len;\n+};\n+\n+static ssize_t writev(int fd, const struct iovec *iov, int iovcnt)\n+{\n+\tsize_t bytes = 0;\n+\tuint8_t *ptr;\n+\tvoid *tmp_buf;\n+\tssize_t ret;\n+\tint i;\n+\n+\tfor (i = 0; i < iovcnt; i++)\n+\t\tbytes += iov[i].iov_len;\n+\n+\tif (unlikely(bytes == 0))\n+\t\treturn 0;\n+\n+\ttmp_buf = malloc(bytes);\n+\tif (unlikely(tmp_buf == NULL)) {\n+\t\terrno = ENOMEM;\n+\t\treturn -1;\n+\t}\n+\n+\tptr = tmp_buf;\n+\tfor (i = 0; i < iovcnt; i++) {\n+\t\trte_memcpy(ptr, iov[i].iov_base, iov[i].iov_len);\n+\t\tptr += iov[i].iov_len;\n+\t}\n+\n+\tret = write(fd, tmp_buf, bytes);\n+\tfree(tmp_buf);\n+\treturn ret;\n+}\n+\n+#define IF_NAMESIZE\t16\n+/* compatibility wrapper because name is optional */\n+#define if_indextoname(ifindex, ifname) NULL\n+#endif\n+\n static inline void\n pcapng_init(void)\n {\n", "prefixes": [ "v4", "8/9" ] }{ "id": 124163, "url": "