get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131259,
    "url": "http://patchwork.dpdk.org/api/patches/131259/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230908080030.3837515-8-haijie1@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": "<20230908080030.3837515-8-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230908080030.3837515-8-haijie1@huawei.com",
    "date": "2023-09-08T08:00:29",
    "name": "[v4,7/7] app/testpmd: add RSS hash algorithms display",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "72daa5aa108e9233086ef097b914ce4feeeb59c9",
    "submitter": {
        "id": 2935,
        "url": "http://patchwork.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@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/20230908080030.3837515-8-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 29457,
            "url": "http://patchwork.dpdk.org/api/series/29457/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29457",
            "date": "2023-09-08T08:00:22",
            "name": "support setting and querying RSS algorithms",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/29457/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/131259/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/131259/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 3FC3B42544;\n\tFri,  8 Sep 2023 10:04:20 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9D37C406FF;\n\tFri,  8 Sep 2023 10:03:49 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 0ACB0402E8\n for <dev@dpdk.org>; Fri,  8 Sep 2023 10:03:44 +0200 (CEST)",
            "from kwepemi500020.china.huawei.com (unknown [172.30.72.55])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RhpV8103nzrSX5\n for <dev@dpdk.org>; Fri,  8 Sep 2023 16:01:52 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) 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; Fri, 8 Sep 2023 16:03:42 +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 v4 7/7] app/testpmd: add RSS hash algorithms display",
        "Date": "Fri, 8 Sep 2023 16:00:29 +0800",
        "Message-ID": "<20230908080030.3837515-8-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20230908080030.3837515-1-haijie1@huawei.com>",
        "References": "<20230904072851.7384-1-haijie1@huawei.com>\n <20230908080030.3837515-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.2]",
        "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) 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": "Add the command \"show port X rss-hash func\" to display the RSS hash\nalgorithms of port X. An example is shown:\n\ntestpmd> show port 0 rss-hash func\nRSS algorithms:\n  toeplitz\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n app/test-pmd/cmdline.c | 29 ++++++++++++++++++++++++-----\n app/test-pmd/config.c  | 36 +++++++++++++++++-------------------\n app/test-pmd/testpmd.h |  2 +-\n 3 files changed, 42 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 0d0723f6596e..91bb5ac3c091 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]\\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,17 @@ 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 };\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+\tport_rss_hash_conf_show(res->port_id,\n+\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 +3042,8 @@ 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 \n static cmdline_parse_inst_t cmd_showport_rss_hash = {\n \t.f = cmd_showport_rss_hash_parsed,\n@@ -3056,7 +3060,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 +3072,20 @@ 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 /* *** Configure DCB *** */\n struct cmd_config_dcb {\n \tcmdline_fixed_string_t port;\n@@ -12905,6 +12923,7 @@ 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_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..1af55185d2b2 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -1485,6 +1485,14 @@ rss_types_display(uint64_t rss_types, uint16_t char_num_per_line)\n \tprintf(\"\\n\");\n }\n \n+static const char * const rss_hash_algos[] = {\n+\t[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = \"simple_xor\",\n+\t[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = \"toeplitz\",\n+\t[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = \"symmetric_toeplitz\",\n+\t[RTE_ETH_HASH_FUNCTION_DEFAULT] = \"default\",\n+\t[RTE_ETH_HASH_FUNCTION_MAX] = \"Unknown function\"\n+};\n+\n static void\n rss_config_display(struct rte_flow_action_rss *rss_conf)\n {\n@@ -1503,24 +1511,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)\n \t\tprintf(\" %d\", rss_conf->queue[i]);\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+\tprintf(\" function: %s\\n\", rss_hash_algos[rss_conf->func]);\n \n \tprintf(\" RSS key:\\n\");\n \tif (rss_conf->key_len == 0) {\n@@ -4406,7 +4397,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@@ -4456,8 +4447,15 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)\n \t\tprintf(\"RSS disabled\\n\");\n \t\treturn;\n \t}\n+\n+\tif (show_rss_func) {\n+\t\tprintf(\"RSS algorithms:\\n  %s\\n\", rss_hash_algos[rss_conf.func]);\n+\t\treturn;\n+\t}\n+\n \tprintf(\"RSS functions:\\n\");\n \trss_types_display(rss_hf, TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);\n+\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": [
        "v4",
        "7/7"
    ]
}