get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131135,
    "url": "https://patches.dpdk.org/api/patches/131135/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230904061044.5692-5-haijie1@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": "<20230904061044.5692-5-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230904061044.5692-5-haijie1@huawei.com",
    "date": "2023-09-04T06:10:43",
    "name": "[v3,4/5] app/testpmd: add RSS hash algorithms display",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "91de3c7fb8197154e26d34e8f0d4dabd6ca34c6b",
    "submitter": {
        "id": 2935,
        "url": "https://patches.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@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/20230904061044.5692-5-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 29410,
            "url": "https://patches.dpdk.org/api/series/29410/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29410",
            "date": "2023-09-04T06:10:39",
            "name": "support setting and querying RSS algorithms",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/29410/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/131135/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/131135/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 27590424EC;\n\tMon,  4 Sep 2023 08:14:51 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C2ECE402DC;\n\tMon,  4 Sep 2023 08:14:36 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 94C2E402C8\n for <dev@dpdk.org>; Mon,  4 Sep 2023 08:14:33 +0200 (CEST)",
            "from kwepemi500020.china.huawei.com (unknown [172.30.72.56])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RfJCb26XGztSCc\n for <dev@dpdk.org>; Mon,  4 Sep 2023 14:10:35 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Mon, 4 Sep 2023 14:14:31 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<dev@dpdk.org>, Aman Singh <aman.deep.singh@intel.com>, Yuying Zhang\n <yuying.zhang@intel.com>",
        "CC": "<haijie1@huawei.com>, <lihuisong@huawei.com>",
        "Subject": "[PATCH v3 4/5] app/testpmd: add RSS hash algorithms display",
        "Date": "Mon, 4 Sep 2023 14:10:43 +0800",
        "Message-ID": "<20230904061044.5692-5-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20230904061044.5692-1-haijie1@huawei.com>",
        "References": "<20230826074607.16771-1-haijie1@huawei.com>\n <20230904061044.5692-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n kwepemi500020.china.huawei.com (7.221.188.8)",
        "X-CFilter-Loop": "Reflected",
        "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": "1. Add the command \"show port X rss-hash func\" to display the RSS hash\nalgorithms of port X.\n2. Add the command \"show port X rss-hash all\" to display the RSS hash\nconfiguration of port X, including RSS hash types, key and algorithms.\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n app/test-pmd/cmdline.c | 50 +++++++++++++++++++++++++++++++++++++-----\n app/test-pmd/config.c  | 46 +++++++++++++++++++++++---------------\n app/test-pmd/testpmd.h |  2 +-\n 3 files changed, 74 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 0d0723f6596e..e7888be305da 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -174,8 +174,8 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" by masks on port X. size is used to indicate the\"\n \t\t\t\" hardware supported reta size\\n\\n\"\n \n-\t\t\t\"show port (port_id) rss-hash [key]\\n\"\n-\t\t\t\"    Display the RSS hash functions and RSS hash key of port\\n\\n\"\n+\t\t\t\"show port (port_id) rss-hash [key | func | all]\\n\"\n+\t\t\t\"    Display the RSS hash functions, RSS hash key and RSS hash algorithms of port\\n\\n\"\n \n \t\t\t\"clear port (info|stats|xstats|fdir) (port_id|all)\\n\"\n \t\t\t\"    Clear information for port_id, or all.\\n\\n\"\n@@ -3017,15 +3017,21 @@ struct cmd_showport_rss_hash {\n \tcmdline_fixed_string_t rss_hash;\n \tcmdline_fixed_string_t rss_type;\n \tcmdline_fixed_string_t key; /* optional argument */\n+\tcmdline_fixed_string_t func; /* optional argument */\n+\tcmdline_fixed_string_t all; /* optional argument */\n };\n \n static void cmd_showport_rss_hash_parsed(void *parsed_result,\n \t\t\t\t__rte_unused struct cmdline *cl,\n-\t\t\t\tvoid *show_rss_key)\n+\t\t\t\t__rte_unused void *data)\n {\n \tstruct cmd_showport_rss_hash *res = parsed_result;\n \n-\tport_rss_hash_conf_show(res->port_id, show_rss_key != NULL);\n+\tif (!strcmp(res->all, \"all\"))\n+\t\tport_rss_hash_conf_show(res->port_id, true, true);\n+\telse\n+\t\tport_rss_hash_conf_show(res->port_id,\n+\t\t\t!strcmp(res->key, \"key\"), !strcmp(res->func, \"func\"));\n }\n \n static cmdline_parse_token_string_t cmd_showport_rss_hash_show =\n@@ -3040,6 +3046,10 @@ static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_hash =\n \t\t\t\t \"rss-hash\");\n static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_key =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, key, \"key\");\n+static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_func =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, func, \"func\");\n+static cmdline_parse_token_string_t cmd_showport_rss_hash_rss_all =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_showport_rss_hash, all, \"all\");\n \n static cmdline_parse_inst_t cmd_showport_rss_hash = {\n \t.f = cmd_showport_rss_hash_parsed,\n@@ -3056,7 +3066,7 @@ static cmdline_parse_inst_t cmd_showport_rss_hash = {\n \n static cmdline_parse_inst_t cmd_showport_rss_hash_key = {\n \t.f = cmd_showport_rss_hash_parsed,\n-\t.data = (void *)1,\n+\t.data = NULL,\n \t.help_str = \"show port <port_id> rss-hash key\",\n \t.tokens = {\n \t\t(void *)&cmd_showport_rss_hash_show,\n@@ -3068,6 +3078,34 @@ static cmdline_parse_inst_t cmd_showport_rss_hash_key = {\n \t},\n };\n \n+static cmdline_parse_inst_t cmd_showport_rss_hash_func = {\n+\t.f = cmd_showport_rss_hash_parsed,\n+\t.data = NULL,\n+\t.help_str = \"show port <port_id> rss-hash func\",\n+\t.tokens = {\n+\t\t(void *)&cmd_showport_rss_hash_show,\n+\t\t(void *)&cmd_showport_rss_hash_port,\n+\t\t(void *)&cmd_showport_rss_hash_port_id,\n+\t\t(void *)&cmd_showport_rss_hash_rss_hash,\n+\t\t(void *)&cmd_showport_rss_hash_rss_func,\n+\t\tNULL,\n+\t},\n+};\n+\n+static cmdline_parse_inst_t cmd_showport_rss_hash_all = {\n+\t.f = cmd_showport_rss_hash_parsed,\n+\t.data = NULL,\n+\t.help_str = \"show port <port_id> rss-hash all\",\n+\t.tokens = {\n+\t\t(void *)&cmd_showport_rss_hash_show,\n+\t\t(void *)&cmd_showport_rss_hash_port,\n+\t\t(void *)&cmd_showport_rss_hash_port_id,\n+\t\t(void *)&cmd_showport_rss_hash_rss_hash,\n+\t\t(void *)&cmd_showport_rss_hash_rss_all,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** Configure DCB *** */\n struct cmd_config_dcb {\n \tcmdline_fixed_string_t port;\n@@ -12905,6 +12943,8 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,\n \t(cmdline_parse_inst_t *)&cmd_showport_rss_hash,\n \t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,\n+\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_func,\n+\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_all,\n \t(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,\n \t(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,\n \t(cmdline_parse_inst_t *)&cmd_dump,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 11f3a2204839..65eca8467d61 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -1485,6 +1485,27 @@ rss_types_display(uint64_t rss_types, uint16_t char_num_per_line)\n \tprintf(\"\\n\");\n }\n \n+static void rss_algo_display(enum rte_eth_hash_function func)\n+{\n+\tswitch (func) {\n+\tcase RTE_ETH_HASH_FUNCTION_DEFAULT:\n+\t\tprintf(\"default\\n\");\n+\t\tbreak;\n+\tcase RTE_ETH_HASH_FUNCTION_TOEPLITZ:\n+\t\tprintf(\"toeplitz\\n\");\n+\t\tbreak;\n+\tcase RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:\n+\t\tprintf(\"simple_xor\\n\");\n+\t\tbreak;\n+\tcase RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:\n+\t\tprintf(\"symmetric_toeplitz\\n\");\n+\t\tbreak;\n+\tdefault:\n+\t\tprintf(\"Unknown function\\n\");\n+\t\treturn;\n+\t}\n+}\n+\n static void\n rss_config_display(struct rte_flow_action_rss *rss_conf)\n {\n@@ -1504,23 +1525,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)\n \tprintf(\"\\n\");\n \n \tprintf(\" function: \");\n-\tswitch (rss_conf->func) {\n-\tcase RTE_ETH_HASH_FUNCTION_DEFAULT:\n-\t\tprintf(\"default\\n\");\n-\t\tbreak;\n-\tcase RTE_ETH_HASH_FUNCTION_TOEPLITZ:\n-\t\tprintf(\"toeplitz\\n\");\n-\t\tbreak;\n-\tcase RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:\n-\t\tprintf(\"simple_xor\\n\");\n-\t\tbreak;\n-\tcase RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:\n-\t\tprintf(\"symmetric_toeplitz\\n\");\n-\t\tbreak;\n-\tdefault:\n-\t\tprintf(\"Unknown function\\n\");\n-\t\treturn;\n-\t}\n+\trss_algo_display(rss_conf->func);\n \n \tprintf(\" RSS key:\\n\");\n \tif (rss_conf->key_len == 0) {\n@@ -4406,7 +4411,7 @@ port_rss_reta_info(portid_t port_id,\n  * key of the port.\n  */\n void\n-port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n+port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_func)\n {\n \tstruct rte_eth_rss_conf rss_conf = {0};\n \tuint8_t rss_key[RSS_HASH_KEY_LENGTH];\n@@ -4458,6 +4463,11 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n \t}\n \tprintf(\"RSS functions:\\n\");\n \trss_types_display(rss_hf, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);\n+\n+\tif (show_rss_func) {\n+\t\tprintf(\"RSS algorithms:\\n  \");\n+\t\trss_algo_display(rss_conf.func);\n+\t}\n \tif (!show_rss_key)\n \t\treturn;\n \tprintf(\"RSS key:\\n\");\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex f1df6a8fafaa..3dc2f47280ad 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -1146,7 +1146,7 @@ int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate,\n int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,\n \t\t\t uint8_t avail_thresh);\n \n-void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);\n+void port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_func);\n void port_rss_hash_key_update(portid_t port_id, char rss_type[],\n \t\t\t      uint8_t *hash_key, uint8_t hash_key_len);\n int rx_queue_id_is_invalid(queueid_t rxq_id);\n",
    "prefixes": [
        "v3",
        "4/5"
    ]
}