get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91544,
    "url": "https://patches.dpdk.org/api/patches/91544/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618469214-35316-1-git-send-email-humin29@huawei.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": "<1618469214-35316-1-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618469214-35316-1-git-send-email-humin29@huawei.com",
    "date": "2021-04-15T06:46:54",
    "name": "app/testpmd: support the query of link flow ctrl info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "914f639583ba04da3e8910e3f360ded86896abcc",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.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/1618469214-35316-1-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 16396,
            "url": "https://patches.dpdk.org/api/series/16396/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16396",
            "date": "2021-04-15T06:46:54",
            "name": "app/testpmd: support the query of link flow ctrl info",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16396/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91544/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91544/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 780FEA0A0C;\n\tThu, 15 Apr 2021 08:46:48 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5E0F5162053;\n\tThu, 15 Apr 2021 08:46:48 +0200 (CEST)",
            "from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190])\n by mails.dpdk.org (Postfix) with ESMTP id 40631162049\n for <dev@dpdk.org>; Thu, 15 Apr 2021 08:46:46 +0200 (CEST)",
            "from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FLVDP3NC5zpYPW\n for <dev@dpdk.org>; Thu, 15 Apr 2021 14:43:49 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id\n 14.3.498.0; Thu, 15 Apr 2021 14:46:39 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <xiaoyun.li@intel.com>",
        "Date": "Thu, 15 Apr 2021 14:46:54 +0800",
        "Message-ID": "<1618469214-35316-1-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH] app/testpmd: support the query of link flow ctrl\n info",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Huisong Li <lihuisong@huawei.com>\n\nThis patch supports the query of the link flow control parameter\non a port.\n\nThe command format is as follows:\nshow port <port_id> flow_ctrl\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++\n 2 files changed, 90 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 5bf1497..9fa85c4 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -258,6 +258,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \n \t\t\t\"show port (port_id) fec_mode\"\n \t\t\t\"\tShow fec mode of a port.\\n\\n\"\n+\n+\t\t\t\"show port <port_id> flow_ctrl\"\n+\t\t\t\"\tShow flow control info of a port.\\n\\n\"\n \t\t);\n \t}\n \n@@ -6863,6 +6866,85 @@ cmdline_parse_inst_t cmd_set_allmulti_mode_one = {\n \t},\n };\n \n+/* *** GET CURRENT ETHERNET LINK FLOW CONTROL *** */\n+struct cmd_link_flow_ctrl_show {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tportid_t port_id;\n+\tcmdline_fixed_string_t flow_ctrl;\n+};\n+\n+cmdline_parse_token_string_t cmd_lfc_show_show =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_show,\n+\t\t\t\tshow, \"show\");\n+cmdline_parse_token_string_t cmd_lfc_show_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_show,\n+\t\t\t\tport, \"port\");\n+cmdline_parse_token_num_t cmd_lfc_show_portid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_link_flow_ctrl_show,\n+\t\t\t\tport_id, RTE_UINT16);\n+cmdline_parse_token_string_t cmd_lfc_show_flow_ctrl =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_show,\n+\t\t\t\tflow_ctrl, \"flow_ctrl\");\n+\n+static void\n+cmd_link_flow_ctrl_show_parsed(void *parsed_result,\n+\t\t\t      __rte_unused struct cmdline *cl,\n+\t\t\t      __rte_unused void *data)\n+{\n+\tstruct cmd_link_flow_ctrl_show *res = parsed_result;\n+\tstatic const char *info_border = \"*********************\";\n+\tstruct rte_eth_fc_conf fc_conf;\n+\tbool rx_fc_en = false;\n+\tbool tx_fc_en = false;\n+\tint ret;\n+\n+\tif (!rte_eth_dev_is_valid_port(res->port_id)) {\n+\t\tprintf(\"Invalid port id %u\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_eth_dev_flow_ctrl_get(res->port_id, &fc_conf);\n+\tif (ret != 0) {\n+\t\tprintf(\"Failed to get current flow ctrl information: err = %d\\n\",\n+\t\t       ret);\n+\t\treturn;\n+\t}\n+\n+\tif ((fc_conf.mode == RTE_FC_RX_PAUSE) || (fc_conf.mode == RTE_FC_FULL))\n+\t\trx_fc_en = true;\n+\tif ((fc_conf.mode == RTE_FC_TX_PAUSE) || (fc_conf.mode == RTE_FC_FULL))\n+\t\ttx_fc_en = true;\n+\n+\tprintf(\"\\n%s Flow control infos for port %-2d %s\\n\",\n+\t\tinfo_border, res->port_id, info_border);\n+\tprintf(\"FC mode:\\n\");\n+\tprintf(\"   Rx: %s\\n\", rx_fc_en ? \"On\" : \"Off\");\n+\tprintf(\"   Tx: %s\\n\", tx_fc_en ? \"On\" : \"Off\");\n+\tprintf(\"FC autoneg status: %s\\n\", fc_conf.autoneg != 0 ? \"On\" : \"Off\");\n+\tprintf(\"pause_time: 0x%x\\n\", fc_conf.pause_time);\n+\tprintf(\"high_water: 0x%x\\n\", fc_conf.high_water);\n+\tprintf(\"low_water: 0x%x\\n\", fc_conf.low_water);\n+\tprintf(\"Send Xon: %s\\n\", fc_conf.send_xon ? \"On\" : \"Off\");\n+\tprintf(\"mac ctrl frame fwd: %s\\n\",\n+\t\tfc_conf.mac_ctrl_frame_fwd ? \"On\" : \"Off\");\n+\tprintf(\"\\n%s**************   End  ***********%s\\n\",\n+\t\tinfo_border, info_border);\n+}\n+\n+cmdline_parse_inst_t cmd_link_flow_control_show = {\n+\t.f = cmd_link_flow_ctrl_show_parsed,\n+\t.data = NULL,\n+\t.help_str = \"show port <port_id> flow_ctrl\",\n+\t.tokens = {\n+\t\t(void *)&cmd_lfc_show_show,\n+\t\t(void *)&cmd_lfc_show_port,\n+\t\t(void *)&cmd_lfc_show_portid,\n+\t\t(void *)&cmd_lfc_show_flow_ctrl,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** SETUP ETHERNET LINK FLOW CONTROL *** */\n struct cmd_link_flow_ctrl_set_result {\n \tcmdline_fixed_string_t set;\n@@ -17001,6 +17083,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_xon,\n \t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_macfwd,\n \t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_autoneg,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_show,\n \t(cmdline_parse_inst_t *)&cmd_priority_flow_control_set,\n \t(cmdline_parse_inst_t *)&cmd_config_dcb,\n \t(cmdline_parse_inst_t *)&cmd_read_reg,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex e3bfed5..3fca011 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -1526,6 +1526,13 @@ Where:\n \n * ``autoneg``: Change the auto-negotiation parameter.\n \n+show flow ctrl\n+~~~~~~~~~~~~~~\n+\n+show the link flow control parameter on a port::\n+\n+   testpmd> show port <port_id> flow_ctrl\n+\n set pfc_ctrl rx\n ~~~~~~~~~~~~~~~\n \n",
    "prefixes": []
}