get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 136552,
    "url": "http://patches.dpdk.org/api/patches/136552/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240208175051.326550-4-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": "<20240208175051.326550-4-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240208175051.326550-4-stephen@networkplumber.org",
    "date": "2024-02-08T17:41:27",
    "name": "[v3,3/7] tap: stop \"vendoring\" linux bpf headers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9e47e280026bc1889a5373d6d2c7e6068c2f3726",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240208175051.326550-4-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31056,
            "url": "http://patches.dpdk.org/api/series/31056/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31056",
            "date": "2024-02-08T17:41:24",
            "name": "net/tap: RSS using BPF overhaul",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/31056/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/136552/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/136552/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 9226A43AE1;\n\tThu,  8 Feb 2024 18:51:24 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D767242E4D;\n\tThu,  8 Feb 2024 18:51:06 +0100 (CET)",
            "from mail-pg1-f179.google.com (mail-pg1-f179.google.com\n [209.85.215.179])\n by mails.dpdk.org (Postfix) with ESMTP id 5829242E04\n for <dev@dpdk.org>; Thu,  8 Feb 2024 18:51:04 +0100 (CET)",
            "by mail-pg1-f179.google.com with SMTP id\n 41be03b00d2f7-5ca29c131ebso10774a12.0\n for <dev@dpdk.org>; Thu, 08 Feb 2024 09:51:04 -0800 (PST)",
            "from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141])\n by smtp.gmail.com with ESMTPSA id\n f19-20020a056a00229300b006dbda7bcf3csm5030pfe.83.2024.02.08.09.51.02\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 08 Feb 2024 09:51:03 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707414663;\n x=1708019463; 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=mP60+k5ZPeJeBS5jRMFk72yyTGUxHj9BuzlrQpIYSFE=;\n b=sGubokjAFtMv3POfLf2uohj8DKq749GOvPVDJ1dWtc9oOq9hDJhxW6UMxqtJFjLTP6\n f1H9nGegj3PXXx0IlLn7VNetdi50wF4+RputM73RDsa+UYELHYeWjegrXqh1ji2rBe6T\n FHwqdMP+7/C3wDKn8KyxmzoKl/TvjpkHX0uYj4lCkXaLyWAhNK57hdoxx47mIGtHivUJ\n lQQ/36r5KtoLtYCT+Zr1s39L6ehyL2R0wQaexRtmd4Rgsmj6DYR8OWiViaybwq6pGu2m\n 8tsu8lXhsmItQe0XAyljr/PEsTp2/FXDYjbP9wG32/KsJaP5/EYXcv9BsDNGDth0gn1F\n 4JlA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1707414663; x=1708019463;\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=mP60+k5ZPeJeBS5jRMFk72yyTGUxHj9BuzlrQpIYSFE=;\n b=vl1Bu9/fXQ2GU1QI+lTowE8GUlVzJNISJdnkmBheFS5i6z25niZ8EpRH6vWnc9KkN8\n NmYnVPWMe5lsEOLAx7j1PW7dbPqQf5prKki24dYZHqVp32y7mPhfuvSKxUBX0eh6bvDR\n VDCNz9ba/n9+ILmE688LMycouKEFnFzpzODMtMcDev8tzFroo5Lf0nd0H4gwqxGNaRRj\n cv02VGZ6eJ7rvwTv36rC75qPmPXWJ+3og2e69Y3Zkh8TDAG+Jr0S9JBVW5zrJF0DND/P\n P9neyUESLj/IZnghL9V1+M4x9Mz0biPjc2luNHgH2PfT1ZBYwwkYyuQWaVEXuq4ZbsBY\n QKnA==",
        "X-Gm-Message-State": "AOJu0Yyevpg8liTKb2JRpE1H5OQxa6XAnO3IHyt6o5U6y2R8oRllRbd3\n BHnk/S93dbsJzkBpIKXdixobBGYn1Rla5nlzUs2b6dbanhrm/PcqKDQCKyphBMPj9VJteylr9tp\n s4N0=",
        "X-Google-Smtp-Source": "\n AGHT+IGo5jDa8ezZXPxygnj6yIo4Na3PpgezcWRhe05JlzHSLfSaB5xVULfl1wzSEB7q7POWZXCNWg==",
        "X-Received": "by 2002:a05:6a21:610:b0:19e:99ce:6f99 with SMTP id\n ll16-20020a056a21061000b0019e99ce6f99mr248546pzb.44.1707414663476;\n Thu, 08 Feb 2024 09:51:03 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v3 3/7] tap: stop \"vendoring\" linux bpf headers",
        "Date": "Thu,  8 Feb 2024 09:41:27 -0800",
        "Message-ID": "<20240208175051.326550-4-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240208175051.326550-1-stephen@networkplumber.org>",
        "References": "<20240130034925.44869-1-stephen@networkplumber.org>\n <20240208175051.326550-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_bpf_insns.h    |   1 -\n drivers/net/tap/tap_flow.c         |  89 ---------------------\n 5 files changed, 13 insertions(+), 219 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 b630c42b809f..73c4dafe4eca 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 0d38bc111fe0..000000000000\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 15283f8917ed..9e05e2ddf19b 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_bpf_insns.h b/drivers/net/tap/tap_bpf_insns.h\nindex ee26cf885ed7..b59b7e9141fd 100644\n--- a/drivers/net/tap/tap_bpf_insns.h\n+++ b/drivers/net/tap/tap_bpf_insns.h\n@@ -3,7 +3,6 @@\n  * This not the original source file. Do NOT edit it.\n  */\n \n-#include <tap_bpf.h>\n \n static struct bpf_insn cls_q_insns[] = {\n \t{0x61,    2,    1,       52, 0x00000000},\ndiff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c\nindex cd49aa51c8b0..94436af55ce8 100644\n--- a/drivers/net/tap/tap_flow.c\n+++ b/drivers/net/tap/tap_flow.c\n@@ -20,95 +20,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": [
        "v3",
        "3/7"
    ]
}