get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116427,
    "url": "http://patches.dpdk.org/api/patches/116427/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220919122850.1059173-1-skori@marvell.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": "<20220919122850.1059173-1-skori@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220919122850.1059173-1-skori@marvell.com",
    "date": "2022-09-19T12:28:48",
    "name": "[1/3] app/testpmd: support congestion management CLIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "689aab54015f6fd7c558233db6cf2e1faa0651e8",
    "submitter": {
        "id": 1318,
        "url": "http://patches.dpdk.org/api/people/1318/?format=api",
        "name": "Sunil Kumar Kori",
        "email": "skori@marvell.com"
    },
    "delegate": {
        "id": 3961,
        "url": "http://patches.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220919122850.1059173-1-skori@marvell.com/mbox/",
    "series": [
        {
            "id": 24711,
            "url": "http://patches.dpdk.org/api/series/24711/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24711",
            "date": "2022-09-19T12:28:48",
            "name": "[1/3] app/testpmd: support congestion management CLIs",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/24711/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/116427/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/116427/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1A810A00C3;\n\tMon, 19 Sep 2022 14:29:01 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B649040E0F;\n\tMon, 19 Sep 2022 14:29:00 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id CB45240141\n for <dev@dpdk.org>; Mon, 19 Sep 2022 14:28:58 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 28J5EY7t010897;\n Mon, 19 Sep 2022 05:28:58 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jndrmp67u-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 19 Sep 2022 05:28:57 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Mon, 19 Sep 2022 05:28:55 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Mon, 19 Sep 2022 05:28:55 -0700",
            "from localhost.localdomain (unknown [10.28.34.25])\n by maili.marvell.com (Postfix) with ESMTP id 1829B3F703F;\n Mon, 19 Sep 2022 05:28:53 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding :\n content-type; s=pfpt0220; bh=YPZEHpnZxZa3CFzKRQHvwQmrIvkae5xQR6fNDnXaq3U=;\n b=SB3Mc2yXjI5mCOFcrFTndO6tuma2wWL7nnVz3uI4g3sZx9vs9L6mCsl2e+Qdzdm6wjVd\n k94MECEuLGWS9ZfXCIZmpaV3eq3I1mPMuiRS7jXqcRB1au4FP5WgJGMhbe3X4CMDcwE0\n EGRP1nMc3aeEihokV5PyzX0m3h9pSg+0i09ujYfqdP3TKm2KK65yeI5nx0xeOba5aISe\n dJsYY3hsvFRMfN8sRU9BPp+otk/sI50A4V9t2U1iuPmg+AzG8nrqznicQ4faQnsUTW4D\n uYtY5jVOt6SFRe4anK3qTvmROLT/Ciqz7INqYJg+RC5OTV9GFmPg2L/LYvHyshVKllqQ qQ==",
        "From": "<skori@marvell.com>",
        "To": "Aman Singh <aman.deep.singh@intel.com>, Yuying Zhang\n <yuying.zhang@intel.com>",
        "CC": "<dev@dpdk.org>, Sunil Kumar Kori <skori@marvell.com>",
        "Subject": "[PATCH 1/3] app/testpmd: support congestion management CLIs",
        "Date": "Mon, 19 Sep 2022 17:58:48 +0530",
        "Message-ID": "<20220919122850.1059173-1-skori@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "-KxW_NzAAbd_57Bo1Gi7fxiZV-41Lbyh",
        "X-Proofpoint-ORIG-GUID": "-KxW_NzAAbd_57Bo1Gi7fxiZV-41Lbyh",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1\n definitions=2022-09-19_05,2022-09-16_01,2022-06-22_01",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "From: Sunil Kumar Kori <skori@marvell.com>\n\nSupport congestion management CLIs.\n\nDepends-on: patch-24710 (\"ethdev: support congestion management\")\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\nChange-Id: Icbaeea982ed28639fe96b1afd3a4f686ae3ee7a5\n---\n app/test-pmd/cmdline.c                      |  15 +\n app/test-pmd/cmdline_cman.c                 | 390 ++++++++++++++++++++\n app/test-pmd/cmdline_cman.h                 |  12 +\n app/test-pmd/meson.build                    |   1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  26 ++\n 5 files changed, 444 insertions(+)\n create mode 100644 app/test-pmd/cmdline_cman.c\n create mode 100644 app/test-pmd/cmdline_cman.h",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 51321de9ed..ce278eadb0 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -60,6 +60,7 @@\n #include <rte_pmd_bnxt.h>\n #endif\n #include \"testpmd.h\"\n+#include \"cmdline_cman.h\"\n #include \"cmdline_mtr.h\"\n #include \"cmdline_tm.h\"\n #include \"bpf_cmd.h\"\n@@ -599,6 +600,17 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"set port (port_id) fec_mode auto|off|rs|baser\\n\"\n \t\t\t\"    set fec mode for a specific port\\n\\n\"\n \n+\t\t\t\"show port cman capa (port_id)\\n\"\n+\t\t\t\"    Show congestion management capabilities\\n\\n\"\n+\n+\t\t\t\"show port cman config (port_id)\\n\"\n+\t\t\t\"    Show congestion management configuration\\n\\n\"\n+\n+\t\t\t\"set port cman config (port_id) (queue_id) default | \"\n+\t\t\t\"[obj (queue|queue_mempool) mode red (min_thresh) \"\n+\t\t\t\"(max_thresh) (prob_inv)]\\n\"\n+\t\t\t\"    Set congestion management configuration\\n\\n\"\n+\n \t\t\t, list_pkt_forwarding_modes()\n \t\t);\n \t}\n@@ -12990,6 +13002,9 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_show_capability,\n \t(cmdline_parse_inst_t *)&cmd_set_flex_is_pattern,\n \t(cmdline_parse_inst_t *)&cmd_set_flex_spec_pattern,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_cman_capa,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_cman_config,\n+\t(cmdline_parse_inst_t *)&cmd_set_port_cman_config,\n \tNULL,\n };\n \ndiff --git a/app/test-pmd/cmdline_cman.c b/app/test-pmd/cmdline_cman.c\nnew file mode 100644\nindex 0000000000..344759189d\n--- /dev/null\n+++ b/app/test-pmd/cmdline_cman.c\n@@ -0,0 +1,390 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2022 Marvell International Ltd.\n+ */\n+\n+#include <cmdline_parse.h>\n+#include <cmdline_parse_num.h>\n+#include <cmdline_parse_string.h>\n+\n+#include <rte_ethdev.h>\n+\n+#include \"testpmd.h\"\n+\n+#define PARSE_DELIMITER\t\t\t\t\" \\f\\n\\r\\t\\v\"\n+\n+static int\n+parse_uint(uint64_t *value, const char *str)\n+{\n+\tchar *next = NULL;\n+\tuint64_t n;\n+\n+\terrno = 0;\n+\t/* Parse number string */\n+\tn = strtol(str, &next, 10);\n+\tif (errno != 0 || str == next || *next != '\\0')\n+\t\treturn -1;\n+\n+\t*value = n;\n+\n+\treturn 0;\n+}\n+\n+static int\n+parse_cman_obj_str(char *str, uint64_t *obj)\n+{\n+\tchar *token;\n+\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL)\n+\t\treturn 0;\n+\n+\tif (strcasecmp(token, \"queue\") == 0)\n+\t\t*obj = RTE_ETH_CMAN_OBJ_RX_QUEUE;\n+\telse if (strcasecmp(token, \"queue_mempool\") == 0)\n+\t\t*obj = RTE_ETH_CMAN_OBJ_RX_QUEUE_MEMPOOL;\n+\telse\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static int\n+parse_cman_mode_str(char *str, uint64_t *mode)\n+{\n+\tchar *token;\n+\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL)\n+\t\treturn 0;\n+\n+\tif (strcasecmp(token, \"red\") == 0)\n+\t\t*mode = RTE_CMAN_RED;\n+\telse\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static int\n+parse_cman_params_str(uint16_t port_id, char *str,\n+\t\t      struct rte_eth_cman_config *cfg)\n+{\n+\tuint64_t obj = 0, mode = 0, min_th = 0, max_th = 0, maxp_inv = 0;\n+\tstruct rte_eth_cman_info info;\n+\tchar *token;\n+\tint ret;\n+\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (!strcasecmp(token, \"default\")) {\n+\t\tret = rte_eth_cman_config_init(port_id, cfg);\n+\t\tif (ret) {\n+\t\t\tfprintf(stderr, \"error in default initialization\\n\");\n+\t\t\treturn ret;\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\n+\t/* First token: obj name */\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \"Object param parse error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tret = parse_cman_obj_str(token, &obj);\n+\tif (ret) {\n+\t\tfprintf(stderr, \"Object value is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\t/* Second token: mode name */\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \" Mode param is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \" Mode value is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tret = parse_cman_mode_str(token, &mode);\n+\tif (ret) {\n+\t\tfprintf(stderr, \"mode string parse error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\t/* Third token: minimum threshold */\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \"Minimum threshold parse error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tret = parse_uint(&min_th, token);\n+\tif (ret != 0 || min_th > UINT8_MAX) {\n+\t\tfprintf(stderr, \"Minimum threshold is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\t/* Fourth token: maximum threshold */\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \"Maximum threshold parse error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tret = parse_uint(&max_th, token);\n+\tif (ret != 0 || max_th > UINT8_MAX) {\n+\t\tfprintf(stderr, \"Maximum threshold is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\t/* Fifth token: probability inversion */\n+\ttoken = strtok_r(str, PARSE_DELIMITER, &str);\n+\tif (token == NULL) {\n+\t\tfprintf(stderr, \"Maximum probability inversion parse error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tret = parse_uint(&maxp_inv, token);\n+\tif (ret != 0 || maxp_inv == 0 || maxp_inv > UINT16_MAX) {\n+\t\tfprintf(stderr, \"Maximum probability inversion is invalid\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tmemset(&info, 0, sizeof(struct rte_eth_cman_info));\n+\tret = rte_eth_cman_info_get(port_id, &info);\n+\tif (ret) {\n+\t\tfprintf(stderr, \"Congestion management capa get error\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tif (!(info.objs_supported & obj)) {\n+\t\tfprintf(stderr, \"Object type is not supported by driver\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tif (!(info.modes_supported & mode)) {\n+\t\tfprintf(stderr, \"Mode is not supported by driver\\n\");\n+\t\tgoto error;\n+\t}\n+\n+\tcfg->obj = obj;\n+\tcfg->mode = mode;\n+\tcfg->mode_param.red.min_th = min_th;\n+\tcfg->mode_param.red.max_th = max_th;\n+\tcfg->mode_param.red.maxp_inv = maxp_inv;\n+\n+\treturn 0;\n+\n+error:\n+\treturn -EINVAL;\n+}\n+\n+/* *** Show Port Congestion Management Capabilities *** */\n+struct cmd_show_port_cman_capa_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t cman;\n+\tcmdline_fixed_string_t capa;\n+\tuint16_t port_id;\n+};\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_capa_show =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_capa_result, show, \"show\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_capa_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_capa_result, port, \"port\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_capa_cman =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_capa_result, cman, \"cman\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_capa_capa =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_capa_result, capa, \"capa\");\n+\n+static cmdline_parse_token_num_t cmd_show_port_cman_capa_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_capa_result, port_id, RTE_UINT16);\n+\n+static void cmd_show_port_cman_capa_parsed(void *parsed_result,\n+\t__rte_unused struct cmdline *cl,\n+\t__rte_unused void *data)\n+{\n+\tstruct cmd_show_port_cman_capa_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tstruct rte_eth_cman_info info;\n+\tint ret;\n+\n+\tmemset(&info, 0, sizeof(struct rte_eth_cman_info));\n+\tret = rte_eth_cman_info_get(port_id, &info);\n+\tif (ret)\n+\t\treturn;\n+\n+\tprintf(\"\\n****   Port Congestion Management Capabilities   ****\\n\\n\");\n+\tprintf(\"modes_supported 0x%\" PRIx64 \"\\n\", info.modes_supported);\n+\tprintf(\"objs_supported 0x%\" PRIx64 \"\\n\", info.objs_supported);\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_cman_capa = {\n+\t.f = cmd_show_port_cman_capa_parsed,\n+\t.data = NULL,\n+\t.help_str = \"show port cman capa <port_id>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_cman_capa_show,\n+\t\t(void *)&cmd_show_port_cman_capa_port,\n+\t\t(void *)&cmd_show_port_cman_capa_cman,\n+\t\t(void *)&cmd_show_port_cman_capa_capa,\n+\t\t(void *)&cmd_show_port_cman_capa_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Show Port Congestion Management configuration *** */\n+struct cmd_show_port_cman_cfg_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t cman;\n+\tcmdline_fixed_string_t cfg;\n+\tuint16_t port_id;\n+};\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_cfg_show =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_cfg_result, show, \"show\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_cfg_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_cfg_result, port, \"port\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_cfg_cman =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_cfg_result, cman, \"cman\");\n+\n+static cmdline_parse_token_string_t cmd_show_port_cman_cfg_cfg =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_cfg_result, cfg, \"config\");\n+\n+static cmdline_parse_token_num_t cmd_show_port_cman_cfg_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_cman_cfg_result, port_id, RTE_UINT16);\n+\n+static void cmd_show_port_cman_cfg_parsed(void *parsed_result,\n+\t__rte_unused struct cmdline *cl,\n+\t__rte_unused void *data)\n+{\n+\tstruct cmd_show_port_cman_cfg_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tstruct rte_eth_cman_config cfg;\n+\tint ret;\n+\n+\tmemset(&cfg, 0, sizeof(struct rte_eth_cman_config));\n+\tret = rte_eth_cman_config_get(port_id, &cfg);\n+\tif (ret)\n+\t\treturn;\n+\n+\tprintf(\"\\n****   Port Congestion Management Configuration   ****\\n\\n\");\n+\tprintf(\"cman object 0x%\" PRIx32 \"\\n\", cfg.obj);\n+\tprintf(\"cman Rx queue %\" PRIx16 \"\\n\", cfg.obj_param.rx_queue);\n+\tprintf(\"cman mode 0x%\" PRIx32 \"\\n\", cfg.mode);\n+\tprintf(\"cman RED min thresh %\" PRIx8 \"\\n\", cfg.mode_param.red.min_th);\n+\tprintf(\"cman RED max thresh %\" PRIx8 \"\\n\", cfg.mode_param.red.max_th);\n+\tprintf(\"cman RED Prob inversion %\" PRIx16 \"\\n\",\n+\t\tcfg.mode_param.red.maxp_inv);\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_cman_config = {\n+\t.f = cmd_show_port_cman_cfg_parsed,\n+\t.data = NULL,\n+\t.help_str = \"show port cman config <port_id>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_cman_cfg_show,\n+\t\t(void *)&cmd_show_port_cman_cfg_port,\n+\t\t(void *)&cmd_show_port_cman_cfg_cman,\n+\t\t(void *)&cmd_show_port_cman_cfg_cfg,\n+\t\t(void *)&cmd_show_port_cman_cfg_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Set Port Congestion Management configuration *** */\n+struct cmd_set_port_cman_cfg_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t cman;\n+\tcmdline_fixed_string_t cfg;\n+\tuint16_t port_id;\n+\tuint16_t qid;\n+\tcmdline_multi_string_t params;\n+};\n+\n+static cmdline_parse_token_string_t cmd_set_port_cman_cfg_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, set, \"set\");\n+\n+static cmdline_parse_token_string_t cmd_set_port_cman_cfg_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, port, \"port\");\n+\n+static cmdline_parse_token_string_t cmd_set_port_cman_cfg_cman =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, cman, \"cman\");\n+\n+static cmdline_parse_token_string_t cmd_set_port_cman_cfg_cfg =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, cfg, \"config\");\n+\n+static cmdline_parse_token_num_t cmd_set_port_cman_cfg_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, port_id, RTE_UINT16);\n+\n+static cmdline_parse_token_num_t cmd_set_port_cman_cfg_qid =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_cman_cfg_result, qid, RTE_UINT16);\n+\n+static cmdline_parse_token_string_t cmd_set_port_cman_cfg_params =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_set_port_cman_cfg_result,\n+\t\tparams, TOKEN_STRING_MULTI);\n+\n+static void cmd_set_port_cman_cfg_parsed(void *parsed_result,\n+\t__rte_unused struct cmdline *cl,\n+\t__rte_unused void *data)\n+{\n+\tstruct cmd_set_port_cman_cfg_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tstruct rte_eth_cman_config cfg;\n+\tint ret;\n+\n+\tret = parse_cman_params_str(port_id, res->params, &cfg);\n+\tif (ret) {\n+\t\tfprintf(stderr, \"params string parse error\\n\");\n+\t\treturn;\n+\t}\n+\n+\tcfg.obj_param.rx_queue = res->qid;\n+\trte_eth_cman_config_set(port_id, &cfg);\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_cman_config = {\n+\t.f = cmd_set_port_cman_cfg_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set port cman config <port_id> <queue_id> \"\n+\t\t    \"default | [obj <queue|queue_mempool> mode red \"\n+\t\t    \"<min_thresh> <max_thresh> <prob_inv>]\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_cman_cfg_set,\n+\t\t(void *)&cmd_set_port_cman_cfg_port,\n+\t\t(void *)&cmd_set_port_cman_cfg_cman,\n+\t\t(void *)&cmd_set_port_cman_cfg_cfg,\n+\t\t(void *)&cmd_set_port_cman_cfg_port_id,\n+\t\t(void *)&cmd_set_port_cman_cfg_qid,\n+\t\t(void *)&cmd_set_port_cman_cfg_params,\n+\t\tNULL,\n+\t},\n+};\ndiff --git a/app/test-pmd/cmdline_cman.h b/app/test-pmd/cmdline_cman.h\nnew file mode 100644\nindex 0000000000..bd6c99ce35\n--- /dev/null\n+++ b/app/test-pmd/cmdline_cman.h\n@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2022 Marvell International Ltd.\n+ */\n+\n+#ifndef _CMDLINE_CMAN_H_\n+#define _CMDLINE_CMAN_H_\n+\n+extern cmdline_parse_inst_t cmd_show_port_cman_capa;\n+extern cmdline_parse_inst_t cmd_show_port_cman_config;\n+extern cmdline_parse_inst_t cmd_set_port_cman_config;\n+\n+#endif /* _CMDLINE_CMAN_H_ */\ndiff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build\nindex 74399178dd..c03d9dfebb 100644\n--- a/app/test-pmd/meson.build\n+++ b/app/test-pmd/meson.build\n@@ -7,6 +7,7 @@ cflags += '-Wno-deprecated-declarations'\n sources = files(\n         '5tswap.c',\n         'cmdline.c',\n+        'cmdline_cman.c',\n         'cmdline_flow.c',\n         'cmdline_mtr.c',\n         'cmdline_tm.c',\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex d3075bf87d..b9c7b468af 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -5317,6 +5317,32 @@ Flex pattern can be shared between ports.\n    testpmd> flow create 0 ingress pattern eth / ipv4 / udp / flex item is 3 pattern is 2 / end actions mark id 1 / queue index 0 / end\n    Flow rule #0 created\n \n+Congestion Management\n+---------------------\n+\n+Get capabilities\n+~~~~~~~~~~~~~~~~\n+\n+Retrieve congestion management capabilities supported by driver for given port.\n+Below example command retrieves capabilities for port 0::\n+\n+   testpmd> show port cman capa 0\n+\n+Get configuration\n+~~~~~~~~~~~~~~~~~\n+Retrieve congestion management configuration for given port. Below example\n+command retrieves configuration for port 0::\n+\n+   testpmd> show port cman config 0\n+\n+Set configuration\n+~~~~~~~~~~~~~~~~~\n+Configures congestion management settings on given queue or mempool associated\n+with queue. Below example command configures RED as congestion management algo\n+for port 0 and queue 0::\n+\n+   testpmd> set port cman config 0 0 obj queue mode red 10 100 1\n+\n Driver specific commands\n ------------------------\n \n",
    "prefixes": [
        "1/3"
    ]
}