get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2233027,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2233027/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260505-b4-flowtable-sw-accel-ip6ip-v1-1-9ac39ccc9ea9@kernel.org/",
    "project": {
        "id": 26,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/26/?format=api",
        "name": "Netfilter Development",
        "link_name": "netfilter-devel",
        "list_id": "netfilter-devel.vger.kernel.org",
        "list_email": "netfilter-devel@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260505-b4-flowtable-sw-accel-ip6ip-v1-1-9ac39ccc9ea9@kernel.org>",
    "list_archive_url": null,
    "date": "2026-05-05T14:49:23",
    "name": "[nf-next,1/4] net: netfilter: Add ether_type to net_device_path_ctx",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8e494a421c7517c018e3af11149b93dc158a8939",
    "submitter": {
        "id": 76007,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/76007/?format=api",
        "name": "Lorenzo Bianconi",
        "email": "lorenzo@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260505-b4-flowtable-sw-accel-ip6ip-v1-1-9ac39ccc9ea9@kernel.org/mbox/",
    "series": [
        {
            "id": 502850,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/502850/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=502850",
            "date": "2026-05-05T14:49:22",
            "name": "Add IPv4 over IPv6 flowtable SW acceleration",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502850/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2233027/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2233027/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-12442-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "netfilter-devel@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=FupM7kUm;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12442-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"FupM7kUm\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g91dc1Yx4z1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 00:50:12 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 87F21300D753\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  5 May 2026 14:50:05 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8EA4E480964;\n\tTue,  5 May 2026 14:50:00 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B0DF2264A9;\n\tTue,  5 May 2026 14:49:59 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 38827C2BCB4;\n\tTue,  5 May 2026 14:49:59 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777992600; cv=none;\n b=se54VSa20znmcBsGWSp1WAj5R/oKKbbrYoFudjzr2oHegyuNP/nfgAJ5OX8Gac2sLNj+GSJOpnnLhg7Wac3xblnaR9aejS6Iaw3atS7hfRjufo9lMAmTHNzoJo4UD5g5D/cr7/Y3lEhqQEnquU7QeiJnMViKruFDuDwlS37ikOA=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777992600; c=relaxed/simple;\n\tbh=Yhlce/SdxkXpy5t9rLO0dnkhFGqgTkkguCRTwXsGH0A=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=qUjdBRLdaGOUJ/2gALB9OqprNr03Jub6PZe3IRNvxsDCwsVE+J2ns+NmN0N7snqCxT91HlrPIc0kyD1LXP9HUsQlNFr56tTkgCUH7ldAuzRwGOmp89Rn4BapHYWBq6jGs/XPIR3ZR+sa1uFWbNd5ZKfReWNGaiHnMGt1h5P9yXw=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=FupM7kUm; arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777992599;\n\tbh=Yhlce/SdxkXpy5t9rLO0dnkhFGqgTkkguCRTwXsGH0A=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=FupM7kUmtfdCwCSLRwP9W3vBPwts37DtZygAl7pIGm4NwWQwl5DgQJ/WhtrdRcofM\n\t /A278Au6dev7spynsrllSpcWx0kjYoI87M1PE+zRK9+f2O3pWKoYD34D81UaNpYlZt\n\t rJO6rk6x44anra2tvaZyDAvulDkI3Z+jtaVb505kseAtWdcbZlTwOtntg44xTMd5aX\n\t gTd767+b84DG55hGswhi6W6/lmUpnNsNJBgTKLPnXuMyKY1k5K7vVR53mllWd8hsr9\n\t lcskIOAK4zGijbGALzqHgtO0hSw67nUynOtqabgCAJqk8D8xXIEcJqVj7IhzkvSghD\n\t 6m4+x9AfPM5OA==",
        "From": "Lorenzo Bianconi <lorenzo@kernel.org>",
        "Date": "Tue, 05 May 2026 16:49:23 +0200",
        "Subject": "[PATCH nf-next 1/4] net: netfilter: Add ether_type to\n net_device_path_ctx",
        "Precedence": "bulk",
        "X-Mailing-List": "netfilter-devel@vger.kernel.org",
        "List-Id": "<netfilter-devel.vger.kernel.org>",
        "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "\n <20260505-b4-flowtable-sw-accel-ip6ip-v1-1-9ac39ccc9ea9@kernel.org>",
        "References": "\n <20260505-b4-flowtable-sw-accel-ip6ip-v1-0-9ac39ccc9ea9@kernel.org>",
        "In-Reply-To": "\n <20260505-b4-flowtable-sw-accel-ip6ip-v1-0-9ac39ccc9ea9@kernel.org>",
        "To": "Andrew Lunn <andrew+netdev@lunn.ch>,\n \"David S. Miller\" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,\n Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,\n Felix Fietkau <nbd@nbd.name>, Matthias Brugger <matthias.bgg@gmail.com>,\n AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,\n Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,\n Ido Schimmel <idosch@nvidia.com>, Pablo Neira Ayuso <pablo@netfilter.org>,\n Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,\n Shuah Khan <shuah@kernel.org>",
        "Cc": "linux-arm-kernel@lists.infradead.org,\n linux-mediatek@lists.infradead.org, netdev@vger.kernel.org,\n netfilter-devel@vger.kernel.org, coreteam@netfilter.org,\n linux-kselftest@vger.kernel.org, Lorenzo Bianconi <lorenzo@kernel.org>",
        "X-Mailer": "b4 0.14.3"
    },
    "content": "Add an ether_type field to struct net_device_path_ctx to allow IPv6\ntunnel drivers to select the appropriate L3 protocol based on the\nencapsulated traffic.\nUpdate the airoha and mtk Ethernet drivers to use the new\ndev_fill_forward_path() signature.\nThis is a preliminary patch to enable sw flowtable acceleration for\nIPv4 over IPv6 tunnels.\n\nSigned-off-by: Lorenzo Bianconi <lorenzo@kernel.org>\n---\n drivers/net/ethernet/airoha/airoha_ppe.c        | 14 +++++++++-----\n drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 13 ++++++++-----\n include/linux/netdevice.h                       |  4 +++-\n net/core/dev.c                                  |  6 ++++--\n net/ipv6/ip6_tunnel.c                           |  5 ++++-\n net/netfilter/nf_flow_table_path.c              |  8 +++++---\n 6 files changed, 33 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c\nindex 26da519236bf..c5eccb3a43a1 100644\n--- a/drivers/net/ethernet/airoha/airoha_ppe.c\n+++ b/drivers/net/ethernet/airoha/airoha_ppe.c\n@@ -245,7 +245,8 @@ static int airoha_ppe_flow_mangle_ipv4(const struct flow_action_entry *act,\n \treturn 0;\n }\n \n-static int airoha_ppe_get_wdma_info(struct net_device *dev, const u8 *addr,\n+static int airoha_ppe_get_wdma_info(struct net_device *dev,\n+\t\t\t\t    const u8 *addr, __be16 ether_type,\n \t\t\t\t    struct airoha_wdma_info *info)\n {\n \tstruct net_device_path_stack stack;\n@@ -256,7 +257,7 @@ static int airoha_ppe_get_wdma_info(struct net_device *dev, const u8 *addr,\n \t\treturn -ENODEV;\n \n \trcu_read_lock();\n-\terr = dev_fill_forward_path(dev, addr, &stack);\n+\terr = dev_fill_forward_path(dev, addr, ether_type, &stack);\n \trcu_read_unlock();\n \tif (err)\n \t\treturn err;\n@@ -300,7 +301,7 @@ static int airoha_ppe_foe_entry_prepare(struct airoha_eth *eth,\n \t\t\t\t\tstruct airoha_foe_entry *hwe,\n \t\t\t\t\tstruct net_device *dev, int type,\n \t\t\t\t\tstruct airoha_flow_data *data,\n-\t\t\t\t\tint l4proto)\n+\t\t\t\t\t__be16 ether_type, int l4proto)\n {\n \tu32 qdata = FIELD_PREP(AIROHA_FOE_SHAPER_ID, 0x7f), ports_pad, val;\n \tint wlan_etype = -EINVAL, dsa_port = airoha_get_dsa_port(&dev);\n@@ -322,7 +323,8 @@ static int airoha_ppe_foe_entry_prepare(struct airoha_eth *eth,\n \tif (dev) {\n \t\tstruct airoha_wdma_info info = {};\n \n-\t\tif (!airoha_ppe_get_wdma_info(dev, data->eth.h_dest, &info)) {\n+\t\tif (!airoha_ppe_get_wdma_info(dev, data->eth.h_dest,\n+\t\t\t\t\t      ether_type, &info)) {\n \t\t\tval |= FIELD_PREP(AIROHA_FOE_IB2_NBQ, info.idx) |\n \t\t\t       FIELD_PREP(AIROHA_FOE_IB2_PSE_PORT,\n \t\t\t\t\t  FE_PSE_PORT_CDM4);\n@@ -1047,6 +1049,7 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth,\n \tstruct flow_action_entry *act;\n \tstruct airoha_foe_entry hwe;\n \tint err, i, offload_type;\n+\t__be16 ether_type = 0;\n \tu16 addr_type = 0;\n \tu8 l4proto = 0;\n \n@@ -1073,6 +1076,7 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth,\n \t\tstruct flow_match_basic match;\n \n \t\tflow_rule_match_basic(rule, &match);\n+\t\tether_type = match.key->n_proto;\n \t\tl4proto = match.key->ip_proto;\n \t} else {\n \t\treturn -EOPNOTSUPP;\n@@ -1143,7 +1147,7 @@ static int airoha_ppe_flow_offload_replace(struct airoha_eth *eth,\n \t\treturn -EINVAL;\n \n \terr = airoha_ppe_foe_entry_prepare(eth, &hwe, odev, offload_type,\n-\t\t\t\t\t   &data, l4proto);\n+\t\t\t\t\t   &data, ether_type, l4proto);\n \tif (err)\n \t\treturn err;\n \ndiff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c\nindex cc8c4ef8038f..2601c17b29c8 100644\n--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c\n+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c\n@@ -89,7 +89,8 @@ mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth)\n }\n \n static int\n-mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr, struct mtk_wdma_info *info)\n+mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr,\n+\t\t       __be16 ether_type, struct mtk_wdma_info *info)\n {\n \tstruct net_device_path_stack stack;\n \tstruct net_device_path *path;\n@@ -102,7 +103,7 @@ mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr, struct mtk_wdma_i\n \t\treturn -1;\n \n \trcu_read_lock();\n-\terr = dev_fill_forward_path(dev, addr, &stack);\n+\terr = dev_fill_forward_path(dev, addr, ether_type, &stack);\n \trcu_read_unlock();\n \tif (err)\n \t\treturn err;\n@@ -190,12 +191,12 @@ mtk_flow_get_dsa_port(struct net_device **dev)\n static int\n mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe,\n \t\t\t   struct net_device *dev, const u8 *dest_mac,\n-\t\t\t   int *wed_index)\n+\t\t\t   __be16 ether_type, int *wed_index)\n {\n \tstruct mtk_wdma_info info = {};\n \tint pse_port, dsa_port, queue;\n \n-\tif (mtk_flow_get_wdma_info(dev, dest_mac, &info) == 0) {\n+\tif (mtk_flow_get_wdma_info(dev, dest_mac, ether_type, &info) == 0) {\n \t\tmtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue,\n \t\t\t\t       info.bss, info.wcid, info.amsdu);\n \t\tif (mtk_is_netsys_v2_or_greater(eth)) {\n@@ -273,6 +274,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,\n \tstruct mtk_flow_data data = {};\n \tstruct mtk_foe_entry foe;\n \tstruct mtk_flow_entry *entry;\n+\t__be16 ether_type = 0;\n \tint offload_type = 0;\n \tint wed_index = -1;\n \tu16 addr_type = 0;\n@@ -319,6 +321,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,\n \t\tstruct flow_match_basic match;\n \n \t\tflow_rule_match_basic(rule, &match);\n+\t\tether_type = match.key->n_proto;\n \t\tl4proto = match.key->ip_proto;\n \t} else {\n \t\treturn -EOPNOTSUPP;\n@@ -481,7 +484,7 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,\n \t\tmtk_foe_entry_set_pppoe(eth, &foe, data.pppoe.sid);\n \n \terr = mtk_flow_set_output_device(eth, &foe, odev, data.eth.h_dest,\n-\t\t\t\t\t &wed_index);\n+\t\t\t\t\t ether_type, &wed_index);\n \tif (err)\n \t\treturn err;\n \ndiff --git a/include/linux/netdevice.h b/include/linux/netdevice.h\nindex 744ffa243501..85bd9d46b5a0 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -938,6 +938,7 @@ struct net_device_path_stack {\n struct net_device_path_ctx {\n \tconst struct net_device *dev;\n \tu8\t\t\tdaddr[ETH_ALEN];\n+\t__be16\t\t\tether_type;\n \n \tint\t\t\tnum_vlans;\n \tstruct {\n@@ -3391,7 +3392,8 @@ void dev_remove_offload(struct packet_offload *po);\n \n int dev_get_iflink(const struct net_device *dev);\n int dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb);\n-int dev_fill_forward_path(const struct net_device *dev, const u8 *daddr,\n+int dev_fill_forward_path(const struct net_device *dev,\n+\t\t\t  const u8 *daddr, __be16 ether_type,\n \t\t\t  struct net_device_path_stack *stack);\n struct net_device *dev_get_by_name(struct net *net, const char *name);\n struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);\ndiff --git a/net/core/dev.c b/net/core/dev.c\nindex 06c195906231..5f6171c08849 100644\n--- a/net/core/dev.c\n+++ b/net/core/dev.c\n@@ -750,12 +750,14 @@ static struct net_device_path *dev_fwd_path(struct net_device_path_stack *stack)\n \treturn &stack->path[k];\n }\n \n-int dev_fill_forward_path(const struct net_device *dev, const u8 *daddr,\n+int dev_fill_forward_path(const struct net_device *dev,\n+\t\t\t  const u8 *daddr, __be16 ether_type,\n \t\t\t  struct net_device_path_stack *stack)\n {\n \tconst struct net_device *last_dev;\n \tstruct net_device_path_ctx ctx = {\n-\t\t.dev\t= dev,\n+\t\t.dev\t\t= dev,\n+\t\t.ether_type\t= ether_type,\n \t};\n \tstruct net_device_path *path;\n \tint ret = 0;\ndiff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c\nindex c468c83af0f2..3d64e672eeee 100644\n--- a/net/ipv6/ip6_tunnel.c\n+++ b/net/ipv6/ip6_tunnel.c\n@@ -1851,7 +1851,10 @@ static int ip6_tnl_fill_forward_path(struct net_device_path_ctx *ctx,\n \t\tpath->type = DEV_PATH_TUN;\n \t\tpath->tun.src_v6 = t->parms.laddr;\n \t\tpath->tun.dst_v6 = t->parms.raddr;\n-\t\tpath->tun.l3_proto = IPPROTO_IPV6;\n+\t\tif (ctx->ether_type == cpu_to_be16(ETH_P_IP))\n+\t\t\tpath->tun.l3_proto = IPPROTO_IPIP;\n+\t\telse\n+\t\t\tpath->tun.l3_proto = IPPROTO_IPV6;\n \t\tpath->dev = ctx->dev;\n \t\tctx->dev = dst->dev;\n \t}\ndiff --git a/net/netfilter/nf_flow_table_path.c b/net/netfilter/nf_flow_table_path.c\nindex 6bb9579dcc2a..df4e180ed3c2 100644\n--- a/net/netfilter/nf_flow_table_path.c\n+++ b/net/netfilter/nf_flow_table_path.c\n@@ -45,7 +45,8 @@ static bool nft_is_valid_ether_device(const struct net_device *dev)\n static int nft_dev_fill_forward_path(const struct nf_flow_route *route,\n \t\t\t\t     const struct dst_entry *dst_cache,\n \t\t\t\t     const struct nf_conn *ct,\n-\t\t\t\t     enum ip_conntrack_dir dir, u8 *ha,\n+\t\t\t\t     enum ip_conntrack_dir dir,\n+\t\t\t\t     u8 *ha, __be16 ether_type,\n \t\t\t\t     struct net_device_path_stack *stack)\n {\n \tconst void *daddr = &ct->tuplehash[!dir].tuple.src.u3;\n@@ -70,7 +71,7 @@ static int nft_dev_fill_forward_path(const struct nf_flow_route *route,\n \t\treturn -1;\n \n out:\n-\treturn dev_fill_forward_path(dev, ha, stack);\n+\treturn dev_fill_forward_path(dev, ha, ether_type, stack);\n }\n \n struct nft_forward_info {\n@@ -248,7 +249,8 @@ static void nft_dev_forward_path(const struct nft_pktinfo *pkt,\n \tunsigned char ha[ETH_ALEN];\n \tint i;\n \n-\tif (nft_dev_fill_forward_path(route, dst, ct, dir, ha, &stack) >= 0)\n+\tif (nft_dev_fill_forward_path(route, dst, ct, dir, ha, pkt->ethertype,\n+\t\t\t\t      &stack) >= 0)\n \t\tnft_dev_path_info(&stack, &info, ha, &ft->data);\n \n \tif (info.outdev)\n",
    "prefixes": [
        "nf-next",
        "1/4"
    ]
}