Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/824156/?format=api
{ "id": 824156, "url": "http://patchwork.ozlabs.org/api/patches/824156/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171011004652.15630-2-vinicius.gomes@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": "<20171011004652.15630-2-vinicius.gomes@intel.com>", "list_archive_url": null, "date": "2017-10-11T00:46:51", "name": "[iproute2,net-next,v2,2/3] tc: Add support for the CBS qdisc", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b7a900daec692e0fbc65bf9a6c2bc7037d38954d", "submitter": { "id": 72272, "url": "http://patchwork.ozlabs.org/api/people/72272/?format=api", "name": "Vinicius Costa Gomes", "email": "vinicius.gomes@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/20171011004652.15630-2-vinicius.gomes@intel.com/mbox/", "series": [ { "id": 7490, "url": "http://patchwork.ozlabs.org/api/series/7490/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=7490", "date": "2017-10-11T00:46:50", "name": "[iproute2,net-next,v2,1/3] update headers with CBS API [ONLY FOR TESTING]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/7490/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/824156/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/824156/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>)", "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3yBb0j0xkFz9t64\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 11 Oct 2017 11:47:17 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 924F4824DC;\n\tWed, 11 Oct 2017 00:47:15 +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 oPbr+HJqtWDK; Wed, 11 Oct 2017 00:47:12 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2536A82FAB;\n\tWed, 11 Oct 2017 00:47:12 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C71311C0FDB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Oct 2017 00:47:09 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BD54D89012\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Oct 2017 00:47:09 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 1k5IjUajPSZu for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Oct 2017 00:47:08 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 1BE1289018\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Oct 2017 00:47:08 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Oct 2017 17:47:07 -0700", "from ellie.jf.intel.com (HELO localhost.localdomain)\n\t([10.24.13.71])\n\tby FMSMGA003.fm.intel.com with ESMTP; 10 Oct 2017 17:47:07 -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.43,359,1503385200\"; d=\"scan'208\";a=\"908716152\"", "From": "Vinicius Costa Gomes <vinicius.gomes@intel.com>", "To": "netdev@vger.kernel.org,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Tue, 10 Oct 2017 17:46:51 -0700", "Message-Id": "<20171011004652.15630-2-vinicius.gomes@intel.com>", "X-Mailer": "git-send-email 2.14.2", "In-Reply-To": "<20171011004652.15630-1-vinicius.gomes@intel.com>", "References": "<20171011004652.15630-1-vinicius.gomes@intel.com>", "Cc": "rodney.cummings@ni.com, andre.guedes@intel.com, jiri@resnulli.us,\n\tivan.briano@intel.com, richardcochran@gmail.com, henrik@austad.us,\n\tjhs@mojatatu.com, levipearson@gmail.com, boon.leong.ong@intel.com,\n\txiyou.wangcong@gmail.com, jesus.sanchez-palencia@intel.com", "Subject": "[Intel-wired-lan] [iproute2 net-next v2 2/3] tc: Add support for\n\tthe CBS qdisc", "X-BeenThere": "intel-wired-lan@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.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>", "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": "The Credit Based Shaper (CBS) queueing discipline allows bandwidth\nreservation with sub-milisecond precision. It is defined by the\n802.1Q-2014 specification (section 8.6.8.2 and Annex L).\n\nThe syntax is:\n\ntc qdisc add dev DEV parent NODE cbs locredit <LOCREDIT>\n \t\thicredit <HICREDIT> sendslope <SENDSLOPE>\n\t\tidleslope <IDLESLOPE>\n\n(The order is not important)\n\nSigned-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>\n---\n tc/Makefile | 1 +\n tc/q_cbs.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 143 insertions(+)\n create mode 100644 tc/q_cbs.c", "diff": "diff --git a/tc/Makefile b/tc/Makefile\nindex 777de5e6..24bd3e2e 100644\n--- a/tc/Makefile\n+++ b/tc/Makefile\n@@ -69,6 +69,7 @@ TCMODULES += q_hhf.o\n TCMODULES += q_clsact.o\n TCMODULES += e_bpf.o\n TCMODULES += f_matchall.o\n+TCMODULES += q_cbs.o\n \n TCSO :=\n ifeq ($(TC_CONFIG_ATM),y)\ndiff --git a/tc/q_cbs.c b/tc/q_cbs.c\nnew file mode 100644\nindex 00000000..e53be654\n--- /dev/null\n+++ b/tc/q_cbs.c\n@@ -0,0 +1,142 @@\n+/*\n+ * q_cbs.c\t\tCBS.\n+ *\n+ *\t\tThis program is free software; you can redistribute it and/or\n+ *\t\tmodify it under the terms of the GNU General Public License\n+ *\t\tas published by the Free Software Foundation; either version\n+ *\t\t2 of the License, or (at your option) any later version.\n+ *\n+ * Authors:\tVinicius Costa Gomes <vinicius.gomes@intel.com>\n+ *\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <syslog.h>\n+#include <fcntl.h>\n+#include <sys/socket.h>\n+#include <netinet/in.h>\n+#include <arpa/inet.h>\n+#include <string.h>\n+\n+#include \"utils.h\"\n+#include \"tc_util.h\"\n+\n+static void explain(void)\n+{\n+\tfprintf(stderr, \"Usage: ... cbs hicredit BYTES locredit BYTES sendslope BPS idleslope BPS\\n\");\n+\tfprintf(stderr, \" [offload 0|1]\\n\");\n+\n+}\n+\n+static void explain1(const char *arg, const char *val)\n+{\n+\tfprintf(stderr, \"cbs: illegal value for \\\"%s\\\": \\\"%s\\\"\\n\", arg, val);\n+}\n+\n+static int cbs_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)\n+{\n+\tstruct tc_cbs_qopt opt = {};\n+\tstruct rtattr *tail;\n+\n+\twhile (argc > 0) {\n+\t\tif (matches(*argv, \"offload\") == 0) {\n+\t\t\tNEXT_ARG();\n+\t\t\tif (opt.offload) {\n+\t\t\t\tfprintf(stderr, \"cbs: duplicate \\\"offload\\\" specification\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (get_u8(&opt.offload, *argv, 0)) {\n+\t\t\t\texplain1(\"offload\", *argv);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t} else if (matches(*argv, \"hicredit\") == 0) {\n+\t\t\tNEXT_ARG();\n+\t\t\tif (opt.hicredit) {\n+\t\t\t\tfprintf(stderr, \"cbs: duplicate \\\"hicredit\\\" specification\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (get_s32(&opt.hicredit, *argv, 0)) {\n+\t\t\t\texplain1(\"hicredit\", *argv);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t} else if (matches(*argv, \"locredit\") == 0) {\n+\t\t\tNEXT_ARG();\n+\t\t\tif (opt.locredit) {\n+\t\t\t\tfprintf(stderr, \"cbs: duplicate \\\"locredit\\\" specification\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (get_s32(&opt.locredit, *argv, 0)) {\n+\t\t\t\texplain1(\"locredit\", *argv);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t} else if (matches(*argv, \"sendslope\") == 0) {\n+\t\t\tNEXT_ARG();\n+\t\t\tif (opt.sendslope) {\n+\t\t\t\tfprintf(stderr, \"cbs: duplicate \\\"sendslope\\\" specification\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (get_s32(&opt.sendslope, *argv, 0)) {\n+\t\t\t\texplain1(\"sendslope\", *argv);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t} else if (matches(*argv, \"idleslope\") == 0) {\n+\t\t\tNEXT_ARG();\n+\t\t\tif (opt.idleslope) {\n+\t\t\t\tfprintf(stderr, \"cbs: duplicate \\\"idleslope\\\" specification\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (get_s32(&opt.idleslope, *argv, 0)) {\n+\t\t\t\texplain1(\"idleslope\", *argv);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t} else if (strcmp(*argv, \"help\") == 0) {\n+\t\t\texplain();\n+\t\t\treturn -1;\n+\t\t} else {\n+\t\t\tfprintf(stderr, \"cbs: unknown parameter \\\"%s\\\"\\n\", *argv);\n+\t\t\texplain();\n+\t\t\treturn -1;\n+\t\t}\n+\t\targc--; argv++;\n+\t}\n+\n+\ttail = NLMSG_TAIL(n);\n+\taddattr_l(n, 1024, TCA_OPTIONS, NULL, 0);\n+\taddattr_l(n, 2024, TCA_CBS_PARMS, &opt, sizeof(opt));\n+\ttail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;\n+\treturn 0;\n+}\n+\n+static int cbs_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)\n+{\n+\tstruct rtattr *tb[TCA_CBS_MAX+1];\n+\tstruct tc_cbs_qopt *qopt;\n+\n+\tif (opt == NULL)\n+\t\treturn 0;\n+\n+\tparse_rtattr_nested(tb, TCA_CBS_MAX, opt);\n+\n+\tif (tb[TCA_CBS_PARMS] == NULL)\n+\t\treturn -1;\n+\n+\tqopt = RTA_DATA(tb[TCA_CBS_PARMS]);\n+\tif (RTA_PAYLOAD(tb[TCA_CBS_PARMS]) < sizeof(*qopt))\n+\t\treturn -1;\n+\n+\tfprintf(f, \"hicredit %d \", qopt->hicredit);\n+\tfprintf(f, \"locredit %d \", qopt->locredit);\n+\tfprintf(f, \"sendslope %d \", qopt->sendslope);\n+\tfprintf(f, \"idleslope %d \", qopt->idleslope);\n+\tfprintf(f, \"offload %d \", qopt->offload);\n+\n+\treturn 0;\n+}\n+\n+struct qdisc_util cbs_qdisc_util = {\n+\t.id\t\t= \"cbs\",\n+\t.parse_qopt\t= cbs_parse_opt,\n+\t.print_qopt\t= cbs_print_opt,\n+};\n", "prefixes": [ "iproute2", "net-next", "v2", "2/3" ] }