get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29429,
    "url": "https://patches.dpdk.org/api/patches/29429/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170929123829.81964-2-jasvinder.singh@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20170929123829.81964-2-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170929123829.81964-2-jasvinder.singh@intel.com",
    "date": "2017-09-29T12:38:28",
    "name": "[dpdk-dev,v5,2/3] app/test-pmd: add CLI for shaper and wred profiles",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "790f23863a61a17d0bb956c82c2bcf83423b4b44",
    "submitter": {
        "id": 285,
        "url": "https://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170929123829.81964-2-jasvinder.singh@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29429/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/29429/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 9B64F7D04;\n\tFri, 29 Sep 2017 14:26:37 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 879D1FFA\n\tfor <dev@dpdk.org>; Fri, 29 Sep 2017 14:26:32 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Sep 2017 05:26:31 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby fmsmga001.fm.intel.com with ESMTP; 29 Sep 2017 05:26:30 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,452,1500966000\"; d=\"scan'208\";\n\ta=\"1200407760\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com, jingjing.wu@intel.com,\n\tpablo.de.lara.guarch@intel.com",
        "Date": "Fri, 29 Sep 2017 13:38:28 +0100",
        "Message-Id": "<20170929123829.81964-2-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170929123829.81964-1-jasvinder.singh@intel.com>",
        "References": "<20170922163506.12437-2-jasvinder.singh@intel.com>\n\t<20170929123829.81964-1-jasvinder.singh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 2/3] app/test-pmd: add CLI for shaper and wred\n\tprofiles",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add following CLIs in testpmd application for device traffic management;\n- commands to add/del shaper profile for TM hieraqrchy nodes.\n- commands to add/update shared shapers\n- commands to add/del WRED profiles for TM hiearchy leaf nodes.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nAcked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\nv5 change:\n - add packet length adjust parameter to add shaper profile command\n\nv4 change:\n - remove softnic specific checks to make it generic for the devices\n\n app/test-pmd/cmdline.c    |  34 +++\n app/test-pmd/cmdline_tm.c | 748 ++++++++++++++++++++++++++++++++++++++++++++++\n app/test-pmd/cmdline_tm.h |   7 +\n 3 files changed, 789 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 6874d8a..fe0aefe 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -658,6 +658,33 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\\n\"\n \t\t\t\"    Update a ptype mapping item on a port\\n\\n\"\n \n+\t\t\t\"add port tm node shaper profile (port_id) (shaper_profile_id)\"\n+\t\t\t\" (tb_rate) (tb_size) (packet_length_adjust)\\n\"\n+\t\t\t\"\tAdd port tm node private shaper profile.\\n\\n\"\n+\n+\t\t\t\"del port tm node shaper profile (port_id) (shaper_profile_id)\\n\"\n+\t\t\t\"\tDelete port tm node private shaper profile.\\n\\n\"\n+\n+\t\t\t\"add port tm node shared shaper (port_id) (shared_shaper_id)\"\n+\t\t\t\" (shaper_profile_id)\\n\"\n+\t\t\t\"\tAdd/update port tm node shared shaper.\\n\\n\"\n+\n+\t\t\t\"del port tm node shared shaper (port_id) (shared_shaper_id)\\n\"\n+\t\t\t\"\tDelete port tm node shared shaper.\\n\\n\"\n+\n+\t\t\t\"set port tm node shaper profile (port_id) (node_id)\"\n+\t\t\t\" (shaper_profile_id)\\n\"\n+\t\t\t\"\tSet port tm node shaper profile.\\n\\n\"\n+\n+\t\t\t\"add port tm node wred profile (port_id) (wred_profile_id)\"\n+\t\t\t\" (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g)\"\n+\t\t\t\" (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y)\"\n+\t\t\t\" (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r)\\n\"\n+\t\t\t\"\tAdd port tm node wred profile.\\n\\n\"\n+\n+\t\t\t\"del port tm node wred profile (port_id) (wred_profile_id)\\n\"\n+\t\t\t\"\tDelete port tm node wred profile.\\n\\n\"\n+\n \t\t\t, list_pkt_forwarding_modes()\n \t\t);\n \t}\n@@ -14489,6 +14516,13 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_cap,\n \t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_type,\n \t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_stats,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_shaper_profile,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_shaper_profile,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_shared_shaper,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_shared_shaper,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_wred_profile,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,\n+\t(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,\n \tNULL,\n };\n \ndiff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c\nindex 97582fe..9ca22f0 100644\n--- a/app/test-pmd/cmdline_tm.c\n+++ b/app/test-pmd/cmdline_tm.c\n@@ -667,3 +667,751 @@ cmdline_parse_inst_t cmd_show_port_tm_node_type = {\n \t\tNULL,\n \t},\n };\n+\n+/* *** Add Port TM Private Shaper Profile *** */\n+struct cmd_add_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t shaper_id;\n+\tuint64_t tb_rate;\n+\tuint64_t tb_size;\n+\tuint32_t pktlen_adjust;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_rate =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttb_rate, UINT64);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_size =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttb_size, UINT64);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_pktlen_adjust =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tpktlen_adjust, UINT32);\n+\n+static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_tm_shaper_params sp;\n+\tstruct rte_tm_error error;\n+\tuint32_t shaper_id = res->shaper_id;\n+\tuint32_t pkt_len_adjust = res->pktlen_adjust;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\t/* Private shaper profile params */\n+\tmemset(&sp, 0, sizeof(struct rte_tm_shaper_params));\n+\tsp.peak.rate = res->tb_rate;\n+\tsp.peak.size = res->tb_size;\n+\tsp.pkt_length_adjust = pkt_len_adjust;\n+\n+\tret = rte_tm_shaper_profile_add(port_id, shaper_id, &sp, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile = {\n+\t.f = cmd_add_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm node private shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_add,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_shaper_id,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tb_rate,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tb_size,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_pktlen_adjust,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM Private Shaper Profile *** */\n+struct cmd_del_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t shaper_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_id, UINT32);\n+\n+static void cmd_del_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_tm_error error;\n+\tuint32_t shaper_id = res->shaper_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_tm_shaper_profile_delete(port_id, shaper_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_shaper_profile = {\n+\t.f = cmd_del_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Delete port tm node private shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_del,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_shaper_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add/Update Port TM shared Shaper *** */\n+struct cmd_add_port_tm_node_shared_shaper_result {\n+\tcmdline_fixed_string_t cmd_type;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shared;\n+\tcmdline_fixed_string_t shaper;\n+\tuint8_t port_id;\n+\tuint32_t shared_shaper_id;\n+\tuint32_t shaper_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_cmd_type =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tcmd_type, \"add#set\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_shared =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshared, \"shared\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shared_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshared_shaper_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shaper_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshaper_profile_id, UINT32);\n+\n+static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_shared_shaper_result *res = parsed_result;\n+\tstruct rte_tm_error error;\n+\tuint32_t shared_shaper_id = res->shared_shaper_id;\n+\tuint32_t shaper_profile_id = res->shaper_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\t/* Command type: add */\n+\tif ((strcmp(res->cmd_type, \"add\") == 0) &&\n+\t\t(port_is_started(port_id))) {\n+\t\tprintf(\" Port %u not stopped (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Command type: set (update) */\n+\tif ((strcmp(res->cmd_type, \"set\") == 0) &&\n+\t\t(!port_is_started(port_id))) {\n+\t\tprintf(\" Port %u not started (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_shared_shaper_add_update(port_id, shared_shaper_id,\n+\t\tshaper_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_shared_shaper = {\n+\t.f = cmd_add_port_tm_node_shared_shaper_parsed,\n+\t.data = NULL,\n+\t.help_str = \"add/update port tm node shared shaper\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_cmd_type,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_port,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_tm,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_node,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shared,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shaper,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shared_shaper_id,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shaper_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM shared Shaper *** */\n+struct cmd_del_port_tm_node_shared_shaper_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shared;\n+\tcmdline_fixed_string_t shaper;\n+\tuint8_t port_id;\n+\tuint32_t shared_shaper_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_shared =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshared, \"shared\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_shared_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshared_shaper_id, UINT32);\n+\n+static void cmd_del_port_tm_node_shared_shaper_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_shared_shaper_result *res = parsed_result;\n+\tstruct rte_tm_error error;\n+\tuint32_t shared_shaper_id = res->shared_shaper_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_tm_shared_shaper_delete(port_id, shared_shaper_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_shared_shaper = {\n+\t.f = cmd_del_port_tm_node_shared_shaper_parsed,\n+\t.data = NULL,\n+\t.help_str = \"delete port tm node shared shaper\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_del,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_port,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_tm,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_node,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shared,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shaper,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shared_shaper_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add Port TM Node WRED Profile *** */\n+struct cmd_add_port_tm_node_wred_profile_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t wred;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t wred_profile_id;\n+\tcmdline_fixed_string_t color_g;\n+\tuint16_t min_th_g;\n+\tuint16_t max_th_g;\n+\tuint16_t maxp_inv_g;\n+\tuint16_t wq_log2_g;\n+\tcmdline_fixed_string_t color_y;\n+\tuint16_t min_th_y;\n+\tuint16_t max_th_y;\n+\tuint16_t maxp_inv_y;\n+\tuint16_t wq_log2_y;\n+\tcmdline_fixed_string_t color_r;\n+\tuint16_t min_th_r;\n+\tuint16_t max_th_r;\n+\tuint16_t maxp_inv_r;\n+\tuint16_t wq_log2_r;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_wred =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, wred, \"wred\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wred_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twred_profile_id, UINT32);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_g =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_g, \"G#g\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_g, UINT16);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_y =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_y, \"Y#y\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_y, UINT16);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_r =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_r, \"R#r\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_r, UINT16);\n+\n+\n+static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_wred_profile_result *res = parsed_result;\n+\tstruct rte_tm_wred_params wp;\n+\tenum rte_tm_color color;\n+\tstruct rte_tm_error error;\n+\tuint32_t wred_profile_id = res->wred_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tmemset(&wp, 0, sizeof(struct rte_tm_wred_params));\n+\n+\t/* WRED Params  (Green Color)*/\n+\tif ((strcmp(res->color_g, \"G\") == 0) ||\n+\t\t(strcmp(res->color_g, \"g\") == 0)) {\n+\t\tcolor = RTE_TM_GREEN;\n+\t\twp.red_params[color].min_th = res->min_th_g;\n+\t\twp.red_params[color].max_th = res->max_th_g;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_g;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_g;\n+\t} else {\n+\t\tprintf(\"WRED profile error(G or g for green color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* WRED Params  (Yellow Color)*/\n+\tif ((strcmp(res->color_y, \"Y\") == 0) ||\n+\t\t(strcmp(res->color_y, \"y\") == 0)) {\n+\t\tcolor = RTE_TM_YELLOW;\n+\t\twp.red_params[color].min_th = res->min_th_y;\n+\t\twp.red_params[color].max_th = res->max_th_y;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_y;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_y;\n+\t} else {\n+\t\tprintf(\"WRED profile error(Y or y for yellow color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* WRED Params  (Red Color)*/\n+\tif ((strcmp(res->color_r, \"R\") == 0) ||\n+\t\t(strcmp(res->color_r, \"r\") == 0)) {\n+\t\tcolor = RTE_TM_RED;\n+\t\twp.red_params[color].min_th = res->min_th_r;\n+\t\twp.red_params[color].max_th = res->max_th_r;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_r;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_r;\n+\t} else {\n+\t\tprintf(\"WRED profile error(R or r for red color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_wred_profile_add(port_id, wred_profile_id, &wp, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile = {\n+\t.f = cmd_add_port_tm_node_wred_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm node wred profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_add,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_port,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_tm,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_node,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wred,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_profile,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wred_profile_id,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_r,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM node WRED Profile *** */\n+struct cmd_del_port_tm_node_wred_profile_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t wred;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t wred_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_wred =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, wred, \"wred\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_wred_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\twred_profile_id, UINT32);\n+\n+static void cmd_del_port_tm_node_wred_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_wred_profile_result *res = parsed_result;\n+\tstruct rte_tm_error error;\n+\tuint32_t wred_profile_id = res->wred_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_tm_wred_profile_delete(port_id, wred_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile = {\n+\t.f = cmd_del_port_tm_node_wred_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Delete port tm node wred profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_del,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_port,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_tm,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_node,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_wred,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_profile,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_wred_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Update Port TM Node Shaper profile *** */\n+struct cmd_set_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tuint32_t shaper_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result, set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_shaper_profile_result,\n+\t\tnode_id, UINT32);\n+cmdline_parse_token_num_t\n+\tcmd_set_port_tm_node_shaper_shaper_profile_profile_id =\n+\t\tTOKEN_NUM_INITIALIZER(\n+\t\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_profile_id, UINT32);\n+\n+static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint32_t shaper_profile_id = res->shaper_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\t/* Port status */\n+\tif (!port_is_started(port_id)) {\n+\t\tprintf(\" Port %u not started (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_node_shaper_update(port_id, node_id,\n+\t\tshaper_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile = {\n+\t.f = cmd_set_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm node shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_set,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_node_id,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_shaper_profile_profile_id,\n+\t\tNULL,\n+\t},\n+};\ndiff --git a/app/test-pmd/cmdline_tm.h b/app/test-pmd/cmdline_tm.h\nindex 945af89..5ed9de0 100644\n--- a/app/test-pmd/cmdline_tm.h\n+++ b/app/test-pmd/cmdline_tm.h\n@@ -40,5 +40,12 @@ extern cmdline_parse_inst_t cmd_show_port_tm_level_cap;\n extern cmdline_parse_inst_t cmd_show_port_tm_node_cap;\n extern cmdline_parse_inst_t cmd_show_port_tm_node_type;\n extern cmdline_parse_inst_t cmd_show_port_tm_node_stats;\n+extern cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile;\n+extern cmdline_parse_inst_t cmd_del_port_tm_node_shaper_profile;\n+extern cmdline_parse_inst_t cmd_add_port_tm_node_shared_shaper;\n+extern cmdline_parse_inst_t cmd_del_port_tm_node_shared_shaper;\n+extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;\n+extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;\n+extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;\n \n #endif /* _CMDLINE_TM_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "2/3"
    ]
}