get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 745018,
    "url": "http://patchwork.ozlabs.org/api/patches/745018/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1490833375-2788-5-git-send-email-sridhar.samudrala@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1490833375-2788-5-git-send-email-sridhar.samudrala@intel.com>",
    "list_archive_url": null,
    "date": "2017-03-30T00:22:52",
    "name": "[next-queue,v6,4/7] net: store port/representator id in metadata_dst",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "204a478ff510bdb35c34a937ff8b6a4a1d6c4d57",
    "submitter": {
        "id": 65219,
        "url": "http://patchwork.ozlabs.org/api/people/65219/?format=api",
        "name": "Samudrala, Sridhar",
        "email": "sridhar.samudrala@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1490833375-2788-5-git-send-email-sridhar.samudrala@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/745018/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/745018/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vtlhx5sV6z9s77\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 30 Mar 2017 11:23:13 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 5BD542EEFB;\n\tThu, 30 Mar 2017 00:23:12 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id KOoFQiboXO2f; Thu, 30 Mar 2017 00:23:07 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3079D2F708;\n\tThu, 30 Mar 2017 00:23:01 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 94A391CE8BC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 30 Mar 2017 00:22:58 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 906B78902A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 30 Mar 2017 00:22:58 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Onwwag+lzLlp for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 30 Mar 2017 00:22:57 +0000 (UTC)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 01CA789035\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 30 Mar 2017 00:22:56 +0000 (UTC)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga105.jf.intel.com with ESMTP; 29 Mar 2017 17:22:56 -0700",
            "from arch-p28.jf.intel.com ([10.166.187.27])\n\tby orsmga003.jf.intel.com with ESMTP; 29 Mar 2017 17:22:55 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.36,244,1486454400\"; d=\"scan'208\";a=\"949601326\"",
        "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,\n\talexander.h.duyck@intel.com, anjali.singhai@intel.com,\n\tjakub.kicinski@netronome.com, gerlitz.or@gmail.com, jiri@resnulli.us, \n\tsridhar.samudrala@intel.com",
        "Date": "Wed, 29 Mar 2017 17:22:52 -0700",
        "Message-Id": "<1490833375-2788-5-git-send-email-sridhar.samudrala@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1490833375-2788-1-git-send-email-sridhar.samudrala@intel.com>",
        "References": "<1490833375-2788-1-git-send-email-sridhar.samudrala@intel.com>",
        "Subject": "[Intel-wired-lan] [next-queue v6 PATCH 4/7] net: store\n\tport/representator id in metadata_dst",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Jakub Kicinski <jakub.kicinski@netronome.com>\n\nSwitches and modern SR-IOV enabled NICs may multiplex traffic from Port\nrepresentators and control messages over single set of hardware queues.\nControl messages and muxed traffic may need ordered delivery.\n\nThose requirements make it hard to comfortably use TC infrastructure today\nunless we have a way of attaching metadata to skbs at the upper device.\nBecause single set of queues is used for many netdevs stopping TC/sched\nqueues of all of them reliably is impossible and lower device has to\nretreat to returning NETDEV_TX_BUSY and usually has to take extra locks\non the fastpath.\n\nThis patch attempts to enable port/representative devs to attach metadata\nto skbs which carry port id.  This way representatives can be queueless\nand all queuing can be performed at the lower netdev in the usual way.\n\nTraffic arriving on the port/representative interfaces will be have\nmetadata attached and will subsequently be queued to the lower device\nfor transmission. The lower device should recognize the metadata and\ntranslate it to HW specific format which is most likely either a special\nheader inserted before the network headers or descriptor/metadata fields.\n\nMetadata is associated with the lower device by storing the netdev pointer\nalong with port id so that if TC decides to redirect or mirror the new\nnetdev will not try to interpret it.\n\nThis is mostly for SR-IOV devices since switches don't have lower netdevs\ntoday.\n\nSigned-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n---\n include/net/dst_metadata.h     | 41 ++++++++++++++++++++++++++++++++---------\n net/core/dst.c                 | 15 ++++++++++-----\n net/core/filter.c              |  1 +\n net/ipv4/ip_tunnel_core.c      |  6 ++++--\n net/openvswitch/flow_netlink.c |  4 +++-\n 5 files changed, 50 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h\nindex 701fc81..a803129 100644\n--- a/include/net/dst_metadata.h\n+++ b/include/net/dst_metadata.h\n@@ -5,10 +5,22 @@\n #include <net/ip_tunnels.h>\n #include <net/dst.h>\n \n+enum metadata_type {\n+\tMETADATA_IP_TUNNEL,\n+\tMETADATA_HW_PORT_MUX,\n+};\n+\n+struct hw_port_info {\n+\tstruct net_device *lower_dev;\n+\tu32 port_id;\n+};\n+\n struct metadata_dst {\n \tstruct dst_entry\t\tdst;\n+\tenum metadata_type\t\ttype;\n \tunion {\n \t\tstruct ip_tunnel_info\ttun_info;\n+\t\tstruct hw_port_info\tport_info;\n \t} u;\n };\n \n@@ -27,7 +39,7 @@ static inline struct ip_tunnel_info *skb_tunnel_info(struct sk_buff *skb)\n \tstruct metadata_dst *md_dst = skb_metadata_dst(skb);\n \tstruct dst_entry *dst;\n \n-\tif (md_dst)\n+\tif (md_dst && md_dst->type == METADATA_IP_TUNNEL)\n \t\treturn &md_dst->u.tun_info;\n \n \tdst = skb_dst(skb);\n@@ -55,22 +67,33 @@ static inline int skb_metadata_dst_cmp(const struct sk_buff *skb_a,\n \ta = (const struct metadata_dst *) skb_dst(skb_a);\n \tb = (const struct metadata_dst *) skb_dst(skb_b);\n \n-\tif (!a != !b || a->u.tun_info.options_len != b->u.tun_info.options_len)\n+\tif (!a != !b || a->type != b->type)\n \t\treturn 1;\n \n-\treturn memcmp(&a->u.tun_info, &b->u.tun_info,\n-\t\t      sizeof(a->u.tun_info) + a->u.tun_info.options_len);\n+\tswitch (a->type) {\n+\tcase METADATA_HW_PORT_MUX:\n+\t\treturn memcmp(&a->u.port_info, &b->u.port_info,\n+\t\t\t      sizeof(a->u.port_info));\n+\tcase METADATA_IP_TUNNEL:\n+\t\treturn memcmp(&a->u.tun_info, &b->u.tun_info,\n+\t\t\t      sizeof(a->u.tun_info) +\n+\t\t\t\t\t a->u.tun_info.options_len);\n+\tdefault:\n+\t\treturn 1;\n+\t}\n }\n \n void metadata_dst_free(struct metadata_dst *);\n-struct metadata_dst *metadata_dst_alloc(u8 optslen, gfp_t flags);\n-struct metadata_dst __percpu *metadata_dst_alloc_percpu(u8 optslen, gfp_t flags);\n+struct metadata_dst *metadata_dst_alloc(u8 optslen, enum metadata_type type,\n+\t\t\t\t\tgfp_t flags);\n+struct metadata_dst __percpu *\n+metadata_dst_alloc_percpu(u8 optslen, enum metadata_type type, gfp_t flags);\n \n static inline struct metadata_dst *tun_rx_dst(int md_size)\n {\n \tstruct metadata_dst *tun_dst;\n \n-\ttun_dst = metadata_dst_alloc(md_size, GFP_ATOMIC);\n+\ttun_dst = metadata_dst_alloc(md_size, METADATA_IP_TUNNEL, GFP_ATOMIC);\n \tif (!tun_dst)\n \t\treturn NULL;\n \n@@ -85,11 +108,11 @@ static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)\n \tint md_size;\n \tstruct metadata_dst *new_md;\n \n-\tif (!md_dst)\n+\tif (!md_dst || md_dst->type != METADATA_IP_TUNNEL)\n \t\treturn ERR_PTR(-EINVAL);\n \n \tmd_size = md_dst->u.tun_info.options_len;\n-\tnew_md = metadata_dst_alloc(md_size, GFP_ATOMIC);\n+\tnew_md = metadata_dst_alloc(md_size, METADATA_IP_TUNNEL, GFP_ATOMIC);\n \tif (!new_md)\n \t\treturn ERR_PTR(-ENOMEM);\n \ndiff --git a/net/core/dst.c b/net/core/dst.c\nindex 960e503..230e430 100644\n--- a/net/core/dst.c\n+++ b/net/core/dst.c\n@@ -366,7 +366,9 @@ static int dst_md_discard(struct sk_buff *skb)\n \treturn 0;\n }\n \n-static void __metadata_dst_init(struct metadata_dst *md_dst, u8 optslen)\n+static void __metadata_dst_init(struct metadata_dst *md_dst,\n+\t\t\t\tenum metadata_type type, u8 optslen)\n+\n {\n \tstruct dst_entry *dst;\n \n@@ -378,9 +380,11 @@ static void __metadata_dst_init(struct metadata_dst *md_dst, u8 optslen)\n \tdst->output = dst_md_discard_out;\n \n \tmemset(dst + 1, 0, sizeof(*md_dst) + optslen - sizeof(*dst));\n+\tmd_dst->type = type;\n }\n \n-struct metadata_dst *metadata_dst_alloc(u8 optslen, gfp_t flags)\n+struct metadata_dst *metadata_dst_alloc(u8 optslen, enum metadata_type type,\n+\t\t\t\t\tgfp_t flags)\n {\n \tstruct metadata_dst *md_dst;\n \n@@ -388,7 +392,7 @@ struct metadata_dst *metadata_dst_alloc(u8 optslen, gfp_t flags)\n \tif (!md_dst)\n \t\treturn NULL;\n \n-\t__metadata_dst_init(md_dst, optslen);\n+\t__metadata_dst_init(md_dst, type, optslen);\n \n \treturn md_dst;\n }\n@@ -402,7 +406,8 @@ void metadata_dst_free(struct metadata_dst *md_dst)\n \tkfree(md_dst);\n }\n \n-struct metadata_dst __percpu *metadata_dst_alloc_percpu(u8 optslen, gfp_t flags)\n+struct metadata_dst __percpu *\n+metadata_dst_alloc_percpu(u8 optslen, enum metadata_type type, gfp_t flags)\n {\n \tint cpu;\n \tstruct metadata_dst __percpu *md_dst;\n@@ -413,7 +418,7 @@ struct metadata_dst __percpu *metadata_dst_alloc_percpu(u8 optslen, gfp_t flags)\n \t\treturn NULL;\n \n \tfor_each_possible_cpu(cpu)\n-\t\t__metadata_dst_init(per_cpu_ptr(md_dst, cpu), optslen);\n+\t\t__metadata_dst_init(per_cpu_ptr(md_dst, cpu), type, optslen);\n \n \treturn md_dst;\n }\ndiff --git a/net/core/filter.c b/net/core/filter.c\nindex dfb9f61..ab29297 100644\n--- a/net/core/filter.c\n+++ b/net/core/filter.c\n@@ -2531,6 +2531,7 @@ static unsigned short bpf_tunnel_key_af(u64 flags)\n \t\t * that is holding verifier mutex.\n \t\t */\n \t\tmd_dst = metadata_dst_alloc_percpu(IP_TUNNEL_OPTS_MAX,\n+\t\t\t\t\t\t   METADATA_IP_TUNNEL,\n \t\t\t\t\t\t   GFP_KERNEL);\n \t\tif (!md_dst)\n \t\t\treturn NULL;\ndiff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c\nindex a31f47c..cb1328e 100644\n--- a/net/ipv4/ip_tunnel_core.c\n+++ b/net/ipv4/ip_tunnel_core.c\n@@ -134,10 +134,12 @@ struct metadata_dst *iptunnel_metadata_reply(struct metadata_dst *md,\n \tstruct metadata_dst *res;\n \tstruct ip_tunnel_info *dst, *src;\n \n-\tif (!md || md->u.tun_info.mode & IP_TUNNEL_INFO_TX)\n+\tif (!md || md->type != METADATA_IP_TUNNEL ||\n+\t    md->u.tun_info.mode & IP_TUNNEL_INFO_TX)\n+\n \t\treturn NULL;\n \n-\tres = metadata_dst_alloc(0, flags);\n+\tres = metadata_dst_alloc(0, METADATA_IP_TUNNEL, flags);\n \tif (!res)\n \t\treturn NULL;\n \ndiff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c\nindex df82b81..a36efae 100644\n--- a/net/openvswitch/flow_netlink.c\n+++ b/net/openvswitch/flow_netlink.c\n@@ -2202,7 +2202,9 @@ static int validate_and_copy_set_tun(const struct nlattr *attr,\n \tif (start < 0)\n \t\treturn start;\n \n-\ttun_dst = metadata_dst_alloc(key.tun_opts_len, GFP_KERNEL);\n+\ttun_dst = metadata_dst_alloc(key.tun_opts_len, METADATA_IP_TUNNEL,\n+\t\t\t\t     GFP_KERNEL);\n+\n \tif (!tun_dst)\n \t\treturn -ENOMEM;\n \n",
    "prefixes": [
        "next-queue",
        "v6",
        "4/7"
    ]
}