Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106975/?format=api
https://patches.dpdk.org/api/patches/106975/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220207135511.3012285-2-jerinj@marvell.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": "<20220207135511.3012285-2-jerinj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220207135511.3012285-2-jerinj@marvell.com", "date": "2022-02-07T13:55:10", "name": "[v4,2/2] app/testpmd: add queue based pfc CLI options", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "264e0b74478f6ec4d45df4dd6521e65f62b0f17e", "submitter": { "id": 1188, "url": "https://patches.dpdk.org/api/people/1188/?format=api", "name": "Jerin Jacob Kollanukkaran", "email": "jerinj@marvell.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/20220207135511.3012285-2-jerinj@marvell.com/mbox/", "series": [ { "id": 21495, "url": "https://patches.dpdk.org/api/series/21495/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21495", "date": "2022-02-07T13:55:09", "name": "[v4,1/2] ethdev: support queue-based priority flow control", "version": 4, "mbox": "https://patches.dpdk.org/series/21495/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/106975/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/106975/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 667EDA034F;\n\tMon, 7 Feb 2022 14:54:55 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4FE75410FF;\n\tMon, 7 Feb 2022 14:54:55 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 2C5CB410EA\n for <dev@dpdk.org>; Mon, 7 Feb 2022 14:54:54 +0100 (CET)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 2178oaQx018974;\n Mon, 7 Feb 2022 05:54:44 -0800", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3e3095ryeb-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 07 Feb 2022 05:54:44 -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 Mon, 7 Feb 2022 05:54:41 -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; Mon, 7 Feb 2022 05:54:41 -0800", "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 2ABE13F7068;\n Mon, 7 Feb 2022 05:54:23 -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=t0mHpmgszQmYxpvuSK4zuljRmw/hqe69IZKqGP7pwb4=;\n b=T6l71dROci9NLy5EEuWDDeqgjjydsOZ47X/9Ntgm0aJwcsyv8U/SIJWy9ED19nhyJ8cC\n YLNZl66D3tiib8CxnfhD+YiT/UryzNTlwvPgBF8K4nS2sYUAMUpCWANVsPxsnkOY+c9D\n 96BiChCYknhgHQDcTEJ9DiG9RdKFJF18pc7QNt6uyqzMquWT7UXOmt8FU7RurVuylxiE\n xcTNhGFm4osdcCNroFaV/etn8QVDn2BUPlZptKeRCxpXhz40j9fJJ0l5pGNcJCVOGRjT\n uVcIKHL7LI1xk6Ecvi8M+v4WjSo35rmLLWiniOJn0gGvarcGnxzqFSmtjNCJZfZU/T8z TA==", "From": "<jerinj@marvell.com>", "To": "<dev@dpdk.org>, Xiaoyun Li <xiaoyun.li@intel.com>, Aman Singh\n <aman.deep.singh@intel.com>, Yuying Zhang <yuying.zhang@intel.com>", "CC": "<thomas@monjalon.net>, <ferruh.yigit@intel.com>,\n <ajit.khaparde@broadcom.com>, <aboyer@pensando.io>,\n <andrew.rybchenko@oktetlabs.ru>, <beilei.xing@intel.com>,\n <bruce.richardson@intel.com>, <chas3@att.com>, <chenbo.xia@intel.com>,\n <ciara.loftus@intel.com>, <dsinghrawat@marvell.com>,\n <ed.czeck@atomicrules.com>, <evgenys@amazon.com>, <grive@u256.net>,\n <g.singh@nxp.com>, <zhouguoyang@huawei.com>, <haiyue.wang@intel.com>,\n <hkalra@marvell.com>, <heinrich.kuhn@corigine.com>,\n <hemant.agrawal@nxp.com>, <hyonkim@cisco.com>, <igorch@amazon.com>,\n <irusskikh@marvell.com>, <jgrajcia@cisco.com>,\n <jasvinder.singh@intel.com>, <jianwang@trustnetic.com>,\n <jiawenwu@trustnetic.com>, <jingjing.wu@intel.com>,\n <johndale@cisco.com>, <john.miller@atomicrules.com>,\n <linville@tuxdriver.com>, <keith.wiles@intel.com>,\n <kirankumark@marvell.com>, <oulijun@huawei.com>, <lironh@marvell.com>,\n <longli@microsoft.com>, <mw@semihalf.com>, <spinler@cesnet.cz>,\n <matan@nvidia.com>, <matt.peters@windriver.com>,\n <maxime.coquelin@redhat.com>, <mk@semihalf.com>, <humin29@huawei.com>,\n <pnalla@marvell.com>, <ndabilpuram@marvell.com>,\n <qiming.yang@intel.com>, <qi.z.zhang@intel.com>, <radhac@marvell.com>,\n <rahul.lakkireddy@chelsio.com>, <rmody@marvell.com>,\n <rosen.xu@intel.com>, <sachin.saxena@oss.nxp.com>,\n <skoteshwar@marvell.com>, <shshaikh@marvell.com>,\n <shaibran@amazon.com>, <shepard.siegel@atomicrules.com>,\n <asomalap@amd.com>, <somnath.kotur@broadcom.com>,\n <sthemmin@microsoft.com>, <steven.webster@windriver.com>,\n <skori@marvell.com>, <mtetsuyah@gmail.com>, <vburru@marvell.com>,\n <viacheslavo@nvidia.com>, <xiao.w.wang@intel.com>,\n <cloud.wangxiaoyun@huawei.com>, <yisen.zhuang@huawei.com>,\n <yongwang@vmware.com>, <xuanziyang2@huawei.com>", "Subject": "[dpdk-dev] [PATCH v4 2/2] app/testpmd: add queue based pfc CLI\n options", "Date": "Mon, 7 Feb 2022 19:25:10 +0530", "Message-ID": "<20220207135511.3012285-2-jerinj@marvell.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220207135511.3012285-1-jerinj@marvell.com>", "References": "<20220131180859.2662034-1-jerinj@marvell.com>\n <20220207135511.3012285-1-jerinj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-ORIG-GUID": "Ip3FoeWvcG-MnI6YijBtr9aYccjPT16g", "X-Proofpoint-GUID": "Ip3FoeWvcG-MnI6YijBtr9aYccjPT16g", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513\n definitions=2022-02-07_05,2022-02-07_02,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>\n---\nv4..v3:\n- fix documentation to explain CLI syntax.\nv3..v1:\n- Sync up the implementation to use new APIs\n\n app/test-pmd/cmdline.c | 122 ++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 23 ++++\n 2 files changed, 145 insertions(+)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex e626b1c7d9..1af0321af0 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_configure(res->port_id,\n+\t\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 94792d88cc..44b582a486 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,29 @@ 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 quanta filled in the PFC frame for which\n+ interval, remote Tx will be paused. Valid only if Tx pause is on.\n+\n set stat_qmap\n ~~~~~~~~~~~~~\n \n", "prefixes": [ "v4", "2/2" ] }{ "id": 106975, "url": "