get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69100,
    "url": "https://patches.dpdk.org/api/patches/69100/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200422075948.10051-3-nithind1988@gmail.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": "<20200422075948.10051-3-nithind1988@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200422075948.10051-3-nithind1988@gmail.com",
    "date": "2020-04-22T07:59:46",
    "name": "[v3,3/4] app/testpmd: add tm cmd for non leaf and shaper pktmode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e8e3786010f36ef1d80db201b7e26e5cbff22371",
    "submitter": {
        "id": 1268,
        "url": "https://patches.dpdk.org/api/people/1268/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "nithind1988@gmail.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200422075948.10051-3-nithind1988@gmail.com/mbox/",
    "series": [
        {
            "id": 9564,
            "url": "https://patches.dpdk.org/api/series/9564/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9564",
            "date": "2020-04-22T07:59:44",
            "name": "[v3] ethdev: add tm support for shaper config in pkt mode",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/9564/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/69100/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/69100/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 42DD2A00C2;\n\tWed, 22 Apr 2020 10:00:44 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 92D421D407;\n\tWed, 22 Apr 2020 10:00:26 +0200 (CEST)",
            "from mail-pl1-f196.google.com (mail-pl1-f196.google.com\n [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 9C4271D155\n for <dev@dpdk.org>; Wed, 22 Apr 2020 10:00:25 +0200 (CEST)",
            "by mail-pl1-f196.google.com with SMTP id g2so636041plo.3\n for <dev@dpdk.org>; Wed, 22 Apr 2020 01:00:25 -0700 (PDT)",
            "from hyd1588t430.marvell.com ([115.113.156.2])\n by smtp.gmail.com with ESMTPSA id j6sm4521666pfe.134.2020.04.22.01.00.21\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Wed, 22 Apr 2020 01:00:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=4FQzotfUmwRXCPovV+tJ1a07Cid9UB8JggqPjuRt7I0=;\n b=tznF+++NHGdQqaK55IbNk6Sl47A30S7boGyo4EJ1D2jC6ipPXQLlkQ+EUdf5Lf2lgo\n Se/Nrnpc4PAtqYpt0sTAFxUU4c6TprxxoSDB0Xh7eeepdap2ecMVl64yikdr+Rqx7nEi\n 0QLo0A1y/vu3S6Rk3H9WLqIjA+Rvv/lfowzT3uMP7ak6qT0Ib9p38w2WdTMv+OcNSJT9\n k0VuMmtG2OgO/qhNBwOavmd/r1PGNyizVjxAVobd0fIRCK2sCApyaD1LIQ0W47KwXQyu\n jQ9iBOMBJHEVFSC3ua0Yoivg/xSHObI+R0IX7t9LdcGqWSq19A3mIjslT6145n2klexL\n NvkA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=4FQzotfUmwRXCPovV+tJ1a07Cid9UB8JggqPjuRt7I0=;\n b=gPdo1CUAhn7MVFfST43m6ynNaeUZst4/mRTxL0UgQhxuBRHJ5vvTmxgIV2EU5FJBoy\n NA9R6ipv7jxI3kmKXTIHqsZcV0XCVKa6XHUEjEDx0IvX1aaUTSh1xrvOb3AjURBGGQU5\n 08ZNONnaPPk+Dfly/+2bevhFyETGbJXhj0o5S6fehZ9NNUe/lOpGA14R27ePNy5Tlmjn\n FVlcZ+S8D1x+qs1pZcuoK+jCYhPf2zBUsjoF1BwlzflKKMdLrGPcvh9hkhIMRnQR4TKd\n Lcohbgh3TwQemK2TTufZOTcerMp7RCCfTFOiKgqKAXHGftU7TvPYJE9+yxsPrsr0mS4V\n vf/w==",
        "X-Gm-Message-State": "AGi0PuaSa7tfHiyxnMFRzbZeTqBMrM3kt96zwzUfYSBbMPtlJGJhkGPz\n hsVYSQBbUKjsuGMmplfP/QY=",
        "X-Google-Smtp-Source": "\n APiQypI1pZcBdJ1x+yvgreHgYDDCj7/vCJWqUiHxX5LP84V+PgWW0j0Wkxme/ic8xOnhAPBiiaqahg==",
        "X-Received": "by 2002:a17:902:fe03:: with SMTP id\n g3mr8411279plj.28.1587542424640;\n Wed, 22 Apr 2020 01:00:24 -0700 (PDT)",
        "From": "Nithin Dabilpuram <nithind1988@gmail.com>",
        "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>,\n John McNamara <john.mcnamara@intel.com>,\n Marko Kovacevic <marko.kovacevic@intel.com>",
        "Cc": "dev@dpdk.org, jerinj@marvell.com, kkanas@marvell.com,\n Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "Date": "Wed, 22 Apr 2020 13:29:46 +0530",
        "Message-Id": "<20200422075948.10051-3-nithind1988@gmail.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20200422075948.10051-1-nithind1988@gmail.com>",
        "References": "<20200330160019.29674-1-ndabilpuram@marvell.com>\n <20200422075948.10051-1-nithind1988@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v3 3/4] app/testpmd: add tm cmd for non leaf and\n\tshaper pktmode",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Nithin Dabilpuram <ndabilpuram@marvell.com>\n\nAdd TM command to enable packet mode for all SP children\nin non leaf node. This is a new command as\n\"add tm nonleaf node pktmode\".\n\nAlso add support to shaper profile add command to take\npacket mode parameter used to setup shaper in packet mode.\nThis adds an extra argument \"packet_mode\" to shaper profile add command\n\"add port tm node shaper profile\" as last argument.\n\nThis patch also dumps new tm port/level/node capabilities\nsched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported,\nshaper_private_packet_mode_supported, shaper_private_byte_mode_supported,\nshaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\nv2..v3:\n- Update cmdline dump of node/level cap.\n\nv1..v2:\n- Update tm capability show cmd to dump lastest pktmode/bytemode fields of v2.\n- Update existing shaper profile add command to take last argument as pkt_mode\nand update struct rte_tm_shaper_params:packet_mode with the same.\n- Update documentation with latest command changes.\n\n app/test-pmd/cmdline.c                      |   9 +-\n app/test-pmd/cmdline_tm.c                   | 220 ++++++++++++++++++++++++++++\n app/test-pmd/cmdline_tm.h                   |   1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  40 ++++-\n 4 files changed, 264 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 22fb23a..880ec61 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -1189,7 +1189,7 @@ static void cmd_help_long_parsed(void *parsed_result,\n \n \t\t\t\"add port tm node shaper profile (port_id) (shaper_profile_id)\"\n \t\t\t\" (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)\"\n-\t\t\t\" (packet_length_adjust)\\n\"\n+\t\t\t\" (packet_length_adjust) (packet_mode)\\n\"\n \t\t\t\"       Add 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@@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" [(shared_shaper_id_0) (shared_shaper_id_1)...]\\n\"\n \t\t\t\"       Add port tm nonleaf node.\\n\\n\"\n \n+\t\t\t\"add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)\"\n+\t\t\t\" (priority) (weight) (level_id) (shaper_profile_id)\"\n+\t\t\t\" (n_sp_priorities) (stats_mask) (n_shared_shapers)\"\n+\t\t\t\" [(shared_shaper_id_0) (shared_shaper_id_1)...]\\n\"\n+\t\t\t\"       Add port tm nonleaf node with pkt mode enabled.\\n\\n\"\n+\n \t\t\t\"add port tm leaf node (port_id) (node_id) (parent_node_id)\"\n \t\t\t\" (priority) (weight) (level_id) (shaper_profile_id)\"\n \t\t\t\" (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)\"\n@@ -19655,6 +19661,7 @@ cmdline_parse_ctx_t main_ctx[] = {\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 \t(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode,\n \t(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,\n \t(cmdline_parse_inst_t *)&cmd_del_port_tm_node,\n \t(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,\ndiff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c\nindex 6951beb..1f35fa7 100644\n--- a/app/test-pmd/cmdline_tm.c\n+++ b/app/test-pmd/cmdline_tm.c\n@@ -257,6 +257,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result,\n \t\tcap.shaper_private_rate_min);\n \tprintf(\"cap.shaper_private_rate_max %\" PRIu64 \"\\n\",\n \t\tcap.shaper_private_rate_max);\n+\tprintf(\"cap.shaper_private_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.shaper_private_packet_mode_supported);\n+\tprintf(\"cap.shaper_private_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.shaper_private_byte_mode_supported);\n \tprintf(\"cap.shaper_shared_n_max %\" PRIu32 \"\\n\",\n \t\tcap.shaper_shared_n_max);\n \tprintf(\"cap.shaper_shared_n_nodes_per_shaper_max %\" PRIu32 \"\\n\",\n@@ -269,6 +273,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result,\n \t\tcap.shaper_shared_rate_min);\n \tprintf(\"cap.shaper_shared_rate_max %\" PRIu64 \"\\n\",\n \t\tcap.shaper_shared_rate_max);\n+\tprintf(\"cap.shaper_shared_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.shaper_shared_packet_mode_supported);\n+\tprintf(\"cap.shaper_shared_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.shaper_shared_byte_mode_supported);\n \tprintf(\"cap.shaper_pkt_length_adjust_min %\" PRId32 \"\\n\",\n \t\tcap.shaper_pkt_length_adjust_min);\n \tprintf(\"cap.shaper_pkt_length_adjust_max %\" PRId32 \"\\n\",\n@@ -283,6 +291,10 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result,\n \t\tcap.sched_wfq_n_groups_max);\n \tprintf(\"cap.sched_wfq_weight_max %\" PRIu32 \"\\n\",\n \t\tcap.sched_wfq_weight_max);\n+\tprintf(\"cap.sched_wfq_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.sched_wfq_packet_mode_supported);\n+\tprintf(\"cap.sched_wfq_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\tcap.sched_wfq_byte_mode_supported);\n \tprintf(\"cap.cman_head_drop_supported %\" PRId32 \"\\n\",\n \t\tcap.cman_head_drop_supported);\n \tprintf(\"cap.cman_wred_context_n_max %\" PRIu32 \"\\n\",\n@@ -401,8 +413,19 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result,\n \t\t\tlcap.nonleaf.shaper_private_rate_min);\n \t\tprintf(\"cap.nonleaf.shaper_private_rate_max %\" PRIu64 \"\\n\",\n \t\t\tlcap.nonleaf.shaper_private_rate_max);\n+\t\tprintf(\"cap.nonleaf.shaper_private_packet_mode_supported %\"\n+\t\t       PRId32 \"\\n\",\n+\t\t\tlcap.nonleaf.shaper_private_packet_mode_supported);\n+\t\tprintf(\"cap.nonleaf.shaper_private_byte_mode_supported %\" PRId32\n+\t\t       \"\\n\", lcap.nonleaf.shaper_private_byte_mode_supported);\n \t\tprintf(\"cap.nonleaf.shaper_shared_n_max %\" PRIu32 \"\\n\",\n \t\t\tlcap.nonleaf.shaper_shared_n_max);\n+\t\tprintf(\"cap.nonleaf.shaper_shared_packet_mode_supported %\"\n+\t\t       PRId32 \"\\n\",\n+\t\t       lcap.nonleaf.shaper_shared_packet_mode_supported);\n+\t\tprintf(\"cap.nonleaf.shaper_shared_byte_mode_supported %\"\n+\t\t       PRId32 \"\\n\",\n+\t\t       lcap.nonleaf.shaper_shared_byte_mode_supported);\n \t\tprintf(\"cap.nonleaf.sched_n_children_max %\" PRIu32 \"\\n\",\n \t\t\tlcap.nonleaf.sched_n_children_max);\n \t\tprintf(\"cap.nonleaf.sched_sp_n_priorities_max %\" PRIu32 \"\\n\",\n@@ -413,6 +436,10 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result,\n \t\t\tlcap.nonleaf.sched_wfq_n_groups_max);\n \t\tprintf(\"cap.nonleaf.sched_wfq_weight_max %\" PRIu32 \"\\n\",\n \t\t\tlcap.nonleaf.sched_wfq_weight_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\t\tlcap.nonleaf.sched_wfq_packet_mode_supported);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_byte_mode_supported %\" PRId32\n+\t\t       \"\\n\", lcap.nonleaf.sched_wfq_byte_mode_supported);\n \t\tprintf(\"cap.nonleaf.stats_mask %\" PRIx64 \"\\n\",\n \t\t\tlcap.nonleaf.stats_mask);\n \t} else {\n@@ -424,8 +451,16 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result,\n \t\t\tlcap.leaf.shaper_private_rate_min);\n \t\tprintf(\"cap.leaf.shaper_private_rate_max %\" PRIu64 \"\\n\",\n \t\t\tlcap.leaf.shaper_private_rate_max);\n+\t\tprintf(\"cap.leaf.shaper_private_packet_mode_supported %\" PRId32\n+\t\t       \"\\n\", lcap.leaf.shaper_private_packet_mode_supported);\n+\t\tprintf(\"cap.leaf.shaper_private_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\t\tlcap.leaf.shaper_private_byte_mode_supported);\n \t\tprintf(\"cap.leaf.shaper_shared_n_max %\" PRIu32 \"\\n\",\n \t\t\tlcap.leaf.shaper_shared_n_max);\n+\t\tprintf(\"cap.leaf.shaper_shared_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\t       lcap.leaf.shaper_shared_packet_mode_supported);\n+\t\tprintf(\"cap.leaf.shaper_shared_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\t       lcap.leaf.shaper_shared_byte_mode_supported);\n \t\tprintf(\"cap.leaf.cman_head_drop_supported %\" PRId32 \"\\n\",\n \t\t\tlcap.leaf.cman_head_drop_supported);\n \t\tprintf(\"cap.leaf.cman_wred_context_private_supported %\"\tPRId32\n@@ -524,8 +559,16 @@ static void cmd_show_port_tm_node_cap_parsed(void *parsed_result,\n \t\tncap.shaper_private_rate_min);\n \tprintf(\"cap.shaper_private_rate_max %\" PRIu64 \"\\n\",\n \t\tncap.shaper_private_rate_max);\n+\tprintf(\"cap.shaper_private_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\tncap.shaper_private_packet_mode_supported);\n+\tprintf(\"cap.shaper_private_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\tncap.shaper_private_byte_mode_supported);\n \tprintf(\"cap.shaper_shared_n_max %\" PRIu32 \"\\n\",\n \t\tncap.shaper_shared_n_max);\n+\tprintf(\"cap.shaper_shared_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\tncap.shaper_shared_packet_mode_supported);\n+\tprintf(\"cap.shaper_shared_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\tncap.shaper_shared_byte_mode_supported);\n \tif (!is_leaf) {\n \t\tprintf(\"cap.nonleaf.sched_n_children_max %\" PRIu32 \"\\n\",\n \t\t\tncap.nonleaf.sched_n_children_max);\n@@ -537,6 +580,10 @@ static void cmd_show_port_tm_node_cap_parsed(void *parsed_result,\n \t\t\tncap.nonleaf.sched_wfq_n_groups_max);\n \t\tprintf(\"cap.nonleaf.sched_wfq_weight_max %\" PRIu32 \"\\n\",\n \t\t\tncap.nonleaf.sched_wfq_weight_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_packet_mode_supported %\" PRId32 \"\\n\",\n+\t\t\tncap.nonleaf.sched_wfq_packet_mode_supported);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_byte_mode_supported %\" PRId32 \"\\n\",\n+\t\t\tncap.nonleaf.sched_wfq_byte_mode_supported);\n \t} else {\n \t\tprintf(\"cap.leaf.cman_head_drop_supported %\" PRId32 \"\\n\",\n \t\t\tncap.leaf.cman_head_drop_supported);\n@@ -776,6 +823,7 @@ struct cmd_add_port_tm_node_shaper_profile_result {\n \tuint64_t peak_tb_rate;\n \tuint64_t peak_tb_size;\n \tuint32_t pktlen_adjust;\n+\tint pkt_mode;\n };\n \n cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_add =\n@@ -829,6 +877,10 @@ 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+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_packet_mode =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tpkt_mode, UINT32);\n \n static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result,\n \t__rte_unused struct cmdline *cl,\n@@ -853,6 +905,7 @@ static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result,\n \tsp.peak.rate = res->peak_tb_rate;\n \tsp.peak.size = res->peak_tb_size;\n \tsp.pkt_length_adjust = pkt_len_adjust;\n+\tsp.packet_mode = res->pkt_mode;\n \n \tret = rte_tm_shaper_profile_add(port_id, shaper_id, &sp, &error);\n \tif (ret != 0) {\n@@ -879,6 +932,7 @@ cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile = {\n \t\t(void *)&cmd_add_port_tm_node_shaper_profile_peak_tb_rate,\n \t\t(void *)&cmd_add_port_tm_node_shaper_profile_peak_tb_size,\n \t\t(void *)&cmd_add_port_tm_node_shaper_profile_pktlen_adjust,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_packet_mode,\n \t\tNULL,\n \t},\n };\n@@ -1671,6 +1725,172 @@ cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node = {\n \t},\n };\n \n+/* *** Add Port TM nonleaf node pkt mode *** */\n+struct cmd_add_port_tm_nonleaf_node_pmode_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t nonleaf;\n+\tcmdline_fixed_string_t node;\n+\tuint16_t port_id;\n+\tuint32_t node_id;\n+\tint32_t parent_node_id;\n+\tuint32_t priority;\n+\tuint32_t weight;\n+\tuint32_t level_id;\n+\tint32_t shaper_profile_id;\n+\tuint32_t n_sp_priorities;\n+\tuint64_t stats_mask;\n+\tcmdline_multi_string_t multi_shared_shaper_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_nonleaf =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, nonleaf, \"nonleaf\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_pktmode =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result, node, \"pktmode\");\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t port_id, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t node_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_parent_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t parent_node_id, INT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_priority =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t priority, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_weight =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t weight, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_level_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t level_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_shaper_profile_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t shaper_profile_id, INT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_n_sp_priorities =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t n_sp_priorities, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_stats_mask =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t stats_mask, UINT64);\n+cmdline_parse_token_string_t\n+\tcmd_add_port_tm_nonleaf_node_pmode_multi_shrd_shpr_id =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\t\tstruct cmd_add_port_tm_nonleaf_node_pmode_result,\n+\t\t\tmulti_shared_shaper_id, TOKEN_STRING_MULTI);\n+\n+static void cmd_add_port_tm_nonleaf_node_pmode_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_nonleaf_node_pmode_result *res = parsed_result;\n+\tuint32_t parent_node_id, n_shared_shapers = 0;\n+\tchar *s_str = res->multi_shared_shaper_id;\n+\tportid_t port_id = res->port_id;\n+\tstruct rte_tm_node_params np;\n+\tint *wfq_weight_mode = NULL;\n+\tuint32_t *shared_shaper_id;\n+\tstruct rte_tm_error error;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tmemset(&np, 0, sizeof(struct rte_tm_node_params));\n+\tmemset(&error, 0, sizeof(struct rte_tm_error));\n+\n+\t/* Node parameters */\n+\tif (res->parent_node_id < 0)\n+\t\tparent_node_id = UINT32_MAX;\n+\telse\n+\t\tparent_node_id = res->parent_node_id;\n+\n+\tshared_shaper_id = (uint32_t *)malloc(MAX_NUM_SHARED_SHAPERS *\n+\t\tsizeof(uint32_t));\n+\tif (shared_shaper_id == NULL) {\n+\t\tprintf(\" Memory not allocated for shared shapers (error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Parse multi shared shaper id string */\n+\tret = parse_multi_ss_id_str(s_str, &n_shared_shapers, shared_shaper_id);\n+\tif (ret) {\n+\t\tprintf(\" Shared shapers params string parse error\\n\");\n+\t\tfree(shared_shaper_id);\n+\t\treturn;\n+\t}\n+\n+\tif (res->shaper_profile_id < 0)\n+\t\tnp.shaper_profile_id = UINT32_MAX;\n+\telse\n+\t\tnp.shaper_profile_id = res->shaper_profile_id;\n+\n+\tnp.n_shared_shapers = n_shared_shapers;\n+\tif (np.n_shared_shapers) {\n+\t\tnp.shared_shaper_id = &shared_shaper_id[0];\n+\t} else {\n+\t\tfree(shared_shaper_id);\n+\t\tshared_shaper_id = NULL;\n+\t}\n+\n+\tif (res->n_sp_priorities)\n+\t\twfq_weight_mode = calloc(res->n_sp_priorities, sizeof(int));\n+\tnp.nonleaf.n_sp_priorities = res->n_sp_priorities;\n+\tnp.stats_mask = res->stats_mask;\n+\tnp.nonleaf.wfq_weight_mode = wfq_weight_mode;\n+\n+\tret = rte_tm_node_add(port_id, res->node_id, parent_node_id,\n+\t\t\t\tres->priority, res->weight, res->level_id,\n+\t\t\t\t&np, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\tfree(shared_shaper_id);\n+\t\tfree(wfq_weight_mode);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode = {\n+\t.f = cmd_add_port_tm_nonleaf_node_pmode_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm nonleaf node pktmode\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_add,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_port,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_tm,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_nonleaf,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_node,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_pktmode,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_port_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_node_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_parent_node_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_priority,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_weight,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_level_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_shaper_profile_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_n_sp_priorities,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_stats_mask,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_pmode_multi_shrd_shpr_id,\n+\t\tNULL,\n+\t},\n+};\n /* *** Add Port TM leaf node *** */\n struct cmd_add_port_tm_leaf_node_result {\n \tcmdline_fixed_string_t add;\ndiff --git a/app/test-pmd/cmdline_tm.h b/app/test-pmd/cmdline_tm.h\nindex 950cb75..e59c15c 100644\n--- a/app/test-pmd/cmdline_tm.h\n+++ b/app/test-pmd/cmdline_tm.h\n@@ -19,6 +19,7 @@ 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 extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;\n+extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode;\n extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;\n extern cmdline_parse_inst_t cmd_del_port_tm_node;\n extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex a360ecc..7513a97 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -2842,19 +2842,22 @@ Add the port traffic management private shaper profile::\n \n    testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \\\n    (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \\\n-   (packet_length_adjust)\n+   (packet_length_adjust) (packet_mode)\n \n where:\n \n * ``shaper_profile id``: Shaper profile ID for the new profile.\n-* ``cmit_tb_rate``: Committed token bucket rate (bytes per second).\n-* ``cmit_tb_size``: Committed token bucket size (bytes).\n-* ``peak_tb_rate``: Peak token bucket rate (bytes per second).\n-* ``peak_tb_size``: Peak token bucket size (bytes).\n+* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second).\n+* ``cmit_tb_size``: Committed token bucket size (bytes or packets).\n+* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second).\n+* ``peak_tb_size``: Peak token bucket size (bytes or packets).\n * ``packet_length_adjust``: The value (bytes) to be added to the length of\n   each packet for the purpose of shaping. This parameter value can be used to\n   correct the packet length with the framing overhead bytes that are consumed\n   on the wire.\n+* ``packet_mode``: Shaper configured in packet mode. This parameter value if\n+  zero, configures shaper in byte mode and if non-zero configures it in packet\n+  mode.\n \n Delete port traffic management private shaper profile\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n@@ -2979,6 +2982,33 @@ where:\n * ``n_shared_shapers``: Number of shared shapers.\n * ``shared_shaper_id``: Shared shaper id.\n \n+Add port traffic management hierarchy nonleaf node with packet mode\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Add nonleaf node with packet mode to port traffic management hierarchy::\n+\n+   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \\\n+   (priority) (weight) (level_id) (shaper_profile_id) \\\n+   (n_sp_priorities) (stats_mask) (n_shared_shapers) \\\n+   [(shared_shaper_0) (shared_shaper_1) ...] \\\n+\n+where:\n+\n+* ``parent_node_id``: Node ID of the parent.\n+* ``priority``: Node priority (highest node priority is zero). This is used by\n+  the SP algorithm running on the parent node for scheduling this node.\n+* ``weight``: Node weight (lowest weight is one). The node weight is relative\n+  to the weight sum of all siblings that have the same priority. It is used by\n+  the WFQ algorithm running on the parent node for scheduling this node.\n+* ``level_id``: Hierarchy level of the node.\n+* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by\n+  the node.\n+* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on\n+  all of them.\n+* ``stats_mask``: Mask of statistics counter types to be enabled for this node.\n+* ``n_shared_shapers``: Number of shared shapers.\n+* ``shared_shaper_id``: Shared shaper id.\n+\n Add port traffic management hierarchy leaf node\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "v3",
        "3/4"
    ]
}