get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138737,
    "url": "http://patchwork.dpdk.org/api/patches/138737/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240322070923.244417-7-huangdengdui@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240322070923.244417-7-huangdengdui@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240322070923.244417-7-huangdengdui@huawei.com",
    "date": "2024-03-22T07:09:23",
    "name": "[v2,6/6] app/testpmd: support setting lanes",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "71eb3f87acb6d62aeff3396c998dbb22e6034e7c",
    "submitter": {
        "id": 3066,
        "url": "http://patchwork.dpdk.org/api/people/3066/?format=api",
        "name": "huangdengdui",
        "email": "huangdengdui@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240322070923.244417-7-huangdengdui@huawei.com/mbox/",
    "series": [
        {
            "id": 31593,
            "url": "http://patchwork.dpdk.org/api/series/31593/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31593",
            "date": "2024-03-22T07:09:17",
            "name": "support setting lanes",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/31593/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/138737/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/138737/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 9A9A343D1E;\n\tFri, 22 Mar 2024 08:10:01 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 38A7C42EA6;\n\tFri, 22 Mar 2024 08:09:38 +0100 (CET)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id EB54F4003C\n for <dev@dpdk.org>; Fri, 22 Mar 2024 08:09:27 +0100 (CET)",
            "from mail.maildlp.com (unknown [172.19.163.174])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4V1D061CmczXjTV;\n Fri, 22 Mar 2024 15:06:46 +0800 (CST)",
            "from dggpeml500011.china.huawei.com (unknown [7.185.36.84])\n by mail.maildlp.com (Postfix) with ESMTPS id 82A8B1400E4;\n Fri, 22 Mar 2024 15:09:25 +0800 (CST)",
            "from localhost.huawei.com (10.50.165.33) by\n dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.1.2507.35; Fri, 22 Mar 2024 15:09:25 +0800"
        ],
        "From": "Dengdui Huang <huangdengdui@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@amd.com>, <aman.deep.singh@intel.com>,\n <yuying.zhang@intel.com>, <thomas@monjalon.net>,\n <andrew.rybchenko@oktetlabs.ru>, <damodharam.ammepalli@broadcom.com>,\n <stephen@networkplumber.org>, <jerinjacobk@gmail.com>,\n <ajit.khaparde@broadcom.com>, <liuyonglong@huawei.com>,\n <fengchengwen@huawei.com>, <haijie1@huawei.com>, <lihuisong@huawei.com>",
        "Subject": "[PATCH v2 6/6] app/testpmd: support setting lanes",
        "Date": "Fri, 22 Mar 2024 15:09:23 +0800",
        "Message-ID": "<20240322070923.244417-7-huangdengdui@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20240322070923.244417-1-huangdengdui@huawei.com>",
        "References": "<20240312075238.3319480-4-huangdengdui@huawei.com>\n <20240322070923.244417-1-huangdengdui@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.50.165.33]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggpeml500011.china.huawei.com (7.185.36.84)",
        "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": "Add a command to config speed with lanes and\nadded print the lane number for show info command.\n\nSigned-off-by: Dengdui Huang <huangdengdui@huawei.com>\n---\n app/test-pmd/cmdline.c                      | 199 +++++++++++++-------\n app/test-pmd/config.c                       |  78 +++++---\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |   9 +\n 3 files changed, 194 insertions(+), 92 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex f521a1fe9e..413bf735a2 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -696,6 +696,11 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" duplex (half|full|auto)\\n\"\n \t\t\t\"    Set speed and duplex for all ports or port_id\\n\\n\"\n \n+\t\t\t\"port config (port_id|all)\"\n+\t\t\t\" speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto)\"\n+\t\t\t\" lanes (lane_num) duplex (half|full|auto)\\n\"\n+\t\t\t\"    Set speed and duplex for all ports or port_id\\n\\n\"\n+\n \t\t\t\"port config (port_id|all) loopback (mode)\\n\"\n \t\t\t\"    Set loopback mode for all ports or port_id\\n\\n\"\n \n@@ -1357,14 +1362,19 @@ struct cmd_config_speed_all {\n \tcmdline_fixed_string_t all;\n \tcmdline_fixed_string_t item1;\n \tcmdline_fixed_string_t item2;\n+\tcmdline_fixed_string_t item3;\n \tcmdline_fixed_string_t value1;\n-\tcmdline_fixed_string_t value2;\n+\tuint8_t value2;\n+\tcmdline_fixed_string_t value3;\n };\n \n static int\n-parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)\n+parse_and_check_speed_duplex(char *speedstr, uint8_t lanes, char *duplexstr,\n+\t\t\t     uint32_t *speed)\n {\n \n+\tuint32_t speed_num;\n+\tchar *endptr;\n \tint duplex;\n \n \tif (!strcmp(duplexstr, \"half\")) {\n@@ -1378,47 +1388,22 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)\n \t\treturn -1;\n \t}\n \n-\tif (!strcmp(speedstr, \"10\")) {\n-\t\t*speed = (duplex == RTE_ETH_LINK_HALF_DUPLEX) ?\n-\t\t\t\tRTE_ETH_LINK_SPEED_10M_HD : RTE_ETH_LINK_SPEED_10M;\n-\t} else if (!strcmp(speedstr, \"100\")) {\n-\t\t*speed = (duplex == RTE_ETH_LINK_HALF_DUPLEX) ?\n-\t\t\t\tRTE_ETH_LINK_SPEED_100M_HD : RTE_ETH_LINK_SPEED_100M;\n-\t} else {\n-\t\tif (duplex != RTE_ETH_LINK_FULL_DUPLEX) {\n-\t\t\tfprintf(stderr, \"Invalid speed/duplex parameters\\n\");\n-\t\t\treturn -1;\n-\t\t}\n-\t\tif (!strcmp(speedstr, \"1000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_1G;\n-\t\t} else if (!strcmp(speedstr, \"2500\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_2_5G;\n-\t\t} else if (!strcmp(speedstr, \"5000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_5G;\n-\t\t} else if (!strcmp(speedstr, \"10000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_10G;\n-\t\t} else if (!strcmp(speedstr, \"25000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_25G;\n-\t\t} else if (!strcmp(speedstr, \"40000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_40G;\n-\t\t} else if (!strcmp(speedstr, \"50000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_50G;\n-\t\t} else if (!strcmp(speedstr, \"100000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_100G;\n-\t\t} else if (!strcmp(speedstr, \"200000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_200G;\n-\t\t} else if (!strcmp(speedstr, \"400000\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_400G;\n-\t\t} else if (!strcmp(speedstr, \"auto\")) {\n-\t\t\t*speed = RTE_ETH_LINK_SPEED_AUTONEG;\n-\t\t} else {\n-\t\t\tfprintf(stderr, \"Unknown speed parameter\\n\");\n-\t\t\treturn -1;\n-\t\t}\n+\tif (!strcmp(speedstr, \"auto\")) {\n+\t\t*speed = RTE_ETH_LINK_SPEED_AUTONEG;\n+\t\treturn 0;\n \t}\n \n-\tif (*speed != RTE_ETH_LINK_SPEED_AUTONEG)\n-\t\t*speed |= RTE_ETH_LINK_SPEED_FIXED;\n+\tspeed_num = strtol(speedstr, &endptr, 10);\n+\tif (*endptr != '\\0') {\n+\t\tfprintf(stderr, \"Unknown speed parameter\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\t*speed = rte_eth_speed_bitflag(speed_num, lanes, duplex);\n+\tif (*speed == 0) {\n+\t\tfprintf(stderr, \"param error\\n\");\n+\t\treturn -1;\n+\t}\n \n \treturn 0;\n }\n@@ -1426,22 +1411,37 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)\n static void\n cmd_config_speed_all_parsed(void *parsed_result,\n \t\t\t__rte_unused struct cmdline *cl,\n-\t\t\t__rte_unused void *data)\n+\t\t\tvoid *data)\n {\n \tstruct cmd_config_speed_all *res = parsed_result;\n+\tstruct rte_eth_dev_info dev_info;\n \tuint32_t link_speed;\n \tportid_t pid;\n+\tint ret;\n \n \tif (!all_ports_stopped()) {\n \t\tfprintf(stderr, \"Please stop all ports first\\n\");\n \t\treturn;\n \t}\n \n-\tif (parse_and_check_speed_duplex(res->value1, res->value2,\n-\t\t\t&link_speed) < 0)\n+\tif (data)\n+\t\tret = parse_and_check_speed_duplex(res->value1, res->value2,\n+\t\t\t\t\t\t   res->value3, &link_speed);\n+\telse\n+\t\tret = parse_and_check_speed_duplex(res->value1, 0, res->value3,\n+\t\t\t\t\t\t   &link_speed);\n+\tif (ret < 0)\n \t\treturn;\n \n \tRTE_ETH_FOREACH_DEV(pid) {\n+\t\tret = eth_dev_info_get_print_err(pid, &dev_info);\n+\t\tif (ret != 0)\n+\t\t\treturn;\n+\t\tif ((dev_info.dev_capa & RTE_ETH_DEV_CAPA_SETTING_LANES) == 0 && data) {\n+\t\t\tfprintf(stderr, \"The port (%d) does not support setting lane\\n\",\n+\t\t\t\tpid);\n+\t\t\treturn;\n+\t\t}\n \t\tports[pid].dev_conf.link_speeds = link_speed;\n \t}\n \n@@ -1460,26 +1460,51 @@ static cmdline_parse_token_string_t cmd_config_speed_all_item1 =\n static cmdline_parse_token_string_t cmd_config_speed_all_value1 =\n \tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1,\n \t\t\t\t\"10#100#1000#2500#5000#10000#25000#40000#50000#100000#200000#400000#auto\");\n-static cmdline_parse_token_string_t cmd_config_speed_all_item2 =\n-\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, \"duplex\");\n-static cmdline_parse_token_string_t cmd_config_speed_all_value2 =\n-\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value2,\n+static cmdline_parse_token_string_t cmd_config_speed_all__item2 =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, \"lanes\");\n+static cmdline_parse_token_num_t cmd_config_speed_all_value2 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_config_speed_all, value2,\n+\t\t\t      RTE_UINT8);\n+static cmdline_parse_token_string_t cmd_config_speed_all_item3 =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item3, \"duplex\");\n+static cmdline_parse_token_string_t cmd_config_speed_all_value3 =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value3,\n \t\t\t\t\t\t\"half#full#auto\");\n \n-static cmdline_parse_inst_t cmd_config_speed_all = {\n+static cmdline_parse_inst_t cmd_config_speed_lanes_all = {\n \t.f = cmd_config_speed_all_parsed,\n-\t.data = NULL,\n+\t.data = (void *)1,\n \t.help_str = \"port config all speed \"\n-\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto duplex \"\n-\t\t\t\t\t\t\t\"half|full|auto\",\n+\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto\"\n+\t\t\" lanes <lanes> duplex half|full|auto\",\n \t.tokens = {\n \t\t(void *)&cmd_config_speed_all_port,\n \t\t(void *)&cmd_config_speed_all_keyword,\n \t\t(void *)&cmd_config_speed_all_all,\n \t\t(void *)&cmd_config_speed_all_item1,\n \t\t(void *)&cmd_config_speed_all_value1,\n-\t\t(void *)&cmd_config_speed_all_item2,\n+\t\t(void *)&cmd_config_speed_all__item2,\n \t\t(void *)&cmd_config_speed_all_value2,\n+\t\t(void *)&cmd_config_speed_all_item3,\n+\t\t(void *)&cmd_config_speed_all_value3,\n+\t\tNULL,\n+\t},\n+};\n+\n+static cmdline_parse_inst_t cmd_config_speed_all = {\n+\t.f = cmd_config_speed_all_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"port config all speed \"\n+\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto\"\n+\t\t\" duplex half|full|auto\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_speed_all_port,\n+\t\t(void *)&cmd_config_speed_all_keyword,\n+\t\t(void *)&cmd_config_speed_all_all,\n+\t\t(void *)&cmd_config_speed_all_item1,\n+\t\t(void *)&cmd_config_speed_all_value1,\n+\t\t(void *)&cmd_config_speed_all_item3,\n+\t\t(void *)&cmd_config_speed_all_value3,\n \t\tNULL,\n \t},\n };\n@@ -1491,17 +1516,20 @@ struct cmd_config_speed_specific {\n \tportid_t id;\n \tcmdline_fixed_string_t item1;\n \tcmdline_fixed_string_t item2;\n+\tcmdline_fixed_string_t item3;\n \tcmdline_fixed_string_t value1;\n-\tcmdline_fixed_string_t value2;\n+\tuint8_t value2;\n+\tcmdline_fixed_string_t value3;\n };\n \n static void\n cmd_config_speed_specific_parsed(void *parsed_result,\n-\t\t\t\t__rte_unused struct cmdline *cl,\n-\t\t\t\t__rte_unused void *data)\n+\t\t\t\t__rte_unused struct cmdline *cl, void *data)\n {\n \tstruct cmd_config_speed_specific *res = parsed_result;\n+\tstruct rte_eth_dev_info dev_info;\n \tuint32_t link_speed;\n+\tint ret;\n \n \tif (port_id_is_invalid(res->id, ENABLED_WARN))\n \t\treturn;\n@@ -1511,8 +1539,23 @@ cmd_config_speed_specific_parsed(void *parsed_result,\n \t\treturn;\n \t}\n \n-\tif (parse_and_check_speed_duplex(res->value1, res->value2,\n-\t\t\t&link_speed) < 0)\n+\tret = eth_dev_info_get_print_err(res->id, &dev_info);\n+\tif (ret != 0)\n+\t\treturn;\n+\n+\tif ((dev_info.dev_capa & RTE_ETH_DEV_CAPA_SETTING_LANES) == 0 && data) {\n+\t\tfprintf(stderr, \"The port (%d) does not support setting lanes\\n\",\n+\t\t\tres->id);\n+\t\treturn;\n+\t}\n+\n+\tif (data)\n+\t\tret = parse_and_check_speed_duplex(res->value1, res->value2,\n+\t\t\t\t\t\t   res->value3, &link_speed);\n+\telse\n+\t\tret = parse_and_check_speed_duplex(res->value1, 0, res->value3,\n+\t\t\t\t\t\t   &link_speed);\n+\tif (ret < 0)\n \t\treturn;\n \n \tports[res->id].dev_conf.link_speeds = link_speed;\n@@ -1537,17 +1580,23 @@ static cmdline_parse_token_string_t cmd_config_speed_specific_value1 =\n \t\t\t\t\"10#100#1000#2500#5000#10000#25000#40000#50000#100000#200000#400000#auto\");\n static cmdline_parse_token_string_t cmd_config_speed_specific_item2 =\n \tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2,\n+\t\t\t\t\t\t\t\t\"lanes\");\n+static cmdline_parse_token_num_t cmd_config_speed_specific_value2 =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_config_speed_specific, value2,\n+\t\t\t      RTE_UINT8);\n+static cmdline_parse_token_string_t cmd_config_speed_specific_item3 =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item3,\n \t\t\t\t\t\t\t\t\"duplex\");\n-static cmdline_parse_token_string_t cmd_config_speed_specific_value2 =\n-\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value2,\n+static cmdline_parse_token_string_t cmd_config_speed_specific_value3 =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value3,\n \t\t\t\t\t\t\t\"half#full#auto\");\n \n-static cmdline_parse_inst_t cmd_config_speed_specific = {\n+static cmdline_parse_inst_t cmd_config_speed_lanes_specific = {\n \t.f = cmd_config_speed_specific_parsed,\n-\t.data = NULL,\n+\t.data = (void *)1,\n \t.help_str = \"port config <port_id> speed \"\n-\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto duplex \"\n-\t\t\t\t\t\t\t\"half|full|auto\",\n+\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto\"\n+\t\t\" lanes <lane_num> duplex half|full|auto\",\n \t.tokens = {\n \t\t(void *)&cmd_config_speed_specific_port,\n \t\t(void *)&cmd_config_speed_specific_keyword,\n@@ -1556,6 +1605,26 @@ static cmdline_parse_inst_t cmd_config_speed_specific = {\n \t\t(void *)&cmd_config_speed_specific_value1,\n \t\t(void *)&cmd_config_speed_specific_item2,\n \t\t(void *)&cmd_config_speed_specific_value2,\n+\t\t(void *)&cmd_config_speed_specific_item3,\n+\t\t(void *)&cmd_config_speed_specific_value3,\n+\t\tNULL,\n+\t},\n+};\n+\n+static cmdline_parse_inst_t cmd_config_speed_specific = {\n+\t.f = cmd_config_speed_specific_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"port config <port_id> speed \"\n+\t\t\"10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto\"\n+\t\t\" duplex half|full|auto\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_speed_specific_port,\n+\t\t(void *)&cmd_config_speed_specific_keyword,\n+\t\t(void *)&cmd_config_speed_specific_id,\n+\t\t(void *)&cmd_config_speed_specific_item1,\n+\t\t(void *)&cmd_config_speed_specific_value1,\n+\t\t(void *)&cmd_config_speed_specific_item3,\n+\t\t(void *)&cmd_config_speed_specific_value3,\n \t\tNULL,\n \t},\n };\n@@ -13237,6 +13306,8 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_set_port_setup_on,\n \t(cmdline_parse_inst_t *)&cmd_config_speed_all,\n \t(cmdline_parse_inst_t *)&cmd_config_speed_specific,\n+\t(cmdline_parse_inst_t *)&cmd_config_speed_lanes_all,\n+\t(cmdline_parse_inst_t *)&cmd_config_speed_lanes_specific,\n \t(cmdline_parse_inst_t *)&cmd_config_loopback_all,\n \t(cmdline_parse_inst_t *)&cmd_config_loopback_specific,\n \t(cmdline_parse_inst_t *)&cmd_config_rx_tx,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex ba1007ace6..3f77f321a5 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -587,39 +587,51 @@ device_infos_display_speeds(uint32_t speed_capa)\n \tif (speed_capa == RTE_ETH_LINK_SPEED_AUTONEG)\n \t\tprintf(\" Autonegotiate (all speeds)\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_FIXED)\n-\t\tprintf(\" Disable autonegotiate (fixed speed)  \");\n+\t\tprintf(\" Disable autonegotiate (fixed speed) /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_10M_HD)\n-\t\tprintf(\" 10 Mbps half-duplex  \");\n+\t\tprintf(\" 10Mbps_1lane_half-duplex /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_10M)\n-\t\tprintf(\" 10 Mbps full-duplex  \");\n+\t\tprintf(\" 10Mbps_1lane_full-duplex /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_100M_HD)\n-\t\tprintf(\" 100 Mbps half-duplex  \");\n+\t\tprintf(\" 100Mbps_lane_half-duplex /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_100M)\n-\t\tprintf(\" 100 Mbps full-duplex  \");\n+\t\tprintf(\" 100Mbps_1lane_full-duplex /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_1G)\n-\t\tprintf(\" 1 Gbps  \");\n+\t\tprintf(\" 1Gbps_1lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_2_5G)\n-\t\tprintf(\" 2.5 Gbps  \");\n+\t\tprintf(\" 2.5Gbps_1lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_5G)\n-\t\tprintf(\" 5 Gbps  \");\n+\t\tprintf(\" 5Gbps_1lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_10G)\n-\t\tprintf(\" 10 Gbps  \");\n-\tif (speed_capa & RTE_ETH_LINK_SPEED_20G)\n-\t\tprintf(\" 20 Gbps  \");\n+\t\tprintf(\" 10Gbps_1lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_10G_4LANES)\n+\t\tprintf(\" 10Gbps_4lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_20G_2LANES)\n+\t\tprintf(\" 20Gbps_2lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_25G)\n-\t\tprintf(\" 25 Gbps  \");\n-\tif (speed_capa & RTE_ETH_LINK_SPEED_40G)\n-\t\tprintf(\" 40 Gbps  \");\n+\t\tprintf(\" 25Gbps_1lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_40G_4LANES)\n+\t\tprintf(\" 40Gbps_4lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_50G)\n-\t\tprintf(\" 50 Gbps  \");\n-\tif (speed_capa & RTE_ETH_LINK_SPEED_56G)\n-\t\tprintf(\" 56 Gbps  \");\n+\t\tprintf(\" 50Gbps_1lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_50G_2LANES)\n+\t\tprintf(\" 50Gbps_2lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_56G_4LANES)\n+\t\tprintf(\" 56Gbps_4lane /\");\n \tif (speed_capa & RTE_ETH_LINK_SPEED_100G)\n-\t\tprintf(\" 100 Gbps  \");\n-\tif (speed_capa & RTE_ETH_LINK_SPEED_200G)\n-\t\tprintf(\" 200 Gbps  \");\n-\tif (speed_capa & RTE_ETH_LINK_SPEED_400G)\n-\t\tprintf(\" 400 Gbps  \");\n+\t\tprintf(\" 100Gbps_1lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_100G_2LANES)\n+\t\tprintf(\" 100Gbps_2lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_100G_4LANES)\n+\t\tprintf(\" 100Gbps_4lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_200G_4LANES)\n+\t\tprintf(\" 200Gbps_4lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_200G_2LANES)\n+\t\tprintf(\" 200Gbps_2lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_400G_4LANES)\n+\t\tprintf(\" 400Gbps_4lane /\");\n+\tif (speed_capa & RTE_ETH_LINK_SPEED_400G_8LANES)\n+\t\tprintf(\" 400Gbps_8lane /\");\n }\n \n void\n@@ -828,6 +840,10 @@ port_infos_display(portid_t port_id)\n \n \tprintf(\"\\nLink status: %s\\n\", (link.link_status) ? (\"up\") : (\"down\"));\n \tprintf(\"Link speed: %s\\n\", rte_eth_link_speed_to_str(link.link_speed));\n+\tif (link.link_lanes == 0)\n+\t\tprintf(\"Link lanes: unknown\\n\");\n+\telse\n+\t\tprintf(\"Link lanes: %u\\n\", link.link_lanes);\n \tprintf(\"Link duplex: %s\\n\", (link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX) ?\n \t       (\"full-duplex\") : (\"half-duplex\"));\n \tprintf(\"Autoneg status: %s\\n\", (link.link_autoneg == RTE_ETH_LINK_AUTONEG) ?\n@@ -962,8 +978,8 @@ port_summary_header_display(void)\n \n \tport_number = rte_eth_dev_count_avail();\n \tprintf(\"Number of available ports: %i\\n\", port_number);\n-\tprintf(\"%-4s %-17s %-12s %-14s %-8s %s\\n\", \"Port\", \"MAC Address\", \"Name\",\n-\t\t\t\"Driver\", \"Status\", \"Link\");\n+\tprintf(\"%-4s %-17s %-12s %-14s %-8s %-8s %s\\n\", \"Port\", \"MAC Address\", \"Name\",\n+\t\t\t\"Driver\", \"Status\", \"Link\", \"Lanes\");\n }\n \n void\n@@ -993,10 +1009,16 @@ port_summary_display(portid_t port_id)\n \tif (ret != 0)\n \t\treturn;\n \n-\tprintf(\"%-4d \" RTE_ETHER_ADDR_PRT_FMT \" %-12s %-14s %-8s %s\\n\",\n-\t\tport_id, RTE_ETHER_ADDR_BYTES(&mac_addr), name,\n-\t\tdev_info.driver_name, (link.link_status) ? (\"up\") : (\"down\"),\n-\t\trte_eth_link_speed_to_str(link.link_speed));\n+\tif (link.link_lanes == RTE_ETH_LANES_UNKNOWN)\n+\t\tprintf(\"%-4d \" RTE_ETHER_ADDR_PRT_FMT \" %-12s %-14s %-8s %-8s %s\\n\",\n+\t\t\tport_id, RTE_ETHER_ADDR_BYTES(&mac_addr), name,\n+\t\t\tdev_info.driver_name, (link.link_status) ? (\"up\") : (\"down\"),\n+\t\t\trte_eth_link_speed_to_str(link.link_speed), \"unknown\");\n+\telse\n+\t\tprintf(\"%-4d \" RTE_ETHER_ADDR_PRT_FMT \" %-12s %-14s %-8s %-8s %u\\n\",\n+\t\t\tport_id, RTE_ETHER_ADDR_BYTES(&mac_addr), name,\n+\t\t\tdev_info.driver_name, (link.link_status) ? (\"up\") : (\"down\"),\n+\t\t\trte_eth_link_speed_to_str(link.link_speed), link.link_lanes);\n }\n \n void\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 2fbf9220d8..118a0956bc 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -190,6 +190,7 @@ For example:\n    memory allocation on the socket: 0\n    Link status: up\n    Link speed: 40000 Mbps\n+   Link lanes: 4\n    Link duplex: full-duplex\n    Promiscuous mode: enabled\n    Allmulticast mode: disabled\n@@ -2067,6 +2068,14 @@ Set the speed and duplex mode for all ports or a specific port::\n    testpmd> port config (port_id|all) speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto) \\\n             duplex (half|full|auto)\n \n+port config - speed with lanes\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Set the speed, lanes and duplex mode for all ports or a specific port::\n+\n+   testpmd> port config (port_id|all) speed (10|100|1000|2500|5000|10000|25000|40000|50000|100000|200000|400000|auto) \\\n+            lanes (lane_num) duplex (half|full|auto)\n+\n port config - queues/descriptors\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "v2",
        "6/6"
    ]
}