Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/819022/?format=api
{ "id": 819022, "url": "http://patchwork.ozlabs.org/api/patches/819022/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1506500194-17637-2-git-send-email-simon.horman@netronome.com/", "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": "<1506500194-17637-2-git-send-email-simon.horman@netronome.com>", "list_archive_url": null, "date": "2017-09-27T08:16:33", "name": "[v2,net-next,1/2] net/sched: add tunnel option support to act_tunnel_key", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "9b91b1ccb1e422a22afa08f53b9683f70d568d19", "submitter": { "id": 64714, "url": "http://patchwork.ozlabs.org/api/people/64714/?format=api", "name": "Simon Horman", "email": "simon.horman@netronome.com" }, "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/1506500194-17637-2-git-send-email-simon.horman@netronome.com/mbox/", "series": [ { "id": 5305, "url": "http://patchwork.ozlabs.org/api/series/5305/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5305", "date": "2017-09-27T08:16:32", "name": "net/sched: support tunnel options in cls_flower and act_tunnel_key", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/5305/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/819022/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/819022/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>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=netronome-com.20150623.gappssmtp.com\n\theader.i=@netronome-com.20150623.gappssmtp.com\n\theader.b=\"B78T1IL1\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y29f42SShz9s7F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 27 Sep 2017 18:17:00 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752147AbdI0IQ5 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 04:16:57 -0400", "from mail-qt0-f170.google.com ([209.85.216.170]:50947 \"EHLO\n\tmail-qt0-f170.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752028AbdI0IQv (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 27 Sep 2017 04:16:51 -0400", "by mail-qt0-f170.google.com with SMTP id f15so12851656qtf.7\n\tfor <netdev@vger.kernel.org>; Wed, 27 Sep 2017 01:16:51 -0700 (PDT)", "from penelope.pa.netronome.com ([217.111.208.18])\n\tby smtp.gmail.com with ESMTPSA id\n\ty15sm8419611qtc.4.2017.09.27.01.16.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 01:16:50 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=netronome-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=ToAOs+E9xqFPQBaUhKkeMabp8quriGnSKanyRHcVk2o=;\n\tb=B78T1IL19680DjChYcaPmeGyaD60OxSKlFgUvODibD0xUmVuLWfsZKX5aIpaPOzLxG\n\tC5eXFpN+RBIHDG0qbijSMqF9HRUxxg4bm7Wd19xh0SW71joXPidUQsBANjFW9jvDYChv\n\tKS/au8WTl4tBjWQLM7pXG9cAppEYkGPLQOqfyt9GlFSgrmW/SYyeflQC8cnvUbeUDPhc\n\tyUuUCZ/zqrXnTnrdYMcUr3Pjy8MDvjVrn/u9VhwnsdOpA0RQxxIuF1rZjyqpNRUS+0p0\n\tlS4Z10ta82T9pUgN7QHhRVuh1zwsjX7S4zJyxBJrn1S0uSsF1bPQSMSmNmW5dkbfHIRe\n\tZnOQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=ToAOs+E9xqFPQBaUhKkeMabp8quriGnSKanyRHcVk2o=;\n\tb=lBzbCYzxnIKotqsmTMEds9YgzHnb//I5fUD/qNLhK6i3IwVB3ONLVq2a1rcgd2RCuP\n\tMgwRVm5LVO8UxX01yYwAj9VYMZMPmqkQhtl3OYvbxrgu4KzIsEJ2Z4ahDrYBkJVqNxCf\n\tvWQ/01yXwUePzJ+6dgmTO1R54QKuvS/XjSOFQwox2LehLHx8RmPcmAZ3Baj49WxXAHCc\n\tIjFnJfgosX35Bqvh+LksT46n93EDHb1d3xvX9wp0/0q2m1KX5NovFvSjL83pg113LGCX\n\thfybhCegQq1M8O3dD1sZ0BaFVErTJrMf7O6DOfkcnKy2EhS9VojfnHUHyvxy/t4srdEY\n\t0ePw==", "X-Gm-Message-State": "AHPjjUjbXAmhoWnJHAdZe6cbWB1mdEy+4JAD3SMMyg7g8bUJEqLKY+oo\n\tUudZuwOR7q0t/FlEjf2IiA2CCg==", "X-Google-Smtp-Source": "AOwi7QD5ACyEpyoWFNpB3jDL4sOF9buazk2kAz/V2viPc2RdG7Z+0138DAYutxGJim1fG7LqjLPOTw==", "X-Received": "by 10.200.3.111 with SMTP id w47mr682270qtg.144.1506500210818;\n\tWed, 27 Sep 2017 01:16:50 -0700 (PDT)", "From": "Simon Horman <simon.horman@netronome.com>", "To": "David Miller <davem@davemloft.net>, Jiri Pirko <jiri@mellanox.com>", "Cc": "Jamal Hadi Salim <jhs@mojatatu.com>,\n\tCong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org,\n\toss-drivers@netronome.com, Simon Horman <simon.horman@netronome.com>", "Subject": "[PATCH v2 net-next 1/2] net/sched: add tunnel option support to\n\tact_tunnel_key", "Date": "Wed, 27 Sep 2017 10:16:33 +0200", "Message-Id": "<1506500194-17637-2-git-send-email-simon.horman@netronome.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1506500194-17637-1-git-send-email-simon.horman@netronome.com>", "References": "<1506500194-17637-1-git-send-email-simon.horman@netronome.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Allow setting tunnel options using the act_tunnel_key action.\n\nOptions are a bitwise maskable bytestring of up to 256 bytes.\nTunnel implementations may support less or more options,\nor no options at all.\n\n # ip link add name geneve0 type geneve dstport 0 external\n # tc qdisc add dev eth0 ingress\n # tc filter add dev eth0 protocol ip parent ffff: \\\n flower indev eth0 \\\n ip_proto udp \\\n action tunnel_key \\\n set src_ip 10.0.99.192 \\\n dst_ip 10.0.99.193 \\\n dst_port 6081 \\\n id 11 \\\n opts 0102800100800022 \\\n action mirred egress redirect dev geneve0\n\nSigned-off-by: Simon Horman <simon.horman@netronome.com>\nReviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>\n---\nv2\n* Correct example which was incorrectly described matching rather\n than setting tunnel options\n---\n include/uapi/linux/tc_act/tc_tunnel_key.h | 1 +\n net/sched/act_tunnel_key.c | 26 +++++++++++++++++++++-----\n 2 files changed, 22 insertions(+), 5 deletions(-)", "diff": "diff --git a/include/uapi/linux/tc_act/tc_tunnel_key.h b/include/uapi/linux/tc_act/tc_tunnel_key.h\nindex afcd4be953e2..e0cb1121d132 100644\n--- a/include/uapi/linux/tc_act/tc_tunnel_key.h\n+++ b/include/uapi/linux/tc_act/tc_tunnel_key.h\n@@ -35,6 +35,7 @@ enum {\n \tTCA_TUNNEL_KEY_PAD,\n \tTCA_TUNNEL_KEY_ENC_DST_PORT,\t/* be16 */\n \tTCA_TUNNEL_KEY_NO_CSUM,\t\t/* u8 */\n+\tTCA_TUNNEL_KEY_ENC_OPTS,\n \t__TCA_TUNNEL_KEY_MAX,\n };\n \ndiff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c\nindex 30c96274c638..77b5890a48b9 100644\n--- a/net/sched/act_tunnel_key.c\n+++ b/net/sched/act_tunnel_key.c\n@@ -66,6 +66,7 @@ static const struct nla_policy tunnel_key_policy[TCA_TUNNEL_KEY_MAX + 1] = {\n \t[TCA_TUNNEL_KEY_ENC_KEY_ID] = { .type = NLA_U32 },\n \t[TCA_TUNNEL_KEY_ENC_DST_PORT] = {.type = NLA_U16},\n \t[TCA_TUNNEL_KEY_NO_CSUM] = { .type = NLA_U8 },\n+\t[TCA_TUNNEL_KEY_ENC_OPTS] = { .type = NLA_BINARY },\n };\n \n static int tunnel_key_init(struct net *net, struct nlattr *nla,\n@@ -81,9 +82,11 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,\n \tstruct tcf_tunnel_key *t;\n \tbool exists = false;\n \t__be16 dst_port = 0;\n+\tint opts_len = 0;\n \t__be64 key_id;\n \t__be16 flags;\n \tint ret = 0;\n+\tu8 *opts;\n \tint err;\n \n \tif (!nla)\n@@ -121,6 +124,11 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,\n \t\tif (tb[TCA_TUNNEL_KEY_ENC_DST_PORT])\n \t\t\tdst_port = nla_get_be16(tb[TCA_TUNNEL_KEY_ENC_DST_PORT]);\n \n+\t\tif (tb[TCA_TUNNEL_KEY_ENC_OPTS]) {\n+\t\t\topts = nla_data(tb[TCA_TUNNEL_KEY_ENC_OPTS]);\n+\t\t\topts_len = nla_len(tb[TCA_TUNNEL_KEY_ENC_OPTS]);\n+\t\t}\n+\n \t\tif (tb[TCA_TUNNEL_KEY_ENC_IPV4_SRC] &&\n \t\t tb[TCA_TUNNEL_KEY_ENC_IPV4_DST]) {\n \t\t\t__be32 saddr;\n@@ -131,7 +139,7 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,\n \n \t\t\tmetadata = __ip_tun_set_dst(saddr, daddr, 0, 0,\n \t\t\t\t\t\t dst_port, flags,\n-\t\t\t\t\t\t key_id, 0);\n+\t\t\t\t\t\t key_id, opts_len);\n \t\t} else if (tb[TCA_TUNNEL_KEY_ENC_IPV6_SRC] &&\n \t\t\t tb[TCA_TUNNEL_KEY_ENC_IPV6_DST]) {\n \t\t\tstruct in6_addr saddr;\n@@ -142,9 +150,13 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,\n \n \t\t\tmetadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, dst_port,\n \t\t\t\t\t\t 0, flags,\n-\t\t\t\t\t\t key_id, 0);\n+\t\t\t\t\t\t key_id, opts_len);\n \t\t}\n \n+\t\tif (opts_len)\n+\t\t\tip_tunnel_info_opts_set(&metadata->u.tun_info,\n+\t\t\t\t\t\topts, opts_len);\n+\n \t\tif (!metadata) {\n \t\t\tret = -EINVAL;\n \t\t\tgoto err_out;\n@@ -264,8 +276,9 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,\n \t\tgoto nla_put_failure;\n \n \tif (params->tcft_action == TCA_TUNNEL_KEY_ACT_SET) {\n-\t\tstruct ip_tunnel_key *key =\n-\t\t\t¶ms->tcft_enc_metadata->u.tun_info.key;\n+\t\tstruct ip_tunnel_info *info =\n+\t\t\t¶ms->tcft_enc_metadata->u.tun_info;\n+\t\tstruct ip_tunnel_key *key = &info->key;\n \t\t__be32 key_id = tunnel_id_to_key32(key->tun_id);\n \n \t\tif (nla_put_be32(skb, TCA_TUNNEL_KEY_ENC_KEY_ID, key_id) ||\n@@ -273,7 +286,10 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,\n \t\t\t\t\t ¶ms->tcft_enc_metadata->u.tun_info) ||\n \t\t nla_put_be16(skb, TCA_TUNNEL_KEY_ENC_DST_PORT, key->tp_dst) ||\n \t\t nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM,\n-\t\t\t !(key->tun_flags & TUNNEL_CSUM)))\n+\t\t\t !(key->tun_flags & TUNNEL_CSUM)) ||\n+\t\t (info->options_len &&\n+\t\t nla_put(skb, TCA_TUNNEL_KEY_ENC_OPTS, info->options_len,\n+\t\t\t info + 1)))\n \t\t\tgoto nla_put_failure;\n \t}\n \n", "prefixes": [ "v2", "net-next", "1/2" ] }