get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 714692,
    "url": "http://patchwork.ozlabs.org/api/patches/714692/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1484260510-9162-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": "<1484260510-9162-5-git-send-email-sridhar.samudrala@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-12T22:35:07",
    "name": "[next-queue,v4,4/7] net: store port/representator id in metadata_dst",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "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/1484260510-9162-5-git-send-email-sridhar.samudrala@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/714692/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/714692/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 3v00vt3Yvgz9srY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 13 Jan 2017 09:35:38 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 90DB42DC91;\n\tThu, 12 Jan 2017 22:35:36 +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 c6+82J7GaLqe; Thu, 12 Jan 2017 22:35:31 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2A49F308C1;\n\tThu, 12 Jan 2017 22:35:28 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3014D1C001E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:20 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2973C2E134\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:20 +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 TclWNX8+NboH for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:16 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 6B0D02DC8B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:16 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Jan 2017 14:35:16 -0800",
            "from sri-mi-02.jf.intel.com ([10.166.188.51])\n\tby FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2017 14:35:16 -0800"
        ],
        "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.33,220,1477983600\"; d=\"scan'208\";a=\"808217575\"",
        "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>",
        "To": "alexander.h.duyck@intel.com, john.r.fastabend@intel.com,\n\tanjali.singhai@intel.com, jakub.kicinski@netronome.com,\n\tdavem@davemloft.net, scott.d.peterson@intel.com, gerlitz.or@gmail.com,\n\tjiri@resnulli.us, intel-wired-lan@lists.osuosl.org,\n\tnetdev@vger.kernel.org",
        "Date": "Thu, 12 Jan 2017 14:35:07 -0800",
        "Message-Id": "<1484260510-9162-5-git-send-email-sridhar.samudrala@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1484260510-9162-1-git-send-email-sridhar.samudrala@intel.com>",
        "References": "<1484260510-9162-1-git-send-email-sridhar.samudrala@intel.com>",
        "Subject": "[Intel-wired-lan] [next-queue v4 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 queues\nof all of them reliably is impossible and lower device has to retreat to\nreturning NETDEV_TX_BUSY and usually has to take extra locks on the fastpath.\n\nThis patch attempts to enable port/representative devs to attach metadata to\nskbs which carry port id.  This way representatives can be queueless and all\nqueuing can be performed at the lower netdev in the usual way.\n\nTraffic arriving on the port/representative interfaces will be have metadata\nattached and will subsequently be queued to the lower device for transmission.\nThe lower device should recognize the metadata and translate it to HW specific\nformat which is most likely either a special header inserted before the network\nheaders or descriptor/metadata fields.\n\nMetadata is associated with the lower device by storing the netdev pointer along\nwith port id so that if TC decides to redirect or mirror the new netdev will not\ntry to interpret it.\n\nThis is mostly for SR-IOV devices since switches don't have lower netdevs today.\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 b5cbbe0..62dd4e4 100644\n--- a/net/core/dst.c\n+++ b/net/core/dst.c\n@@ -367,7 +367,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@@ -379,9 +381,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@@ -389,7 +393,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@@ -403,7 +407,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@@ -414,7 +419,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 1969b3f..617ca0c 100644\n--- a/net/core/filter.c\n+++ b/net/core/filter.c\n@@ -2521,6 +2521,7 @@ bpf_get_skb_set_tunnel_proto(enum bpf_func_id which)\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 5476110..4544b35 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 c87d359..164b4f1 100644\n--- a/net/openvswitch/flow_netlink.c\n+++ b/net/openvswitch/flow_netlink.c\n@@ -2105,7 +2105,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",
        "v4",
        "4/7"
    ]
}