get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/139027/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 139027,
    "url": "http://patchwork.dpdk.org/api/patches/139027/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240402171751.138324-6-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240402171751.138324-6-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240402171751.138324-6-stephen@networkplumber.org",
    "date": "2024-04-02T17:12:37",
    "name": "[v5,5/8] net/tap: stop \"vendoring\" linux bpf headers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3d666026fd00f0773a99b7f9522a08d1452dc18a",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240402171751.138324-6-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31657,
            "url": "http://patchwork.dpdk.org/api/series/31657/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31657",
            "date": "2024-04-02T17:12:32",
            "name": "net/tap: cleanups and fix BPF flow",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/31657/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139027/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139027/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 DF56B43DC3;\n\tTue,  2 Apr 2024 19:18:32 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 33D9D4068E;\n\tTue,  2 Apr 2024 19:18:02 +0200 (CEST)",
            "from mail-pl1-f180.google.com (mail-pl1-f180.google.com\n [209.85.214.180])\n by mails.dpdk.org (Postfix) with ESMTP id 2B86D4064A\n for <dev@dpdk.org>; Tue,  2 Apr 2024 19:17:58 +0200 (CEST)",
            "by mail-pl1-f180.google.com with SMTP id\n d9443c01a7336-1e0411c0a52so45691845ad.0\n for <dev@dpdk.org>; Tue, 02 Apr 2024 10:17:58 -0700 (PDT)",
            "from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n q15-20020a170902a3cf00b001e264b50964sm2219815plb.205.2024.04.02.10.17.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 02 Apr 2024 10:17:56 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712078277;\n x=1712683077; darn=dpdk.org;\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=fxMT1Q+dWMqhkfuzpplrDE8kvKhNXsbKAqFkf2RexRc=;\n b=TkaqciZ2jpH2s80QuimlTE1v6//tNkJMHuvBDgOIsfb3Pbe8J/fsIDJ2n6QgmR7E5G\n +tvTgkBdzFRXvFRHsPTHqyt80M+4Kd/CpqurBIf2YetAaY5Srl1Ee5B8QWlgSFsp980h\n r1n5Q58WwBaId0pKhuIrhn1OBGJlOOI3XZTgAjDQLCuoSpWCcVWdw2ITJRl1mhYFt1Fy\n j5EoSJKJmdu3UMzuDdqs+tW/ZblpunC+et2T9ze4trqpfEsezqaJ616c5G+CT6E4aZf/\n 9Oh8D0emfRStfDPBx8AnylLrQtVeeKekuMrEaI0vN4HWNz5hB3Ah6FfYFkvT0wmUp2L2\n pacg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1712078277; x=1712683077;\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=fxMT1Q+dWMqhkfuzpplrDE8kvKhNXsbKAqFkf2RexRc=;\n b=P1LQclCYz254PUjv61G3xvZu4tNzNk92bb1tPaEHOVttivkPP4UVbq3ncgW7o9sGvc\n xHLGTAynBFT6cpx1Q1e7ONjifWfbXuZWCfUySy/KnduSQ0JJXT/2tVsqLwetZtwtW/1M\n qiJEWmnWzb24KWN/lkwySS716umzO7aMt5KEQqKAfzzDEV1dChGu+a3BegWOxl6KBqSg\n obcMioDBfUSpUGhMYqlDWcfDJbOK0AJ3HqM2Pvtgx4vGC2lUH2qdv8KxmIIR8UEwCk2K\n RO17jPJs+vF7Smi3YE0jfu1JfZY6vzBr6p4tCWgZK/SQ4yMeMxbqHO5JFPY6rVEBjwsv\n FoUw==",
        "X-Gm-Message-State": "AOJu0Yw8b4pkHhN9lynuPtX3TL9/GLIEYRfV+HSjNrxrrn4S0f/781cz\n 9U/zAxm+Jutm0fwl8tsRKwT4oroSdldbfsp+jYkOR1bS+kh3rOjX1M8c64DZn0rexHEcsSrGJQU\n 5",
        "X-Google-Smtp-Source": "\n AGHT+IF/3olFrwQlXH8wSnJWwIt8uGfUKXP7SuI84/2VtJBinf+l7rtIfdzxuuqOOduVhxxjd6B3ZQ==",
        "X-Received": "by 2002:a17:902:bcc2:b0:1e0:b9d0:f6b with SMTP id\n o2-20020a170902bcc200b001e0b9d00f6bmr9969938pls.68.1712078277340;\n Tue, 02 Apr 2024 10:17:57 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v5 5/8] net/tap: stop \"vendoring\" linux bpf headers",
        "Date": "Tue,  2 Apr 2024 10:12:37 -0700",
        "Message-ID": "<20240402171751.138324-6-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240402171751.138324-1-stephen@networkplumber.org>",
        "References": "<20240130034925.44869-1-stephen@networkplumber.org>\n <20240402171751.138324-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": "The proper place for finding bpf structures and functions is\nin linux/bpf.h. The original version was trying to workaround the\ncase where the build environment was running on old pre BPF\nversion of Glibc, but the target environment had BPF. This is not\na supportable build method, and not how rest of DPDK works.\n\nHaving own private (and divergent) version headers leads to future\nproblems when BPF definitions evolve.\n\nSince DPDK officially supports only LTS or later kernel\nthere is no need for the #ifdef workarounds in the TAP flow\ncode. Cloning headers leads to problems and no longer needed.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/net/tap/bpf/bpf_extract.py |   1 -\n drivers/net/tap/tap_bpf.h          | 121 -----------------------------\n drivers/net/tap/tap_bpf_api.c      |  20 +++--\n drivers/net/tap/tap_flow.c         |  89 ---------------------\n 4 files changed, 13 insertions(+), 218 deletions(-)\n delete mode 100644 drivers/net/tap/tap_bpf.h",
    "diff": "diff --git a/drivers/net/tap/bpf/bpf_extract.py b/drivers/net/tap/bpf/bpf_extract.py\nindex b630c42b80..73c4dafe4e 100644\n--- a/drivers/net/tap/bpf/bpf_extract.py\n+++ b/drivers/net/tap/bpf/bpf_extract.py\n@@ -65,7 +65,6 @@ def write_header(out, source):\n         print(f' * Auto-generated from {source}', file=out)\n     print(\" * This not the original source file. Do NOT edit it.\", file=out)\n     print(\" */\\n\", file=out)\n-    print(\"#include <tap_bpf.h>\", file=out)\n \n \n def main():\ndiff --git a/drivers/net/tap/tap_bpf.h b/drivers/net/tap/tap_bpf.h\ndeleted file mode 100644\nindex 0d38bc111f..0000000000\n--- a/drivers/net/tap/tap_bpf.h\n+++ /dev/null\n@@ -1,121 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0\n- * Copyright 2017 Mellanox Technologies, Ltd\n- */\n-\n-#ifndef __TAP_BPF_H__\n-#define __TAP_BPF_H__\n-\n-#include <tap_autoconf.h>\n-\n-/* Do not #include <linux/bpf.h> since eBPF must compile on different\n- * distros which may include partial definitions for eBPF (while the\n- * kernel itself may support eBPF). Instead define here all that is needed\n- */\n-\n-/* BPF_MAP_UPDATE_ELEM command flags */\n-#define\tBPF_ANY\t0 /* create a new element or update an existing */\n-\n-/* BPF architecture instruction struct */\n-struct bpf_insn {\n-\t__u8\tcode;\n-\t__u8\tdst_reg:4;\n-\t__u8\tsrc_reg:4;\n-\t__s16\toff;\n-\t__s32\timm; /* immediate value */\n-};\n-\n-/* BPF program types */\n-enum bpf_prog_type {\n-\tBPF_PROG_TYPE_UNSPEC,\n-\tBPF_PROG_TYPE_SOCKET_FILTER,\n-\tBPF_PROG_TYPE_KPROBE,\n-\tBPF_PROG_TYPE_SCHED_CLS,\n-\tBPF_PROG_TYPE_SCHED_ACT,\n-};\n-\n-/* BPF commands types */\n-enum bpf_cmd {\n-\tBPF_MAP_CREATE,\n-\tBPF_MAP_LOOKUP_ELEM,\n-\tBPF_MAP_UPDATE_ELEM,\n-\tBPF_MAP_DELETE_ELEM,\n-\tBPF_MAP_GET_NEXT_KEY,\n-\tBPF_PROG_LOAD,\n-};\n-\n-/* BPF maps types */\n-enum bpf_map_type {\n-\tBPF_MAP_TYPE_UNSPEC,\n-\tBPF_MAP_TYPE_HASH,\n-};\n-\n-/* union of anonymous structs used with TAP BPF commands */\n-union bpf_attr {\n-\t/* BPF_MAP_CREATE command */\n-\tstruct {\n-\t\t__u32\tmap_type;\n-\t\t__u32\tkey_size;\n-\t\t__u32\tvalue_size;\n-\t\t__u32\tmax_entries;\n-\t\t__u32\tmap_flags;\n-\t\t__u32\tinner_map_fd;\n-\t};\n-\n-\t/* BPF_MAP_UPDATE_ELEM, BPF_MAP_DELETE_ELEM commands */\n-\tstruct {\n-\t\t__u32\t\tmap_fd;\n-\t\t__aligned_u64\tkey;\n-\t\tunion {\n-\t\t\t__aligned_u64 value;\n-\t\t\t__aligned_u64 next_key;\n-\t\t};\n-\t\t__u64\t\tflags;\n-\t};\n-\n-\t/* BPF_PROG_LOAD command */\n-\tstruct {\n-\t\t__u32\t\tprog_type;\n-\t\t__u32\t\tinsn_cnt;\n-\t\t__aligned_u64\tinsns;\n-\t\t__aligned_u64\tlicense;\n-\t\t__u32\t\tlog_level;\n-\t\t__u32\t\tlog_size;\n-\t\t__aligned_u64\tlog_buf;\n-\t\t__u32\t\tkern_version;\n-\t\t__u32\t\tprog_flags;\n-\t};\n-} __rte_aligned(8);\n-\n-#ifndef __NR_bpf\n-# if defined(__i386__)\n-#  define __NR_bpf 357\n-# elif defined(__x86_64__)\n-#  define __NR_bpf 321\n-# elif defined(__arm__)\n-#  define __NR_bpf 386\n-# elif defined(__aarch64__)\n-#  define __NR_bpf 280\n-# elif defined(__sparc__)\n-#  define __NR_bpf 349\n-# elif defined(__s390__)\n-#  define __NR_bpf 351\n-# elif defined(__powerpc__)\n-#  define __NR_bpf 361\n-# elif defined(__riscv)\n-#  define __NR_bpf 280\n-# elif defined(__loongarch__)\n-#  define __NR_bpf 280\n-# else\n-#  error __NR_bpf not defined\n-# endif\n-#endif\n-\n-enum {\n-\tBPF_MAP_ID_KEY,\n-\tBPF_MAP_ID_SIMPLE,\n-};\n-\n-static int bpf_load(enum bpf_prog_type type, const struct bpf_insn *insns,\n-\t\tsize_t insns_cnt, const char *license);\n-\n-#endif /* __TAP_BPF_H__ */\ndiff --git a/drivers/net/tap/tap_bpf_api.c b/drivers/net/tap/tap_bpf_api.c\nindex 15283f8917..9e05e2ddf1 100644\n--- a/drivers/net/tap/tap_bpf_api.c\n+++ b/drivers/net/tap/tap_bpf_api.c\n@@ -2,19 +2,19 @@\n  * Copyright 2017 Mellanox Technologies, Ltd\n  */\n \n-#include <errno.h>\n-#include <string.h>\n #include <unistd.h>\n-#include <sys/queue.h>\n+#include <syscall.h>\n+#include <linux/bpf.h>\n \n-#include <rte_malloc.h>\n-#include <rte_eth_tap.h>\n #include <tap_flow.h>\n #include <tap_autoconf.h>\n-#include <tap_tcmsgs.h>\n-#include <tap_bpf.h>\n+\n #include <tap_bpf_insns.h>\n \n+\n+static int bpf_load(enum bpf_prog_type type, const struct bpf_insn *insns,\n+\t\tsize_t insns_cnt, const char *license);\n+\n /**\n  * Load BPF program (section cls_q) into the kernel and return a bpf fd\n  *\n@@ -89,7 +89,13 @@ static inline __u64 ptr_to_u64(const void *ptr)\n static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,\n \t\t\tunsigned int size)\n {\n+#ifdef __NR_bpf\n \treturn syscall(__NR_bpf, cmd, attr, size);\n+#else\n+\tTAP_LOG(ERR, \"No bpf syscall, kernel headers too old?\\n\");\n+\terrno = ENOSYS;\n+\treturn -1;\n+#endif\n }\n \n /**\ndiff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c\nindex 7033e8411f..e154ea0ae0 100644\n--- a/drivers/net/tap/tap_flow.c\n+++ b/drivers/net/tap/tap_flow.c\n@@ -21,95 +21,6 @@\n #include <tap_tcmsgs.h>\n #include <tap_rss.h>\n \n-#ifndef HAVE_TC_FLOWER\n-/*\n- * For kernels < 4.2, this enum is not defined. Runtime checks will be made to\n- * avoid sending TC messages the kernel cannot understand.\n- */\n-enum {\n-\tTCA_FLOWER_UNSPEC,\n-\tTCA_FLOWER_CLASSID,\n-\tTCA_FLOWER_INDEV,\n-\tTCA_FLOWER_ACT,\n-\tTCA_FLOWER_KEY_ETH_DST,         /* ETH_ALEN */\n-\tTCA_FLOWER_KEY_ETH_DST_MASK,    /* ETH_ALEN */\n-\tTCA_FLOWER_KEY_ETH_SRC,         /* ETH_ALEN */\n-\tTCA_FLOWER_KEY_ETH_SRC_MASK,    /* ETH_ALEN */\n-\tTCA_FLOWER_KEY_ETH_TYPE,        /* be16 */\n-\tTCA_FLOWER_KEY_IP_PROTO,        /* u8 */\n-\tTCA_FLOWER_KEY_IPV4_SRC,        /* be32 */\n-\tTCA_FLOWER_KEY_IPV4_SRC_MASK,   /* be32 */\n-\tTCA_FLOWER_KEY_IPV4_DST,        /* be32 */\n-\tTCA_FLOWER_KEY_IPV4_DST_MASK,   /* be32 */\n-\tTCA_FLOWER_KEY_IPV6_SRC,        /* struct in6_addr */\n-\tTCA_FLOWER_KEY_IPV6_SRC_MASK,   /* struct in6_addr */\n-\tTCA_FLOWER_KEY_IPV6_DST,        /* struct in6_addr */\n-\tTCA_FLOWER_KEY_IPV6_DST_MASK,   /* struct in6_addr */\n-\tTCA_FLOWER_KEY_TCP_SRC,         /* be16 */\n-\tTCA_FLOWER_KEY_TCP_DST,         /* be16 */\n-\tTCA_FLOWER_KEY_UDP_SRC,         /* be16 */\n-\tTCA_FLOWER_KEY_UDP_DST,         /* be16 */\n-};\n-#endif\n-#ifndef HAVE_TC_VLAN_ID\n-enum {\n-\t/* TCA_FLOWER_FLAGS, */\n-\tTCA_FLOWER_KEY_VLAN_ID = TCA_FLOWER_KEY_UDP_DST + 2, /* be16 */\n-\tTCA_FLOWER_KEY_VLAN_PRIO,       /* u8   */\n-\tTCA_FLOWER_KEY_VLAN_ETH_TYPE,   /* be16 */\n-};\n-#endif\n-/*\n- * For kernels < 4.2 BPF related enums may not be defined.\n- * Runtime checks will be carried out to gracefully report on TC messages that\n- * are rejected by the kernel. Rejection reasons may be due to:\n- * 1. enum is not defined\n- * 2. enum is defined but kernel is not configured to support BPF system calls,\n- *    BPF classifications or BPF actions.\n- */\n-#ifndef HAVE_TC_BPF\n-enum {\n-\tTCA_BPF_UNSPEC,\n-\tTCA_BPF_ACT,\n-\tTCA_BPF_POLICE,\n-\tTCA_BPF_CLASSID,\n-\tTCA_BPF_OPS_LEN,\n-\tTCA_BPF_OPS,\n-};\n-#endif\n-#ifndef HAVE_TC_BPF_FD\n-enum {\n-\tTCA_BPF_FD = TCA_BPF_OPS + 1,\n-\tTCA_BPF_NAME,\n-};\n-#endif\n-#ifndef HAVE_TC_ACT_BPF\n-#define tc_gen \\\n-\t__u32                 index; \\\n-\t__u32                 capab; \\\n-\tint                   action; \\\n-\tint                   refcnt; \\\n-\tint                   bindcnt\n-\n-struct tc_act_bpf {\n-\ttc_gen;\n-};\n-\n-enum {\n-\tTCA_ACT_BPF_UNSPEC,\n-\tTCA_ACT_BPF_TM,\n-\tTCA_ACT_BPF_PARMS,\n-\tTCA_ACT_BPF_OPS_LEN,\n-\tTCA_ACT_BPF_OPS,\n-};\n-\n-#endif\n-#ifndef HAVE_TC_ACT_BPF_FD\n-enum {\n-\tTCA_ACT_BPF_FD = TCA_ACT_BPF_OPS + 1,\n-\tTCA_ACT_BPF_NAME,\n-};\n-#endif\n \n /* RSS key management */\n enum bpf_rss_key_e {\n",
    "prefixes": [
        "v5",
        "5/8"
    ]
}