get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 786531,
    "url": "http://patchwork.ozlabs.org/api/patches/786531/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/149976831535.2896.16233967758531918702.stgit@anamdev.jf.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": "<149976831535.2896.16233967758531918702.stgit@anamdev.jf.intel.com>",
    "list_archive_url": null,
    "date": "2017-07-11T10:18:35",
    "name": "[1/6,next-queue] net: mqprio: Introduce new hardware offload mode in mqprio for offloading full TC configurations",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "c5b5d6c572689edeac7a01fa9d234b52a8eecefe",
    "submitter": {
        "id": 68504,
        "url": "http://patchwork.ozlabs.org/api/people/68504/?format=api",
        "name": "Nambiar, Amritha",
        "email": "amritha.nambiar@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/149976831535.2896.16233967758531918702.stgit@anamdev.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/786531/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/786531/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"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3x6J342Kqwz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 11 Jul 2017 20:19:12 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id DAFF186E45;\n\tTue, 11 Jul 2017 10:19:10 +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 cc2svcAK7v1t; Tue, 11 Jul 2017 10:19:07 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AF47D86DE4;\n\tTue, 11 Jul 2017 10:19:07 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2C8F71C2082\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Jul 2017 10:19:06 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 269B43018D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Jul 2017 10:19:06 +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 6ixJVoF2jpaX for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Jul 2017 10:19:04 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 405C430183\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Jul 2017 10:19:04 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jul 2017 03:19:03 -0700",
            "from anamdev.jf.intel.com ([10.166.29.110])\n\tby fmsmga004.fm.intel.com with ESMTP; 11 Jul 2017 03:19:02 -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.40,345,1496127600\"; d=\"scan'208\";a=\"285416697\"",
        "From": "Amritha Nambiar <amritha.nambiar@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Tue, 11 Jul 2017 03:18:35 -0700",
        "Message-ID": "<149976831535.2896.16233967758531918702.stgit@anamdev.jf.intel.com>",
        "In-Reply-To": "<149976762072.2896.5722904915197643856.stgit@anamdev.jf.intel.com>",
        "References": "<149976762072.2896.5722904915197643856.stgit@anamdev.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Cc": "netdev@vger.kernel.org, mitch.a.williams@intel.com",
        "Subject": "[Intel-wired-lan] [PATCH 1/6] [next-queue]net: mqprio: Introduce\n\tnew hardware offload mode in mqprio for offloading full TC\n\tconfigurations",
        "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>",
        "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": "This patch introduces a new hardware offload mode in mqprio\nwhich makes full use of the mqprio options, the TCs, the\nqueue configurations and the bandwidth rates for the TCs.\nThis is achieved by setting the value 2 for the \"hw\" option.\nThis new offload mode supports new attributes for traffic\nclass such as minimum and maximum values for bandwidth rate limits.\n\nIntroduces a new datastructure 'tc_mqprio_qopt_offload' for offloading\nmqprio queue options and use this to be shared between the kernel and\ndevice driver. This contains a copy of the exisiting datastructure\nfor mqprio queue options. This new datastructure can be extended when\nadding new attributes for traffic class such as bandwidth rate limits. The\nexisting datastructure for mqprio queue options will be shared between the\nkernel and userspace.\n\nThis patch enables configuring additional attributes associated\nwith a traffic class such as minimum and maximum bandwidth\nrates and can be offloaded to the hardware in the new offload mode.\nThe min and max limits for bandwidth rates are provided\nby the user along with the the TCs and the queue configurations\nwhen creating the mqprio qdisc.\n\nExample:\n# tc qdisc add dev eth0 root mqprio num_tc 2 map 0 0 0 0 1 1 1 1\\\n  queues 4@0 4@4 min_rate 0Mbit 0Mbit max_rate 55Mbit 60Mbit hw 2\n\nTo dump the bandwidth rates:\n\n# tc qdisc show dev eth0\n\nqdisc mqprio 804a: root  tc 2 map 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0\n             queues:(0:3) (4:7)\n             min rates:0bit 0bit\n             max rates:55Mbit 60Mbit\n\nSigned-off-by: Amritha Nambiar <amritha.nambiar@intel.com>\n---\n include/linux/netdevice.h      |    2 \n include/net/pkt_cls.h          |    7 ++\n include/uapi/linux/pkt_sched.h |   13 +++\n net/sched/sch_mqprio.c         |  170 +++++++++++++++++++++++++++++++++++++---\n 4 files changed, 181 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h\nindex e48ee2e..12c6c3f 100644\n--- a/include/linux/netdevice.h\n+++ b/include/linux/netdevice.h\n@@ -779,6 +779,7 @@ enum {\n \tTC_SETUP_CLSFLOWER,\n \tTC_SETUP_MATCHALL,\n \tTC_SETUP_CLSBPF,\n+\tTC_SETUP_MQPRIO_EXT,\n };\n \n struct tc_cls_u32_offload;\n@@ -791,6 +792,7 @@ struct tc_to_netdev {\n \t\tstruct tc_cls_matchall_offload *cls_mall;\n \t\tstruct tc_cls_bpf_offload *cls_bpf;\n \t\tstruct tc_mqprio_qopt *mqprio;\n+\t\tstruct tc_mqprio_qopt_offload *mqprio_qopt;\n \t};\n \tbool egress_dev;\n };\ndiff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h\nindex 537d0a0..9facda2 100644\n--- a/include/net/pkt_cls.h\n+++ b/include/net/pkt_cls.h\n@@ -569,6 +569,13 @@ struct tc_cls_bpf_offload {\n \tu32 gen_flags;\n };\n \n+struct tc_mqprio_qopt_offload {\n+\t/* struct tc_mqprio_qopt must always be the first element */\n+\tstruct tc_mqprio_qopt qopt;\n+\tu32 flags;\n+\tu64 min_rate[TC_QOPT_MAX_QUEUE];\n+\tu64 max_rate[TC_QOPT_MAX_QUEUE];\n+};\n \n /* This structure holds cookie structure that is passed from user\n  * to the kernel for actions and classifiers\ndiff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h\nindex 099bf55..cf2a146 100644\n--- a/include/uapi/linux/pkt_sched.h\n+++ b/include/uapi/linux/pkt_sched.h\n@@ -620,6 +620,7 @@ struct tc_drr_stats {\n enum {\n \tTC_MQPRIO_HW_OFFLOAD_NONE,\t/* no offload requested */\n \tTC_MQPRIO_HW_OFFLOAD_TCS,\t/* offload TCs, no queue counts */\n+\tTC_MQPRIO_HW_OFFLOAD,\t\t/* fully supported offload */\n \t__TC_MQPRIO_HW_OFFLOAD_MAX\n };\n \n@@ -633,6 +634,18 @@ struct tc_mqprio_qopt {\n \t__u16\toffset[TC_QOPT_MAX_QUEUE];\n };\n \n+#define TC_MQPRIO_F_MIN_RATE  0x1\n+#define TC_MQPRIO_F_MAX_RATE  0x2\n+\n+enum {\n+\tTCA_MQPRIO_UNSPEC,\n+\tTCA_MQPRIO_MIN_RATE64,\n+\tTCA_MQPRIO_MAX_RATE64,\n+\t__TCA_MQPRIO_MAX,\n+};\n+\n+#define TCA_MQPRIO_MAX (__TCA_MQPRIO_MAX - 1)\n+\n /* SFB */\n \n enum {\ndiff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c\nindex e0c0272..6524d12 100644\n--- a/net/sched/sch_mqprio.c\n+++ b/net/sched/sch_mqprio.c\n@@ -18,10 +18,13 @@\n #include <net/netlink.h>\n #include <net/pkt_sched.h>\n #include <net/sch_generic.h>\n+#include <net/pkt_cls.h>\n \n struct mqprio_sched {\n \tstruct Qdisc\t\t**qdiscs;\n \tint hw_offload;\n+\tu32 flags;\n+\tu64 min_rate[TC_QOPT_MAX_QUEUE], max_rate[TC_QOPT_MAX_QUEUE];\n };\n \n static void mqprio_destroy(struct Qdisc *sch)\n@@ -39,9 +42,21 @@ static void mqprio_destroy(struct Qdisc *sch)\n \t}\n \n \tif (priv->hw_offload && dev->netdev_ops->ndo_setup_tc) {\n-\t\tstruct tc_mqprio_qopt offload = { 0 };\n-\t\tstruct tc_to_netdev tc = { .type = TC_SETUP_MQPRIO,\n-\t\t\t\t\t   { .mqprio = &offload } };\n+\t\tstruct tc_mqprio_qopt_offload offload = { { 0 } };\n+\t\tstruct tc_to_netdev tc = { 0 };\n+\n+\t\tswitch (priv->hw_offload) {\n+\t\tcase TC_MQPRIO_HW_OFFLOAD_TCS:\n+\t\t\ttc.type = TC_SETUP_MQPRIO;\n+\t\t\ttc.mqprio = &offload.qopt;\n+\t\t\tbreak;\n+\t\tcase TC_MQPRIO_HW_OFFLOAD:\n+\t\t\ttc.type = TC_SETUP_MQPRIO_EXT;\n+\t\t\ttc.mqprio_qopt = &offload;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn;\n+\t\t}\n \n \t\tdev->netdev_ops->ndo_setup_tc(dev, sch->handle, 0, 0, &tc);\n \t} else {\n@@ -99,6 +114,24 @@ static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt)\n \treturn 0;\n }\n \n+static const struct nla_policy mqprio_policy[TCA_MQPRIO_MAX + 1] = {\n+\t[TCA_MQPRIO_MIN_RATE64] = { .type = NLA_NESTED },\n+\t[TCA_MQPRIO_MAX_RATE64] = { .type = NLA_NESTED },\n+};\n+\n+static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla,\n+\t\t      const struct nla_policy *policy, int len)\n+{\n+\tint nested_len = nla_len(nla) - NLA_ALIGN(len);\n+\n+\tif (nested_len >= nla_attr_size(0))\n+\t\treturn nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),\n+\t\t\t\t nested_len, policy, NULL);\n+\n+\tmemset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));\n+\treturn 0;\n+}\n+\n static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)\n {\n \tstruct net_device *dev = qdisc_dev(sch);\n@@ -107,6 +140,10 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)\n \tstruct Qdisc *qdisc;\n \tint i, err = -EOPNOTSUPP;\n \tstruct tc_mqprio_qopt *qopt = NULL;\n+\tstruct nlattr *tb[TCA_MQPRIO_MAX + 1];\n+\tstruct nlattr *attr;\n+\tint rem;\n+\tint len = nla_len(opt) - NLA_ALIGN(sizeof(*qopt));\n \n \tBUILD_BUG_ON(TC_MAX_QUEUE != TC_QOPT_MAX_QUEUE);\n \tBUILD_BUG_ON(TC_BITMASK != TC_QOPT_BITMASK);\n@@ -124,6 +161,51 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)\n \tif (mqprio_parse_opt(dev, qopt))\n \t\treturn -EINVAL;\n \n+\tif (len > 0) {\n+\t\terr = parse_attr(tb, TCA_MQPRIO_MAX, opt, mqprio_policy,\n+\t\t\t\t sizeof(*qopt));\n+\t\tif (err < 0)\n+\t\t\treturn err;\n+\n+\t\tif (tb[TCA_MQPRIO_MIN_RATE64]) {\n+\t\t\tif (qopt->hw != TC_MQPRIO_HW_OFFLOAD)\n+\t\t\t\treturn -EINVAL;\n+\n+\t\t\ti = 0;\n+\t\t\tnla_for_each_nested(attr, tb[TCA_MQPRIO_MIN_RATE64],\n+\t\t\t\t\t    rem) {\n+\t\t\t\tif (nla_type(attr) != TCA_MQPRIO_MIN_RATE64)\n+\t\t\t\t\treturn -EINVAL;\n+\n+\t\t\t\tif (i >= qopt->num_tc)\n+\t\t\t\t\treturn -EINVAL;\n+\n+\t\t\t\tpriv->min_rate[i] = *(u64 *)nla_data(attr);\n+\t\t\t\ti++;\n+\t\t\t}\n+\t\t\tpriv->flags |= TC_MQPRIO_F_MIN_RATE;\n+\t\t}\n+\n+\t\tif (tb[TCA_MQPRIO_MAX_RATE64]) {\n+\t\t\tif (qopt->hw != TC_MQPRIO_HW_OFFLOAD)\n+\t\t\t\treturn -EINVAL;\n+\n+\t\t\ti = 0;\n+\t\t\tnla_for_each_nested(attr, tb[TCA_MQPRIO_MAX_RATE64],\n+\t\t\t\t\t    rem) {\n+\t\t\t\tif (nla_type(attr) != TCA_MQPRIO_MAX_RATE64)\n+\t\t\t\t\treturn -EINVAL;\n+\n+\t\t\t\tif (i >= qopt->num_tc)\n+\t\t\t\t\treturn -EINVAL;\n+\n+\t\t\t\tpriv->max_rate[i] = *(u64 *)nla_data(attr);\n+\t\t\t\ti++;\n+\t\t\t}\n+\t\t\tpriv->flags |= TC_MQPRIO_F_MAX_RATE;\n+\t\t}\n+\t}\n+\n \t/* pre-allocate qdisc, attachment can't fail */\n \tpriv->qdiscs = kcalloc(dev->num_tx_queues, sizeof(priv->qdiscs[0]),\n \t\t\t       GFP_KERNEL);\n@@ -148,16 +230,37 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)\n \t * supplied and verified mapping\n \t */\n \tif (qopt->hw) {\n-\t\tstruct tc_mqprio_qopt offload = *qopt;\n-\t\tstruct tc_to_netdev tc = { .type = TC_SETUP_MQPRIO,\n-\t\t\t\t\t   { .mqprio = &offload } };\n+\t\tstruct tc_mqprio_qopt_offload offload = {.qopt = *qopt};\n+\t\tstruct tc_to_netdev tc = { 0 };\n+\n+\t\tswitch (qopt->hw) {\n+\t\tcase TC_MQPRIO_HW_OFFLOAD_TCS:\n+\t\t\ttc.type = TC_SETUP_MQPRIO;\n+\t\t\ttc.mqprio = &offload.qopt;\n+\t\t\tbreak;\n+\t\tcase TC_MQPRIO_HW_OFFLOAD:\n+\t\t\ttc.type = TC_SETUP_MQPRIO_EXT;\n+\t\t\ttc.mqprio_qopt = &offload;\n+\n+\t\t\toffload.flags = priv->flags;\n+\t\t\tif (priv->flags & TC_MQPRIO_F_MIN_RATE)\n+\t\t\t\tfor (i = 0; i < offload.qopt.num_tc; i++)\n+\t\t\t\t\toffload.min_rate[i] = priv->min_rate[i];\n+\n+\t\t\tif (priv->flags & TC_MQPRIO_F_MAX_RATE)\n+\t\t\t\tfor (i = 0; i < offload.qopt.num_tc; i++)\n+\t\t\t\t\toffload.max_rate[i] = priv->max_rate[i];\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -EINVAL;\n+\t\t}\n \n \t\terr = dev->netdev_ops->ndo_setup_tc(dev, sch->handle,\n \t\t\t\t\t\t    0, 0, &tc);\n \t\tif (err)\n \t\t\treturn err;\n \n-\t\tpriv->hw_offload = offload.hw;\n+\t\tpriv->hw_offload = offload.qopt.hw;\n \t} else {\n \t\tnetdev_set_num_tc(dev, qopt->num_tc);\n \t\tfor (i = 0; i < qopt->num_tc; i++)\n@@ -227,11 +330,51 @@ static int mqprio_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new,\n \treturn 0;\n }\n \n+static int dump_rates(struct mqprio_sched *priv,\n+\t\t      struct tc_mqprio_qopt *opt, struct sk_buff *skb)\n+{\n+\tstruct nlattr *nest;\n+\tint i;\n+\n+\tif (priv->flags & TC_MQPRIO_F_MIN_RATE) {\n+\t\tnest = nla_nest_start(skb, TCA_MQPRIO_MIN_RATE64);\n+\t\tif (!nest)\n+\t\t\tgoto nla_put_failure;\n+\n+\t\tfor (i = 0; i < opt->num_tc; i++) {\n+\t\t\tif (nla_put(skb, TCA_MQPRIO_MIN_RATE64,\n+\t\t\t\t    sizeof(priv->min_rate[i]),\n+\t\t\t\t    &priv->min_rate[i]))\n+\t\t\t\tgoto nla_put_failure;\n+\t\t}\n+\t\tnla_nest_end(skb, nest);\n+\t}\n+\n+\tif (priv->flags & TC_MQPRIO_F_MAX_RATE) {\n+\t\tnest = nla_nest_start(skb, TCA_MQPRIO_MAX_RATE64);\n+\t\tif (!nest)\n+\t\t\tgoto nla_put_failure;\n+\n+\t\tfor (i = 0; i < opt->num_tc; i++) {\n+\t\t\tif (nla_put(skb, TCA_MQPRIO_MAX_RATE64,\n+\t\t\t\t    sizeof(priv->max_rate[i]),\n+\t\t\t\t    &priv->max_rate[i]))\n+\t\t\t\tgoto nla_put_failure;\n+\t\t}\n+\t\tnla_nest_end(skb, nest);\n+\t}\n+\treturn 0;\n+\n+nla_put_failure:\n+\tnla_nest_cancel(skb, nest);\n+\treturn -1;\n+}\n+\n static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)\n {\n \tstruct net_device *dev = qdisc_dev(sch);\n \tstruct mqprio_sched *priv = qdisc_priv(sch);\n-\tunsigned char *b = skb_tail_pointer(skb);\n+\tstruct nlattr *nla = (struct nlattr *)skb_tail_pointer(skb);\n \tstruct tc_mqprio_qopt opt = { 0 };\n \tstruct Qdisc *qdisc;\n \tunsigned int i;\n@@ -262,12 +405,17 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)\n \t\topt.offset[i] = dev->tc_to_txq[i].offset;\n \t}\n \n-\tif (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt))\n+\tif (nla_put(skb, TCA_OPTIONS, NLA_ALIGN(sizeof(opt)), &opt))\n \t\tgoto nla_put_failure;\n \n-\treturn skb->len;\n+\tif (priv->flags & TC_MQPRIO_F_MIN_RATE ||\n+\t    priv->flags & TC_MQPRIO_F_MAX_RATE)\n+\t\tif (dump_rates(priv, &opt, skb) != 0)\n+\t\t\tgoto nla_put_failure;\n+\n+\treturn nla_nest_end(skb, nla);\n nla_put_failure:\n-\tnlmsg_trim(skb, b);\n+\tnlmsg_trim(skb, nla);\n \treturn -1;\n }\n \n",
    "prefixes": [
        "1/6",
        "next-queue"
    ]
}