Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1149678/?format=api
{ "id": 1149678, "url": "http://patchwork.ozlabs.org/api/patches/1149678/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1566254665-5200-6-git-send-email-tom@herbertland.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": "<1566254665-5200-6-git-send-email-tom@herbertland.com>", "list_archive_url": null, "date": "2019-08-19T22:44:23", "name": "[v3,net-next,5/7] ip6tlvs: Add TX parameters", "commit_ref": null, "pull_url": null, "state": "rejected", "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/1566254665-5200-6-git-send-email-tom@herbertland.com/mbox/", "series": [ { "id": 126065, "url": "http://patchwork.ozlabs.org/api/series/126065/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=126065", "date": "2019-08-19T22:44:18", "name": "ipv6: Extension header infrastructure", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/126065/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1149678/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1149678/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.133; helo=hemlock.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=\"yy2xvygN\"; dkim-atps=neutral" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 46C8Bp1LKWz9sN1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 20 Aug 2019 08:45:06 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CD70587FF7;\n\tMon, 19 Aug 2019 22:45:04 +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 v8YfUvMth63w; Mon, 19 Aug 2019 22:45:04 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 205D887FE3;\n\tMon, 19 Aug 2019 22:45:04 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id E297A1BF2AB\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Aug 2019 22:45:02 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id D83F222234\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Aug 2019 22:45:02 +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 8o995CUFXG8y for <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Aug 2019 22:44:59 +0000 (UTC)", "from mail-pl1-f195.google.com (mail-pl1-f195.google.com\n\t[209.85.214.195])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 7ACF12044F\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Aug 2019 22:44:55 +0000 (UTC)", "by mail-pl1-f195.google.com with SMTP id m9so1658746pls.8\n\tfor <Intel-wired-lan@lists.osuosl.org>;\n\tMon, 19 Aug 2019 15:44:55 -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\tx10sm14676947pjo.4.2019.08.19.15.44.53\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 19 Aug 2019 15:44:53 -0700 (PDT)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "from auto-whitelisted 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=007gyF4jCeKQJ0bKVeNxm3ngz1HOyBHE6sCB/u+npaQ=;\n\tb=yy2xvygNRO2LOSA6JlraQbXpYuVwlc04LdzrB9RQ1L6/Eu/MDKPbT6T17org/KZFcj\n\t52jBJwW21HWkPh+HeHtkqFwFqR+GgsgYRfY7rv0w8L0ngIVSTBH1Yy9AGMv8X1OkzBH7\n\tgGrR16V4nhaXDbs1gp2udJM/HNI//SDXn6Y4gO7USgdsvVzcpQ7lkzGJUMB/VaRqR3Yn\n\toI/GrzYmRPt8QTk1pdjgdF6n6+t4AmxNMzgn+9ZMSg5+GBOc4LrFJ61bZIL0VNURmH3z\n\t2wHwQecINPb5F0iAPiwsnRc2/v9yr1e3n/UticCbZ/Hr6egL9chdg2lPqBh2SM8Tansj\n\tI+Vw==", "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=007gyF4jCeKQJ0bKVeNxm3ngz1HOyBHE6sCB/u+npaQ=;\n\tb=KXuuIVxt/pt5yuCp5yHGRwgE7rU7JAp3VuSSuAPkb9/mPtp51cc0ros0nbtefc2uAB\n\t1qcxAFJEGJsZWT6Y+UKx5Rwr1fiyevt9awkb5T1cWrjm6ssoRggKgXnppIT/0B9Yae02\n\tUn3zsFfTRFdwthJLHWnNKtD72ZXCkRXCrwcSElqhucADwol5kDQohQifqY3BZVT68+c3\n\tG0929OHkiDyvN+geDbT3aNQX2qZMhE+2FrQN6z5Xuhhx/XXk5iuutHCCiVMRHXHFB5j/\n\t/NjNd4gAA/3sTOmDYcHm18rIASxQmYc4tOvVxT8dg5ktpdf3E4P+fKMf5RN1XI9xZkWd\n\trr0Q==", "X-Gm-Message-State": "APjAAAWjqQ7i/gwLbZiqcBmNCXGxsi/C6iAtlObJI56zE5OZNX4IKMc5\n\t8Omv1XYr46+gN+c8ZfX3pJckkXLx2OI=", "X-Google-Smtp-Source": "APXvYqwPKi0c/M0YFmC3fweISv4UQacd4+y1jxSpR/yt8SPDUs8bB/OTNOovPNdf5q170KLZGosMRQ==", "X-Received": "by 2002:a17:902:28a2:: with SMTP id\n\tf31mr10280379plb.44.1566254694631; \n\tMon, 19 Aug 2019 15:44:54 -0700 (PDT)", "From": "Tom Herbert <tom@herbertland.com>", "To": "Intel-wired-lan@lists.osuosl.org", "Date": "Mon, 19 Aug 2019 15:44:23 -0700", "Message-Id": "<1566254665-5200-6-git-send-email-tom@herbertland.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1566254665-5200-1-git-send-email-tom@herbertland.com>", "References": "<1566254665-5200-1-git-send-email-tom@herbertland.com>", "Subject": "[Intel-wired-lan] [PATCH v3 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@herbertland.com>, 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": "From: Tom Herbert <tom@quantonium.net>\n\nDefine 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@herbertland.com>\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 aaa2910..de6d9d0 100644\n--- a/include/net/ipeh.h\n+++ b/include/net/ipeh.h\n@@ -20,6 +20,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@@ -54,6 +65,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": [ "v3", "net-next", "5/7" ] }