get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105696,
    "url": "http://patchwork.dpdk.org/api/patches/105696/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220109105420.734326-2-skori@marvell.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": "<20220109105420.734326-2-skori@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220109105420.734326-2-skori@marvell.com",
    "date": "2022-01-09T10:54:20",
    "name": "[v1,2/2] app/testpmd: add queue based pfc CLI options",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b1109ab050a5b5db6352b8f690b238dd4c2dd222",
    "submitter": {
        "id": 1318,
        "url": "http://patchwork.dpdk.org/api/people/1318/?format=api",
        "name": "Sunil Kumar Kori",
        "email": "skori@marvell.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/20220109105420.734326-2-skori@marvell.com/mbox/",
    "series": [
        {
            "id": 20855,
            "url": "http://patchwork.dpdk.org/api/series/20855/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20855",
            "date": "2021-12-04T17:24:58",
            "name": "ethdev: support queue-based priority flow control",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20855/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105696/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/105696/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 8327DA0351;\n\tSun,  9 Jan 2022 11:54:42 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1A34240C35;\n\tSun,  9 Jan 2022 11:54:42 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id D31E740041\n for <dev@dpdk.org>; Sun,  9 Jan 2022 11:54:39 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 209Ar6Fb029106;\n Sun, 9 Jan 2022 02:54:38 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3df8usa5u3-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sun, 09 Jan 2022 02:54:38 -0800",
            "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 Sun, 9 Jan 2022 02:54:37 -0800",
            "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; Sun, 9 Jan 2022 02:54:37 -0800",
            "from localhost.localdomain (unknown [10.28.34.25])\n by maili.marvell.com (Postfix) with ESMTP id 96AED3F70A7;\n Sun,  9 Jan 2022 02:54:35 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=CCOaqknSG9KjquIFEZ6eOFrjnLPdTS+sTPtJXFLuF+Q=;\n b=NLfqnxjmLCCvCbCPgqyzHOeX3KlUC//Xwb/HTXJDNaM4D06JFqVGNd4Y8gnEFgW0lmEb\n VgezUSSpWX5RjPN7SAL5QhiuiB4R5acKh9QdrRKSXeet7vwoxE0oeeCPxQQGXZ77Rh7R\n 6fAvtIy1UOcyzcFT0UFwF9lstAVpWGlc9TqZmwzpJCHNo+nNQCKLZFdEW1eLjDPOFW9S\n rq3Dqx9WURjpQgB6HUB7+AbjQlIWixJ+6Qd1y8tZ8yCEQuW75FhLFRHnfkDz/HrP9Kxd\n QeH1I3PpO/WuWsrRT3Bvr7xQ6yqCG1y3wMh9SRNhs2n9NXo7MzgYXgrj9UCcolqtlJPp Gw==",
        "From": "<skori@marvell.com>",
        "To": "Xiaoyun Li <xiaoyun.li@intel.com>, Aman Singh <aman.deep.singh@intel.com>",
        "CC": "<dev@dpdk.org>, Sunil Kumar Kori <skori@marvell.com>",
        "Subject": "[PATCH v1 2/2] app/testpmd: add queue based pfc CLI options",
        "Date": "Sun, 9 Jan 2022 16:24:20 +0530",
        "Message-ID": "<20220109105420.734326-2-skori@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220109105420.734326-1-skori@marvell.com>",
        "References": "<20211204172458.1904300-1-jerinj@marvell.com>\n <20220109105420.734326-1-skori@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "XmW31Y5_Wvpm06rF_payoTgipEW-C7Ab",
        "X-Proofpoint-ORIG-GUID": "XmW31Y5_Wvpm06rF_payoTgipEW-C7Ab",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513\n definitions=2022-01-09_04,2022-01-07_01,2021-12-02_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\nPatch adds command line options to configure queue based\npriority flow control.\n\n- Syntax command is given as below:\n\nset pfc_queue_ctrl <port_id> rx <on|off> <tx_qid> <tx_tc> \\\n\ttx <on|off> <rx_qid> <rx_tc> <pause_time>\n\n- Example command to configure queue based priority flow control\n  on rx and tx side for port 0, Rx queue 0, Tx queue 0 with pause\n  time 2047\n\ntestpmd> set pfc_queue_ctrl 0 rx on 0 0 tx on 0 0 2047\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\nChange-Id: Ic6d0e3b1ba5f0a98ca7a5b7cafb0044c6c568b81\n---\n app/test-pmd/cmdline.c                      | 122 ++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  22 ++++\n 2 files changed, 144 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 6e10afeedd..0240fcf9e7 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -544,6 +544,11 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"    Set the priority flow control parameter on a\"\n \t\t\t\" port.\\n\\n\"\n \n+\t\t\t\"set pfc_queue_ctrl (port_id) rx (on|off) (tx_qid)\"\n+\t\t\t\" (tx_tc) tx (on|off) (rx_qid) (rx_tc) (pause_time)\\n\"\n+\t\t\t\"    Set the queue priority flow control parameter on a\"\n+\t\t\t\" given Rx and Tx queues of a port.\\n\\n\"\n+\n \t\t\t\"set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)\\n\"\n \t\t\t\"    Set statistics mapping (qmapping 0..15) for RX/TX\"\n \t\t\t\" queue on port.\\n\"\n@@ -7690,6 +7695,122 @@ cmdline_parse_inst_t cmd_priority_flow_control_set = {\n \t},\n };\n \n+struct cmd_queue_priority_flow_ctrl_set_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t pfc_queue_ctrl;\n+\tportid_t port_id;\n+\tcmdline_fixed_string_t rx;\n+\tcmdline_fixed_string_t rx_pfc_mode;\n+\tuint16_t tx_qid;\n+\tuint8_t  tx_tc;\n+\tcmdline_fixed_string_t tx;\n+\tcmdline_fixed_string_t tx_pfc_mode;\n+\tuint16_t rx_qid;\n+\tuint8_t  rx_tc;\n+\tuint16_t pause_time;\n+};\n+\n+static void\n+cmd_queue_priority_flow_ctrl_set_parsed(void *parsed_result,\n+\t\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_queue_priority_flow_ctrl_set_result *res = parsed_result;\n+\tstruct rte_eth_pfc_queue_conf pfc_queue_conf;\n+\tint rx_fc_enable, tx_fc_enable;\n+\tint ret;\n+\n+\t/*\n+\t * Rx on/off, flow control is enabled/disabled on RX side. This can\n+\t * indicate the RTE_ETH_FC_TX_PAUSE, Transmit pause frame at the Rx\n+\t * side. Tx on/off, flow control is enabled/disabled on TX side. This\n+\t * can indicate the RTE_ETH_FC_RX_PAUSE, Respond to the pause frame at\n+\t * the Tx side.\n+\t */\n+\tstatic enum rte_eth_fc_mode rx_tx_onoff_2_mode[2][2] = {\n+\t\t{RTE_ETH_FC_NONE, RTE_ETH_FC_TX_PAUSE},\n+\t\t{RTE_ETH_FC_RX_PAUSE, RTE_ETH_FC_FULL}\n+\t};\n+\n+\tmemset(&pfc_queue_conf, 0, sizeof(struct rte_eth_pfc_queue_conf));\n+\trx_fc_enable = (!strncmp(res->rx_pfc_mode, \"on\", 2)) ? 1 : 0;\n+\ttx_fc_enable = (!strncmp(res->tx_pfc_mode, \"on\", 2)) ? 1 : 0;\n+\tpfc_queue_conf.mode = rx_tx_onoff_2_mode[rx_fc_enable][tx_fc_enable];\n+\tpfc_queue_conf.rx_pause.tc  = res->tx_tc;\n+\tpfc_queue_conf.rx_pause.tx_qid = res->tx_qid;\n+\tpfc_queue_conf.tx_pause.tc  = res->rx_tc;\n+\tpfc_queue_conf.tx_pause.rx_qid  = res->rx_qid;\n+\tpfc_queue_conf.tx_pause.pause_time = res->pause_time;\n+\n+\tret = rte_eth_dev_priority_flow_ctrl_queue_set(res->port_id,\n+\t\t\t\t\t\t       &pfc_queue_conf);\n+\tif (ret != 0) {\n+\t\tfprintf(stderr,\n+\t\t\t\"bad queue priority flow control parameter, rc = %d\\n\",\n+\t\t\tret);\n+\t}\n+}\n+\n+cmdline_parse_token_string_t cmd_q_pfc_set_set =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\tset, \"set\");\n+cmdline_parse_token_string_t cmd_q_pfc_set_flow_ctrl =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\tpfc_queue_ctrl, \"pfc_queue_ctrl\");\n+cmdline_parse_token_num_t cmd_q_pfc_set_portid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\tport_id, RTE_UINT16);\n+cmdline_parse_token_string_t cmd_q_pfc_set_rx =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\trx, \"rx\");\n+cmdline_parse_token_string_t cmd_q_pfc_set_rx_mode =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\trx_pfc_mode, \"on#off\");\n+cmdline_parse_token_num_t cmd_q_pfc_set_tx_qid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\ttx_qid, RTE_UINT16);\n+cmdline_parse_token_num_t cmd_q_pfc_set_tx_tc =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\ttx_tc, RTE_UINT8);\n+cmdline_parse_token_string_t cmd_q_pfc_set_tx =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\ttx, \"tx\");\n+cmdline_parse_token_string_t cmd_q_pfc_set_tx_mode =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\ttx_pfc_mode, \"on#off\");\n+cmdline_parse_token_num_t cmd_q_pfc_set_rx_qid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\trx_qid, RTE_UINT16);\n+cmdline_parse_token_num_t cmd_q_pfc_set_rx_tc =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\trx_tc, RTE_UINT8);\n+cmdline_parse_token_num_t cmd_q_pfc_set_pause_time =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_queue_priority_flow_ctrl_set_result,\n+\t\t\t\tpause_time, RTE_UINT16);\n+\n+cmdline_parse_inst_t cmd_queue_priority_flow_control_set = {\n+\t.f = cmd_queue_priority_flow_ctrl_set_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set pfc_queue_ctrl <port_id> rx <on|off> <tx_qid> <tx_tc> \"\n+\t\t\"tx <on|off> <rx_qid> <rx_tc> <pause_time>: \"\n+\t\t\"Configure the Ethernet queue priority flow control\",\n+\t.tokens = {\n+\t\t(void *)&cmd_q_pfc_set_set,\n+\t\t(void *)&cmd_q_pfc_set_flow_ctrl,\n+\t\t(void *)&cmd_q_pfc_set_portid,\n+\t\t(void *)&cmd_q_pfc_set_rx,\n+\t\t(void *)&cmd_q_pfc_set_rx_mode,\n+\t\t(void *)&cmd_q_pfc_set_tx_qid,\n+\t\t(void *)&cmd_q_pfc_set_tx_tc,\n+\t\t(void *)&cmd_q_pfc_set_tx,\n+\t\t(void *)&cmd_q_pfc_set_tx_mode,\n+\t\t(void *)&cmd_q_pfc_set_rx_qid,\n+\t\t(void *)&cmd_q_pfc_set_rx_tc,\n+\t\t(void *)&cmd_q_pfc_set_pause_time,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** RESET CONFIGURATION *** */\n struct cmd_reset_result {\n \tcmdline_fixed_string_t reset;\n@@ -17765,6 +17886,7 @@ cmdline_parse_ctx_t main_ctx[] = {\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_queue_priority_flow_control_set,\n \t(cmdline_parse_inst_t *)&cmd_config_dcb,\n \t(cmdline_parse_inst_t *)&cmd_read_reg,\n \t(cmdline_parse_inst_t *)&cmd_read_reg_bit_field,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 44228cd7d2..5ea2888adc 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -1561,6 +1561,28 @@ Where:\n \n * ``priority`` (0-7): VLAN User Priority.\n \n+set pfc_queue_ctrl\n+~~~~~~~~~~~~~~~~~~\n+\n+Set the priority flow control parameter on a given Rx and Tx queue of a port::\n+\n+   testpmd> set pfc_queue_ctrl <port_id> rx (on|off) <tx_qid> <tx_tc> \\\n+            tx (on|off) <rx_qid> <rx_tc> <pause_time>\n+\n+Where:\n+\n+* ``tx_qid`` (integer): Tx qid for which ``tx_tc`` will be applied and traffic\n+  will be paused when PFC frame is received with ``tx_tc`` enabled.\n+\n+* ``tx_tc`` (0-15): TC for which traffic is to be paused for xmit.\n+\n+* ``rx_qid`` (integer): Rx qid for which threshold will be applied and PFC\n+  frame will be generated with ``tx_tc`` when exceeds the threshold.\n+\n+* ``rx_tc`` (0-15): TC filled in PFC frame for which remote Tx is to be paused.\n+\n+* ``pause_time`` (integer): Pause quota filled in the PFC frame.\n+\n set stat_qmap\n ~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "v1",
        "2/2"
    ]
}