get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1145964,
    "url": "http://patchwork.ozlabs.org/api/patches/1145964/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1565657261-15979-6-git-send-email-tom@quantonium.net/",
    "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": "<1565657261-15979-6-git-send-email-tom@quantonium.net>",
    "list_archive_url": null,
    "date": "2019-08-13T00:47:39",
    "name": "[net-next,5/7] ip6tlvs: Add TX parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b2db4a5177901450ec7132a87353d17287b30012",
    "submitter": {
        "id": 65986,
        "url": "http://patchwork.ozlabs.org/api/people/65986/?format=api",
        "name": "Tom Herbert",
        "email": "tom@herbertland.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/1565657261-15979-6-git-send-email-tom@quantonium.net/mbox/",
    "series": [
        {
            "id": 124709,
            "url": "http://patchwork.ozlabs.org/api/series/124709/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=124709",
            "date": "2019-08-13T00:47:39",
            "name": "ipv6: Extension header infrastructure",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/124709/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1145964/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1145964/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=herbertland.com",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=herbertland-com.20150623.gappssmtp.com\n\theader.i=@herbertland-com.20150623.gappssmtp.com\n\theader.b=\"cZT99sgl\"; dkim-atps=neutral"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 466vN01JYXz9sND\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 13 Aug 2019 10:53:19 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 9EC8522654;\n\tTue, 13 Aug 2019 00:53:17 +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 sHKIkDmZ5Xyv; Tue, 13 Aug 2019 00:53:14 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1959D2263E;\n\tTue, 13 Aug 2019 00:53:14 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5255A1BF989\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tTue, 13 Aug 2019 00:53:13 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3C8B487B8A\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tTue, 13 Aug 2019 00:53:13 +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 Pn07KkqZJKCo for <Intel-wired-lan@lists.osuosl.org>;\n\tTue, 13 Aug 2019 00:53:12 +0000 (UTC)",
            "from mail-pl1-f194.google.com (mail-pl1-f194.google.com\n\t[209.85.214.194])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 6BA1E87B4F\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tTue, 13 Aug 2019 00:53:12 +0000 (UTC)",
            "by mail-pl1-f194.google.com with SMTP id c2so48534332plz.13\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Aug 2019 17:53:12 -0700 (PDT)",
            "from localhost.localdomain (c-73-202-182-113.hsd1.ca.comcast.net.\n\t[73.202.182.113]) by smtp.gmail.com with ESMTPSA id\n\t14sm105671426pfy.40.2019.08.12.17.48.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 12 Aug 2019 17:48:09 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "delayed 00:05:03 by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=herbertland-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=rMCarG1i7e+QWcFRH+nW8AZrxw7Lnv/Wn5JBcwb6/m4=;\n\tb=cZT99sgl5x/41ZQpj6nfou3f+2ADLGkVwiZLIOhcABG8U/VLLATA2upaC/JGXK6Tld\n\tTpjw6Lf9Qls2xKAQfkS/rhek5ceifiv8CQ+v/746J9cKog6emOrA8n0By5FbxNZ5Cto/\n\tEWptG+iiVsU8aWfuW9iCjuyi0lzKL8w112ACexSFtEb3HPqFPW7uJwwljPU3Hi1od3dq\n\teQoEbsyxS9XwqkdsQw/yiTLUg7nBFhwVY2vLrxo/CsV3U3GGgWP3rjJ8ywr/09k7IqKM\n\t+mcXvnNZfJhnpOzrv+Y2J5y5bBGQ/P1uZ/ohPzgWC96qwljhlY/mP3uM77Se9b5hpXvh\n\tC+kg==",
        "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=rMCarG1i7e+QWcFRH+nW8AZrxw7Lnv/Wn5JBcwb6/m4=;\n\tb=pX/+i/hMHACn3dqUTdm8RuwGNNf01LPfFXTgQx5ZIpcwELIj8teos4ZYetDBGDiR+q\n\tdCP63Bxf77OsgFz8yRiSr/0qwY3lf8obN/fVSWO2qpRqAXG3AC2be/a8kYHv6fexRFoI\n\tnF/BHeVbj65iH8CkTjkRirRrNwWek3rXyKxT/Ze+R6Zbhsip6yzHEitEqZ0NiUQGCTxf\n\tglevDAAdZHjbsD/M9Aa3Fl5oPattWZbLQ+Lkw2VsXfJX9VP7Jz0l5avFUju0BPaD3tBh\n\td/3XaYCIZowuMglzkQ/7kHbRfE/l+bLztOvLCLbGN9D0KyKHxvObMMunn6ET7PJ608R1\n\tpjwQ==",
        "X-Gm-Message-State": "APjAAAXWL/+7xMArncI3PO0BVYU8wOyZQi2vgJhiuHugX0Ztgv51bU8V\n\tYEQnlE56WkuTJyRG0xtuLvQoe/euD+I=",
        "X-Google-Smtp-Source": "APXvYqzWezlR5qURZEBxWLCJrc/pUTrS3PzgTvtbpjAICXaooULaA1c6egIBML5ljoFe7LwYmiJBrA==",
        "X-Received": "by 2002:a17:902:7797:: with SMTP id\n\to23mr4299872pll.102.1565657290438; \n\tMon, 12 Aug 2019 17:48:10 -0700 (PDT)",
        "From": "Tom Herbert <tom@herbertland.com>",
        "X-Google-Original-From": "Tom Herbert <tom@quantonium.net>",
        "To": "Intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 12 Aug 2019 17:47:39 -0700",
        "Message-Id": "<1565657261-15979-6-git-send-email-tom@quantonium.net>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1565657261-15979-1-git-send-email-tom@quantonium.net>",
        "References": "<1565657261-15979-1-git-send-email-tom@quantonium.net>",
        "Subject": "[Intel-wired-lan] [PATCH net-next 5/7] ip6tlvs: Add TX parameters",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Tom Herbert <tom@quantonium.net>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Define a number of transmit parameters for TLV Parameter table\ndefinitions. These will be used for validating TLVs that are set\non a socket.\n\nSigned-off-by: Tom Herbert <tom@quantonium.net>\n---\n include/net/ipeh.h         | 18 ++++++++++++++++\n include/uapi/linux/ipeh.h  |  8 +++++++\n net/ipv6/exthdrs_common.c  | 53 +++++++++++++++++++++++++++++++++++++++++++++-\n net/ipv6/exthdrs_options.c | 45 +++++++++++++++++++++++++++++++++++++++\n 4 files changed, 123 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/net/ipeh.h b/include/net/ipeh.h\nindex 816fe36..7d91558 100644\n--- a/include/net/ipeh.h\n+++ b/include/net/ipeh.h\n@@ -18,6 +18,17 @@ struct tlv_rx_params {\n };\n \n struct tlv_tx_params {\n+\tunsigned char admin_perm : 2;\n+\tunsigned char user_perm : 2;\n+\tunsigned char class : 3;\n+\tunsigned char rsvd : 1;\n+\tunsigned char align_mult : 4;\n+\tunsigned char align_off : 4;\n+\tunsigned char data_len_mult : 4;\n+\tunsigned char data_len_off : 4;\n+\tunsigned char min_data_len;\n+\tunsigned char max_data_len;\n+\tunsigned short preferred_order;\n };\n \n struct tlv_params {\n@@ -52,6 +63,13 @@ struct tlv_param_table {\n \n extern struct tlv_param_table ipv6_tlv_param_table;\n \n+/* Preferred TLV ordering for HBH and Dest options (placed by increasing order)\n+ */\n+#define IPEH_TLV_PREF_ORDER_HAO\t\t\t10\n+#define IPEH_TLV_PREF_ORDER_ROUTERALERT\t\t20\n+#define IPEH_TLV_PREF_ORDER_JUMBO\t\t30\n+#define IPEH_TLV_PREF_ORDER_CALIPSO\t\t40\n+\n int __ipeh_tlv_set(struct tlv_param_table *tlv_param_table,\n \t\t   unsigned char type, const struct tlv_params *params,\n \t\t   const struct tlv_ops *ops);\ndiff --git a/include/uapi/linux/ipeh.h b/include/uapi/linux/ipeh.h\nindex c4302b7..dbf0728 100644\n--- a/include/uapi/linux/ipeh.h\n+++ b/include/uapi/linux/ipeh.h\n@@ -13,4 +13,12 @@\n \t\t\t\t  IPEH_TLV_CLASS_FLAG_RTRDSTOPT |\t\\\n \t\t\t\t  IPEH_TLV_CLASS_FLAG_DSTOPT)\n \n+/* TLV permissions values */\n+enum {\n+\tIPEH_TLV_PERM_NONE,\n+\tIPEH_TLV_PERM_WITH_CHECK,\n+\tIPEH_TLV_PERM_NO_CHECK,\n+\tIPEH_TLV_PERM_MAX = IPEH_TLV_PERM_NO_CHECK\n+};\n+\n #endif /* _UAPI_LINUX_IPEH_H */\ndiff --git a/net/ipv6/exthdrs_common.c b/net/ipv6/exthdrs_common.c\nindex cc8db9e..791f6e4 100644\n--- a/net/ipv6/exthdrs_common.c\n+++ b/net/ipv6/exthdrs_common.c\n@@ -3,6 +3,7 @@\n /* Extension header and TLV library code that is not specific to IPv6. */\n #include <linux/export.h>\n #include <net/ipv6.h>\n+#include <uapi/linux/ipeh.h>\n \n struct ipv6_txoptions *\n ipeh_dup_options(struct sock *sk, struct ipv6_txoptions *opt)\n@@ -265,6 +266,13 @@ EXPORT_SYMBOL(ipeh_parse_tlv);\n \n /* Default (unset) values for TLV parameters */\n static const struct tlv_proc tlv_default_proc = {\n+\t.params.t = {\n+\t\t.admin_perm = IPEH_TLV_PERM_NO_CHECK,\n+\t\t.user_perm = IPEH_TLV_PERM_NONE,\n+\t\t.align_mult = (4 - 1), /* Default alignment: 4n + 2 */\n+\t\t.align_off = 2,\n+\t\t.max_data_len = 255,\n+\t},\n };\n \n static DEFINE_MUTEX(tlv_mutex);\n@@ -284,16 +292,45 @@ static void tlv_param_table_release(struct rcu_head *rcu)\n }\n \n /* mutex held */\n+static int check_order(struct tlv_param_table_data *tpt, unsigned char type,\n+\t\t       unsigned short order)\n+{\n+\tint i;\n+\n+\tif (!order)\n+\t\treturn -EINVAL;\n+\n+\tfor (i = 2; i < 256; i++) {\n+\t\tstruct tlv_type *ttype = &tpt->types[tpt->entries[i]];\n+\n+\t\tif (!tpt->entries[i])\n+\t\t\tcontinue;\n+\n+\t\tif (order == ttype->proc.params.t.preferred_order &&\n+\t\t    i != type)\n+\t\t\treturn -EALREADY;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/* mutex held */\n static int __tlv_set_one(struct tlv_param_table *tlv_param_table,\n \t\t\t unsigned char type, const struct tlv_params *params,\n \t\t\t const struct tlv_ops *ops)\n {\n \tstruct tlv_param_table_data *tpt, *told;\n \tstruct tlv_type *ttype;\n+\tint retv;\n \n \ttold = rcu_dereference_protected(tlv_param_table->data,\n \t\t\t\t\t lockdep_is_held(&tlv_mutex));\n \n+\t/* Check preferred order */\n+\tretv = check_order(told, type, params->t.preferred_order);\n+\tif (retv)\n+\t\treturn retv;\n+\n \t/* Create new TLV table. If there is no exsiting entry then we are\n \t * adding a new one to the table, else we're modifying an entry.\n \t */\n@@ -422,7 +459,7 @@ int ipeh_exthdrs_init(struct tlv_param_table *tlv_param_table,\n \t\t      int num_init_params)\n {\n \tstruct tlv_param_table_data *tpt;\n-\tint pos = 0, i;\n+\tint pos = 0, i, j;\n \tsize_t tsize;\n \n \ttsize = tlv_param_table_size(num_init_params + 1);\n@@ -448,6 +485,20 @@ int ipeh_exthdrs_init(struct tlv_param_table *tlv_param_table,\n \t\t\tgoto err_inval;\n \t\t}\n \n+\t\tif (WARN_ON(!tpi->proc.params.t.preferred_order)) {\n+\t\t\t/* Preferred order must be non-zero */\n+\t\t\tgoto err_inval;\n+\t\t}\n+\n+\t\tfor (j = 0; j < i; j++) {\n+\t\t\tconst struct tlv_proc_init *tpix = &tlv_init_params[j];\n+\n+\t\t\tif (WARN_ON(tpi->proc.params.t.preferred_order ==\n+\t\t\t\t    tpix->proc.params.t.preferred_order)) {\n+\t\t\t\t/* Preferred order must be unique */\n+\t\t\t\tgoto err_inval;\n+\t\t\t}\n+\t\t}\n \t\ttpt->types[pos].proc = tpi->proc;\n \t\ttpt->entries[tpi->type] = pos;\n \t}\ndiff --git a/net/ipv6/exthdrs_options.c b/net/ipv6/exthdrs_options.c\nindex d4b373e..3b50b58 100644\n--- a/net/ipv6/exthdrs_options.c\n+++ b/net/ipv6/exthdrs_options.c\n@@ -183,6 +183,17 @@ static const struct tlv_proc_init tlv_ipv6_init_params[] __initconst = {\n \n \t\t.proc.ops.func = ipv6_dest_hao,\n \t\t.proc.params.r.class = IPEH_TLV_CLASS_FLAG_DSTOPT,\n+\n+\t\t.proc.params.t = {\n+\t\t\t.preferred_order = IPEH_TLV_PREF_ORDER_HAO,\n+\t\t\t.admin_perm = IPEH_TLV_PERM_NO_CHECK,\n+\t\t\t.user_perm = IPEH_TLV_PERM_NONE,\n+\t\t\t.class = IPEH_TLV_CLASS_FLAG_DSTOPT,\n+\t\t\t.align_mult = (8 - 1), /* Align to 8n + 6 */\n+\t\t\t.align_off = 6,\n+\t\t\t.min_data_len = 16,\n+\t\t\t.max_data_len = 16,\n+\t\t},\n \t},\n #endif\n \t{\n@@ -190,18 +201,52 @@ static const struct tlv_proc_init tlv_ipv6_init_params[] __initconst = {\n \n \t\t.proc.ops.func = ipv6_hop_ra,\n \t\t.proc.params.r.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\n+\t\t.proc.params.t = {\n+\t\t\t.preferred_order = IPEH_TLV_PREF_ORDER_ROUTERALERT,\n+\t\t\t.admin_perm = IPEH_TLV_PERM_NO_CHECK,\n+\t\t\t.user_perm = IPEH_TLV_PERM_NONE,\n+\t\t\t.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\t\t\t.align_mult = (2 - 1), /* Align to 2n */\n+\t\t\t.min_data_len = 2,\n+\t\t\t.max_data_len = 2,\n+\t\t},\n \t},\n \t{\n \t\t.type = IPV6_TLV_JUMBO,\n \n \t\t.proc.ops.func\t= ipv6_hop_jumbo,\n \t\t.proc.params.r.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\n+\t\t.proc.params.t = {\n+\t\t\t.preferred_order = IPEH_TLV_PREF_ORDER_JUMBO,\n+\t\t\t.admin_perm = IPEH_TLV_PERM_NO_CHECK,\n+\t\t\t.user_perm = IPEH_TLV_PERM_NONE,\n+\t\t\t.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\t\t\t.align_mult = (4 - 1), /* Align to 4n + 2 */\n+\t\t\t.align_off = 2,\n+\t\t\t.min_data_len = 4,\n+\t\t\t.max_data_len = 4,\n+\t\t},\n \t},\n \t{\n \t\t.type = IPV6_TLV_CALIPSO,\n \n \t\t.proc.ops.func = ipv6_hop_calipso,\n \t\t.proc.params.r.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\n+\t\t.proc.params.t = {\n+\t\t\t.preferred_order = IPEH_TLV_PREF_ORDER_CALIPSO,\n+\t\t\t.admin_perm = IPEH_TLV_PERM_NO_CHECK,\n+\t\t\t.user_perm = IPEH_TLV_PERM_NONE,\n+\t\t\t.class = IPEH_TLV_CLASS_FLAG_HOPOPT,\n+\t\t\t.align_mult = (4 - 1), /* Align to 4n + 2 */\n+\t\t\t.align_off = 2,\n+\t\t\t.min_data_len = 8,\n+\t\t\t.max_data_len = 252,\n+\t\t\t.data_len_mult = (4 - 1),\n+\t\t\t\t\t/* Length is multiple of 4 */\n+\t\t},\n \t},\n };\n \n",
    "prefixes": [
        "net-next",
        "5/7"
    ]
}