Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/852533/?format=api
{ "id": 852533, "url": "http://patchwork.ozlabs.org/api/patches/852533/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20171222192732.13188-6-pablo@netfilter.org/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20171222192732.13188-6-pablo@netfilter.org>", "list_archive_url": null, "date": "2017-12-22T19:27:30", "name": "[nf-next,v3,5/7] netfilter: flow table support for the mixed IPv4/IPv6 family", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "4f907c84533adfff1a7a49b79512ea10e3a016d7", "submitter": { "id": 1315, "url": "http://patchwork.ozlabs.org/api/people/1315/?format=api", "name": "Pablo Neira Ayuso", "email": "pablo@netfilter.org" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20171222192732.13188-6-pablo@netfilter.org/mbox/", "series": [ { "id": 20090, "url": "http://patchwork.ozlabs.org/api/series/20090/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=20090", "date": "2017-12-22T19:27:25", "name": "Flow offload infrastructure", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/20090/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/852533/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/852533/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3z3JTB3H9Sz9s7n\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 23 Dec 2017 06:28:30 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756841AbdLVT22 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Dec 2017 14:28:28 -0500", "from mail.us.es ([193.147.175.20]:42388 \"EHLO mail.us.es\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1756756AbdLVT2J (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 22 Dec 2017 14:28:09 -0500", "from antivirus1-rhel7.int (unknown [192.168.2.11])\n\tby mail.us.es (Postfix) with ESMTP id 621CEEBAC7\n\tfor <netdev@vger.kernel.org>; Fri, 22 Dec 2017 20:28:07 +0100 (CET)", "from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 4DE59F730E\n\tfor <netdev@vger.kernel.org>; Fri, 22 Dec 2017 20:28:07 +0100 (CET)", "by antivirus1-rhel7.int (Postfix, from userid 99)\n\tid 4CEDFF7316; Fri, 22 Dec 2017 20:28:07 +0100 (CET)", "from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 17A75F7313;\n\tFri, 22 Dec 2017 20:28:05 +0100 (CET)", "from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int\n\t(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); \n\tFri, 22 Dec 2017 20:28:05 +0100 (CET)", "from salvia.here (129.166.216.87.static.jazztel.es\n\t[87.216.166.129]) (Authenticated sender: pneira@us.es)\n\tby entrada.int (Postfix) with ESMTPA id 477A24265A31;\n\tFri, 22 Dec 2017 20:28:04 +0100 (CET)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.1 (2015-04-28) on\n\tantivirus1-rhel7.int", "X-Spam-Level": "", "X-Spam-Status": "No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50,\n\tSMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1", "X-Virus-Status": "clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int)", "X-SMTPAUTHUS": "auth mail.us.es", "From": "Pablo Neira Ayuso <pablo@netfilter.org>", "To": "netfilter-devel@vger.kernel.org", "Cc": "netdev@vger.kernel.org, f.fainelli@gmail.com,\n\tsimon.horman@netronome.com, ronye@mellanox.com, jiri@mellanox.com,\n\tnbd@nbd.name, john@phrozen.org, kubakici@wp.pl, fw@strlen.de", "Subject": "[PATCH nf-next,\n\tv3 5/7] netfilter: flow table support for the mixed IPv4/IPv6 family", "Date": "Fri, 22 Dec 2017 20:27:30 +0100", "Message-Id": "<20171222192732.13188-6-pablo@netfilter.org>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20171222192732.13188-1-pablo@netfilter.org>", "References": "<20171222192732.13188-1-pablo@netfilter.org>", "X-Virus-Scanned": "ClamAV using ClamSMTP", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch adds the IPv6 flow table type, that implements the datapath\nflow table to forward IPv6 traffic.\n\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n include/net/netfilter/nf_flow_table.h | 5 ++++\n net/ipv4/netfilter/nf_flow_table_ipv4.c | 3 ++-\n net/ipv6/netfilter/nf_flow_table_ipv6.c | 3 ++-\n net/netfilter/Kconfig | 8 ++++++\n net/netfilter/nf_flow_table_inet.c | 48 +++++++++++++++++++++++++++++++++\n 5 files changed, 65 insertions(+), 2 deletions(-)\n create mode 100644 net/netfilter/nf_flow_table_inet.c", "diff": "diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h\nindex 161f71ca78a0..b22b22082733 100644\n--- a/include/net/netfilter/nf_flow_table.h\n+++ b/include/net/netfilter/nf_flow_table.h\n@@ -111,6 +111,11 @@ struct flow_ports {\n \t__be16 source, dest;\n };\n \n+unsigned int nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,\n+\t\t\t\t const struct nf_hook_state *state);\n+unsigned int nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,\n+\t\t\t\t const struct nf_hook_state *state);\n+\n #define MODULE_ALIAS_NF_FLOWTABLE(family)\t\\\n \tMODULE_ALIAS(\"nf-flowtable-\" __stringify(family))\n \ndiff --git a/net/ipv4/netfilter/nf_flow_table_ipv4.c b/net/ipv4/netfilter/nf_flow_table_ipv4.c\nindex ac56c0f0492a..b2d01eb25f2c 100644\n--- a/net/ipv4/netfilter/nf_flow_table_ipv4.c\n+++ b/net/ipv4/netfilter/nf_flow_table_ipv4.c\n@@ -202,7 +202,7 @@ static bool nf_flow_exceeds_mtu(struct sk_buff *skb, const struct rtable *rt)\n \treturn false;\n }\n \n-static unsigned int\n+unsigned int\n nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,\n \t\t\tconst struct nf_hook_state *state)\n {\n@@ -254,6 +254,7 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,\n \n \treturn NF_STOLEN;\n }\n+EXPORT_SYMBOL_GPL(nf_flow_offload_ip_hook);\n \n static struct nf_flowtable_type flowtable_ipv4 = {\n \t.family\t\t= NFPROTO_IPV4,\ndiff --git a/net/ipv6/netfilter/nf_flow_table_ipv6.c b/net/ipv6/netfilter/nf_flow_table_ipv6.c\nindex ab78703154d8..021209be0c3c 100644\n--- a/net/ipv6/netfilter/nf_flow_table_ipv6.c\n+++ b/net/ipv6/netfilter/nf_flow_table_ipv6.c\n@@ -196,7 +196,7 @@ static bool nf_flow_exceeds_mtu(struct sk_buff *skb, const struct rt6_info *rt)\n \treturn false;\n }\n \n-static unsigned int\n+unsigned int\n nf_flow_ipv6_offload_hook(void *priv, struct sk_buff *skb,\n \t\t\t const struct nf_hook_state *state)\n {\n@@ -248,6 +248,7 @@ nf_flow_ipv6_offload_hook(void *priv, struct sk_buff *skb,\n \n \treturn NF_STOLEN;\n }\n+EXPORT_SYMBOL_GPL(nf_flow_ipv6_offload_hook);\n \n static struct nf_flowtable_type flowtable_ipv6 = {\n \t.family\t\t= NFPROTO_IPV6,\ndiff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig\nindex af0f58322515..0c6256db5a6c 100644\n--- a/net/netfilter/Kconfig\n+++ b/net/netfilter/Kconfig\n@@ -649,6 +649,14 @@ endif # NF_TABLES_NETDEV\n \n endif # NF_TABLES\n \n+config NF_FLOW_TABLE_INET\n+\tselect NF_FLOW_TABLE\n+\ttristate \"Netfilter flow table mixed IPv4/IPv6 module\"\n+\thelp\n+ This option adds the flow table mixed IPv4/IPv6 support.\n+\n+\t To compile it as a module, choose M here.\n+\n config NF_FLOW_TABLE\n \ttristate \"Netfilter flow table module\"\n \thelp\ndiff --git a/net/netfilter/nf_flow_table_inet.c b/net/netfilter/nf_flow_table_inet.c\nnew file mode 100644\nindex 000000000000..281209aeba8f\n--- /dev/null\n+++ b/net/netfilter/nf_flow_table_inet.c\n@@ -0,0 +1,48 @@\n+#include <linux/kernel.h>\n+#include <linux/init.h>\n+#include <linux/module.h>\n+#include <linux/netfilter.h>\n+#include <linux/rhashtable.h>\n+#include <net/netfilter/nf_flow_table.h>\n+#include <net/netfilter/nf_tables.h>\n+\n+static unsigned int\n+nf_flow_offload_inet_hook(void *priv, struct sk_buff *skb,\n+\t\t\t const struct nf_hook_state *state)\n+{\n+\tswitch (skb->protocol) {\n+\tcase htons(ETH_P_IP):\n+\t\treturn nf_flow_offload_ip_hook(priv, skb, state);\n+\tcase htons(ETH_P_IPV6):\n+\t\treturn nf_flow_offload_ipv6_hook(priv, skb, state);\n+\t}\n+\n+\treturn NF_ACCEPT;\n+}\n+\n+static struct nf_flowtable_type flowtable_inet = {\n+\t.family\t\t= NFPROTO_INET,\n+\t.params\t\t= &nf_flow_offload_rhash_params,\n+\t.gc\t\t= nf_flow_offload_work_gc,\n+\t.hook\t\t= nf_flow_offload_inet_hook,\n+\t.owner\t\t= THIS_MODULE,\n+};\n+\n+static int __init nf_flow_inet_module_init(void)\n+{\n+\tnft_register_flowtable_type(&flowtable_inet);\n+\n+\treturn 0;\n+}\n+\n+static void __exit nf_flow_inet_module_exit(void)\n+{\n+\tnft_unregister_flowtable_type(&flowtable_inet);\n+}\n+\n+module_init(nf_flow_inet_module_init);\n+module_exit(nf_flow_inet_module_exit);\n+\n+MODULE_LICENSE(\"GPL\");\n+MODULE_AUTHOR(\"Pablo Neira Ayuso <pablo@netfilter.org>\");\n+MODULE_ALIAS_NF_FLOWTABLE(1); /* NFPROTO_INET */\n", "prefixes": [ "nf-next", "v3", "5/7" ] }