get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43376,
    "url": "http://patches.dpdk.org/api/patches/43376/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180725171007.94198-7-jasvinder.singh@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20180725171007.94198-7-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180725171007.94198-7-jasvinder.singh@intel.com",
    "date": "2018-07-25T17:10:07",
    "name": "[6/6] net/softnic: add CLI command for default tmgr hierarchy",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5a46d11ade8a0fb308c984293528ba4efaca4fea",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180725171007.94198-7-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 775,
            "url": "http://patches.dpdk.org/api/series/775/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=775",
            "date": "2018-07-25T17:10:01",
            "name": "net/softnic: expose tmgr through firmware",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/775/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43376/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/43376/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 132694C8D;\n\tWed, 25 Jul 2018 19:10:26 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id DF5CF378E\n\tfor <dev@dpdk.org>; Wed, 25 Jul 2018 19:10:16 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jul 2018 10:10:15 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby orsmga003.jf.intel.com with ESMTP; 25 Jul 2018 10:10:15 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,401,1526367600\"; d=\"scan'208\";a=\"69856173\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com",
        "Date": "Wed, 25 Jul 2018 18:10:07 +0100",
        "Message-Id": "<20180725171007.94198-7-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20180725171007.94198-1-jasvinder.singh@intel.com>",
        "References": "<20180725171007.94198-1-jasvinder.singh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 6/6] net/softnic: add CLI command for default\n\ttmgr hierarchy",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n\nAdd support for creating default Traffic Manager (TMGR) hierarchy through\nfirmware CLI script.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic_cli.c | 498 ++++++++++++++++++++++++++++++\n 1 file changed, 498 insertions(+)",
    "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c\nindex 4bd792b..0c7448c 100644\n--- a/drivers/net/softnic/rte_eth_softnic_cli.c\n+++ b/drivers/net/softnic/rte_eth_softnic_cli.c\n@@ -502,6 +502,498 @@ cmd_tmgr_node(struct pmd_internals *softnic,\n \t}\n }\n \n+static uint32_t\n+root_node_id(uint32_t n_spp,\n+\tuint32_t n_pps)\n+{\n+\tuint32_t n_queues = n_spp * n_pps * RTE_SCHED_QUEUES_PER_PIPE;\n+\tuint32_t n_tc = n_spp * n_pps * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE;\n+\tuint32_t n_pipes = n_spp * n_pps;\n+\n+\treturn n_queues + n_tc + n_pipes + n_spp;\n+}\n+\n+static uint32_t\n+subport_node_id(uint32_t n_spp,\n+\tuint32_t n_pps,\n+\tuint32_t subport_id)\n+{\n+\tuint32_t n_pipes = n_spp * n_pps;\n+\tuint32_t n_tc = n_pipes * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE;\n+\tuint32_t n_queues = n_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\treturn n_queues + n_tc + n_pipes + subport_id;\n+}\n+\n+static uint32_t\n+pipe_node_id(uint32_t n_spp,\n+\tuint32_t n_pps,\n+\tuint32_t subport_id,\n+\tuint32_t pipe_id)\n+{\n+\tuint32_t n_pipes = n_spp * n_pps;\n+\tuint32_t n_tc = n_pipes * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE;\n+\tuint32_t n_queues = n_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\treturn n_queues +\n+\t\tn_tc +\n+\t\tpipe_id +\n+\t\tsubport_id * n_pps;\n+}\n+\n+static uint32_t\n+tc_node_id(uint32_t n_spp,\n+\tuint32_t n_pps,\n+\tuint32_t subport_id,\n+\tuint32_t pipe_id,\n+\tuint32_t tc_id)\n+{\n+\tuint32_t n_pipes = n_spp * n_pps;\n+\tuint32_t n_queues = n_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\treturn n_queues +\n+\t\ttc_id +\n+\t\t(pipe_id + subport_id * n_pps) * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE;\n+}\n+\n+static uint32_t\n+queue_node_id(uint32_t n_spp __rte_unused,\n+\tuint32_t n_pps,\n+\tuint32_t subport_id,\n+\tuint32_t pipe_id,\n+\tuint32_t tc_id,\n+\tuint32_t queue_id)\n+{\n+\treturn queue_id +\n+\t\ttc_id * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE +\n+\t\t(pipe_id + subport_id * n_pps) * RTE_SCHED_QUEUES_PER_PIPE;\n+}\n+\n+struct tmgr_hierarchy_default_params {\n+\tuint32_t n_spp; /**< Number of subports per port. */\n+\tuint32_t n_pps; /**< Number of pipes per subport. */\n+\n+\tstruct {\n+\t\tuint32_t port;\n+\t\tuint32_t subport;\n+\t\tuint32_t pipe;\n+\t\tuint32_t tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n+\t} shaper_profile_id;\n+\n+\tstruct {\n+\t\tuint32_t tc[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n+\t\tuint32_t tc_valid[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n+\t} shared_shaper_id;\n+\n+\tstruct {\n+\t\tuint32_t queue[RTE_SCHED_QUEUES_PER_PIPE];\n+\t} weight;\n+};\n+\n+static int\n+tmgr_hierarchy_default(struct pmd_internals *softnic,\n+\tstruct tmgr_hierarchy_default_params *params)\n+{\n+\tstruct rte_tm_node_params root_node_params = {\n+\t\t.shaper_profile_id = params->shaper_profile_id.port,\n+\t\t.nonleaf = {\n+\t\t\t.n_sp_priorities = 1,\n+\t\t},\n+\t};\n+\n+\tstruct rte_tm_node_params subport_node_params = {\n+\t\t.shaper_profile_id = params->shaper_profile_id.subport,\n+\t\t.nonleaf = {\n+\t\t\t.n_sp_priorities = 1,\n+\t\t},\n+\t};\n+\n+\tstruct rte_tm_node_params pipe_node_params = {\n+\t\t.shaper_profile_id = params->shaper_profile_id.pipe,\n+\t\t.nonleaf = {\n+\t\t\t.n_sp_priorities = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,\n+\t\t},\n+\t};\n+\n+\tstruct rte_tm_node_params tc_node_params[] = {\n+\t\t[0] = {\n+\t\t\t.shaper_profile_id = params->shaper_profile_id.tc[0],\n+\t\t\t.shared_shaper_id = &params->shared_shaper_id.tc[0],\n+\t\t\t.n_shared_shapers =\n+\t\t\t\t(&params->shared_shaper_id.tc_valid[0]) ? 1 : 0,\n+\t\t\t.nonleaf = {\n+\t\t\t\t.n_sp_priorities = 1,\n+\t\t\t},\n+\t\t},\n+\n+\t\t[1] = {\n+\t\t\t.shaper_profile_id = params->shaper_profile_id.tc[1],\n+\t\t\t.shared_shaper_id = &params->shared_shaper_id.tc[1],\n+\t\t\t.n_shared_shapers =\n+\t\t\t\t(&params->shared_shaper_id.tc_valid[1]) ? 1 : 0,\n+\t\t\t.nonleaf = {\n+\t\t\t\t.n_sp_priorities = 1,\n+\t\t\t},\n+\t\t},\n+\n+\t\t[2] = {\n+\t\t\t.shaper_profile_id = params->shaper_profile_id.tc[2],\n+\t\t\t.shared_shaper_id = &params->shared_shaper_id.tc[2],\n+\t\t\t.n_shared_shapers =\n+\t\t\t\t(&params->shared_shaper_id.tc_valid[2]) ? 1 : 0,\n+\t\t\t.nonleaf = {\n+\t\t\t\t.n_sp_priorities = 1,\n+\t\t\t},\n+\t\t},\n+\n+\t\t[3] = {\n+\t\t\t.shaper_profile_id = params->shaper_profile_id.tc[3],\n+\t\t\t.shared_shaper_id = &params->shared_shaper_id.tc[3],\n+\t\t\t.n_shared_shapers =\n+\t\t\t\t(&params->shared_shaper_id.tc_valid[3]) ? 1 : 0,\n+\t\t\t.nonleaf = {\n+\t\t\t\t.n_sp_priorities = 1,\n+\t\t\t},\n+\t\t},\n+\t};\n+\n+\tstruct rte_tm_node_params queue_node_params = {\n+\t\t.shaper_profile_id = RTE_TM_SHAPER_PROFILE_ID_NONE,\n+\t};\n+\n+\tstruct rte_tm_error error;\n+\tuint32_t n_spp = params->n_spp, n_pps = params->n_pps, s;\n+\tint status;\n+\tuint16_t port_id;\n+\n+\tstatus = rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);\n+\tif (status)\n+\t\treturn -1;\n+\n+\t/* Hierarchy level 0: Root node */\n+\tstatus = rte_tm_node_add(port_id,\n+\t\troot_node_id(n_spp, n_pps),\n+\t\tRTE_TM_NODE_ID_NULL,\n+\t\t0,\n+\t\t1,\n+\t\tRTE_TM_NODE_LEVEL_ID_ANY,\n+\t\t&root_node_params,\n+\t\t&error);\n+\tif (status)\n+\t\treturn -1;\n+\n+\t/* Hierarchy level 1: Subport nodes */\n+\tfor (s = 0; s < params->n_spp; s++) {\n+\t\tuint32_t p;\n+\n+\t\tstatus = rte_tm_node_add(port_id,\n+\t\t\tsubport_node_id(n_spp, n_pps, s),\n+\t\t\troot_node_id(n_spp, n_pps),\n+\t\t\t0,\n+\t\t\t1,\n+\t\t\tRTE_TM_NODE_LEVEL_ID_ANY,\n+\t\t\t&subport_node_params,\n+\t\t\t&error);\n+\t\tif (status)\n+\t\t\treturn -1;\n+\n+\t\t/* Hierarchy level 2: Pipe nodes */\n+\t\tfor (p = 0; p < params->n_pps; p++) {\n+\t\t\tuint32_t t;\n+\n+\t\t\tstatus = rte_tm_node_add(port_id,\n+\t\t\t\tpipe_node_id(n_spp, n_pps, s, p),\n+\t\t\t\tsubport_node_id(n_spp, n_pps, s),\n+\t\t\t\t0,\n+\t\t\t\t1,\n+\t\t\t\tRTE_TM_NODE_LEVEL_ID_ANY,\n+\t\t\t\t&pipe_node_params,\n+\t\t\t\t&error);\n+\t\t\tif (status)\n+\t\t\t\treturn -1;\n+\n+\t\t\t/* Hierarchy level 3: Traffic class nodes */\n+\t\t\tfor (t = 0; t < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; t++) {\n+\t\t\t\tuint32_t q;\n+\n+\t\t\t\tstatus = rte_tm_node_add(port_id,\n+\t\t\t\t\ttc_node_id(n_spp, n_pps, s, p, t),\n+\t\t\t\t\tpipe_node_id(n_spp, n_pps, s, p),\n+\t\t\t\t\tt,\n+\t\t\t\t\t1,\n+\t\t\t\t\tRTE_TM_NODE_LEVEL_ID_ANY,\n+\t\t\t\t\t&tc_node_params[t],\n+\t\t\t\t\t&error);\n+\t\t\t\tif (status)\n+\t\t\t\t\treturn -1;\n+\n+\t\t\t\t/* Hierarchy level 4: Queue nodes */\n+\t\t\t\tfor (q = 0; q < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; q++) {\n+\t\t\t\t\tstatus = rte_tm_node_add(port_id,\n+\t\t\t\t\t\tqueue_node_id(n_spp, n_pps, s, p, t, q),\n+\t\t\t\t\t\ttc_node_id(n_spp, n_pps, s, p, t),\n+\t\t\t\t\t\t0,\n+\t\t\t\t\t\tparams->weight.queue[q],\n+\t\t\t\t\t\tRTE_TM_NODE_LEVEL_ID_ANY,\n+\t\t\t\t\t\t&queue_node_params,\n+\t\t\t\t\t\t&error);\n+\t\t\t\t\tif (status)\n+\t\t\t\t\t\treturn -1;\n+\t\t\t\t} /* Queue */\n+\t\t\t} /* TC */\n+\t\t} /* Pipe */\n+\t} /* Subport */\n+\n+\treturn 0;\n+}\n+\n+\n+/**\n+ * tmgr hierarchy-default\n+ *  spp <n_subports_per_port>\n+ *  pps <n_pipes_per_subport>\n+ *  shaper profile\n+ *   port <profile_id>\n+ *   subport <profile_id>\n+ *   pipe <profile_id>\n+ *   tc0 <profile_id>\n+ *   tc1 <profile_id>\n+ *   tc2 <profile_id>\n+ *   tc3 <profile_id>\n+ *  shared shaper\n+ *   tc0 <id | none>\n+ *   tc1 <id | none>\n+ *   tc2 <id | none>\n+ *   tc3 <id | none>\n+ *  weight\n+ *   queue  <q0> ... <q15>\n+ */\n+static void\n+cmd_tmgr_hierarchy_default(struct pmd_internals *softnic,\n+\tchar **tokens,\n+\tuint32_t n_tokens,\n+\tchar *out,\n+\tsize_t out_size)\n+{\n+\tstruct tmgr_hierarchy_default_params p;\n+\tint i, status;\n+\n+\tmemset(&p, 0, sizeof(p));\n+\n+\tif (n_tokens != 50) {\n+\t\tsnprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[1], \"hierarchy-default\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"hierarchy-default\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[2], \"spp\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"spp\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.n_spp, tokens[3]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"n_subports_per_port\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[4], \"pps\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"pps\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.n_pps, tokens[5]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"n_pipes_per_subport\");\n+\t\treturn;\n+\t}\n+\n+\t/* Shaper profile */\n+\n+\tif (strcmp(tokens[6], \"shaper\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"shaper\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[7], \"profile\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"profile\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[8], \"port\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"port\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.port, tokens[9]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"port profile id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[10], \"subport\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"subport\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.subport, tokens[11]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"subport profile id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[12], \"pipe\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"pipe\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.pipe, tokens[13]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipe_profile_id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[14], \"tc0\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc0\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.tc[0], tokens[15]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"tc0 profile id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[16], \"tc1\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc1\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.tc[1], tokens[17]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"tc1 profile id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[18], \"tc2\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc2\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.tc[2], tokens[19]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"tc2 profile id\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[20], \"tc3\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc3\");\n+\t\treturn;\n+\t}\n+\n+\tif (softnic_parser_read_uint32(&p.shaper_profile_id.tc[3], tokens[21]) != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"tc3 profile id\");\n+\t\treturn;\n+\t}\n+\n+\t/* Shared shaper */\n+\n+\tif (strcmp(tokens[22], \"shared\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"shared\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[23], \"shaper\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"shaper\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[24], \"tc0\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc0\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[25], \"none\") == 0)\n+\t\tp.shared_shaper_id.tc_valid[0] = 0;\n+\telse {\n+\t\tif (softnic_parser_read_uint32(&p.shared_shaper_id.tc[0], tokens[25]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"shared shaper tc0\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tp.shared_shaper_id.tc_valid[0] = 1;\n+\t}\n+\n+\tif (strcmp(tokens[26], \"tc1\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc1\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[27], \"none\") == 0)\n+\t\tp.shared_shaper_id.tc_valid[1] = 0;\n+\telse {\n+\t\tif (softnic_parser_read_uint32(&p.shared_shaper_id.tc[1], tokens[27]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"shared shaper tc1\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tp.shared_shaper_id.tc_valid[1] = 1;\n+\t}\n+\n+\tif (strcmp(tokens[28], \"tc2\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc2\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[29], \"none\") == 0)\n+\t\tp.shared_shaper_id.tc_valid[2] = 0;\n+\telse {\n+\t\tif (softnic_parser_read_uint32(&p.shared_shaper_id.tc[2], tokens[29]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"shared shaper tc2\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tp.shared_shaper_id.tc_valid[2] = 1;\n+\t}\n+\n+\tif (strcmp(tokens[30], \"tc3\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"tc3\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[31], \"none\") == 0)\n+\t\tp.shared_shaper_id.tc_valid[3] = 0;\n+\telse {\n+\t\tif (softnic_parser_read_uint32(&p.shared_shaper_id.tc[3], tokens[31]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"shared shaper tc3\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tp.shared_shaper_id.tc_valid[3] = 1;\n+\t}\n+\n+\t/* Weight */\n+\n+\tif (strcmp(tokens[32], \"weight\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"weight\");\n+\t\treturn;\n+\t}\n+\n+\tif (strcmp(tokens[33], \"queue\") != 0) {\n+\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"queue\");\n+\t\treturn;\n+\t}\n+\n+\tfor (i = 0; i < 16; i++) {\n+\t\tif (softnic_parser_read_uint32(&p.weight.queue[i], tokens[34 + i]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"weight queue\");\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n+\tstatus = tmgr_hierarchy_default(softnic, &p);\n+\tif (status != 0) {\n+\t\tsnprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);\n+\t\treturn;\n+\t}\n+}\n+\n /**\n  * tmgr hierarchy commit\n  */\n@@ -4366,6 +4858,12 @@ softnic_cli_process(char *in, char *out, size_t out_size, void *arg)\n \t\t\treturn;\n \t\t}\n \n+\t\tif (n_tokens >= 2 &&\n+\t\t\t(strcmp(tokens[1], \"hierarchy-default\") == 0)) {\n+\t\t\tcmd_tmgr_hierarchy_default(softnic, tokens, n_tokens, out, out_size);\n+\t\t\treturn;\n+\t\t}\n+\n \t\tif (n_tokens >= 3 &&\n \t\t\t(strcmp(tokens[1], \"hierarchy\") == 0) &&\n \t\t\t(strcmp(tokens[2], \"commit\") == 0)) {\n",
    "prefixes": [
        "6/6"
    ]
}