get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134734,
    "url": "https://patches.dpdk.org/api/patches/134734/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231130104415.1064644-3-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": "<20231130104415.1064644-3-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231130104415.1064644-3-haijie1@huawei.com",
    "date": "2023-11-30T10:44:15",
    "name": "[RESEND,2/2] app/testpmd: support set RSS hash algorithm",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "af0cf6828f30380f4e8560d6a6a7d6745a3095ed",
    "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/20231130104415.1064644-3-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 30423,
            "url": "https://patches.dpdk.org/api/series/30423/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30423",
            "date": "2023-11-30T10:44:13",
            "name": "app/testpmd: support set RSS hash algorithm",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/30423/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/134734/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/134734/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 447734340F;\n\tThu, 30 Nov 2023 11:48:14 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C034B42ED0;\n\tThu, 30 Nov 2023 11:48:05 +0100 (CET)",
            "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id 0CA5942E97\n for <dev@dpdk.org>; Thu, 30 Nov 2023 11:48:02 +0100 (CET)",
            "from kwepemd100004.china.huawei.com (unknown [172.30.72.54])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Sgt9J2wRwz1P8yr;\n Thu, 30 Nov 2023 18:44:20 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) by\n kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.1258.28; Thu, 30 Nov 2023 18:47:59 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>, <dev@dpdk.org>,\n <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<fengchengwen@huawei.com>, <lihuisong@huawei.com>",
        "Subject": "[RESEND 2/2] app/testpmd: support set RSS hash algorithm",
        "Date": "Thu, 30 Nov 2023 18:44:15 +0800",
        "Message-ID": "<20231130104415.1064644-3-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20231130104415.1064644-1-haijie1@huawei.com>",
        "References": "<20231122094900.788126-1-haijie1@huawei.com>\n <20231130104415.1064644-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": "dggems702-chm.china.huawei.com (10.3.19.179) To\n kwepemd100004.china.huawei.com (7.221.188.31)",
        "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": "Since API rte_eth_dev_rss_hash_update() supports setting RSS hash\nalgorithm, add new command to support it:\n\ntestpmd> port config 0 rss-hash-algo symmetric_toeplitz\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\nReviewed-by: Huisong Li <lihuisong@huawei.com>\n---\n app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++\n 2 files changed, 90 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 9369d3b4c526..2cd85c918a09 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -726,6 +726,10 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"port config port-id rss reta (hash,queue)[,(hash,queue)]\\n\"\n \t\t\t\"    Set the RSS redirection table.\\n\\n\"\n \n+\t\t\t\"port config port-id rss-hash-algo (default|simple_xor|toeplitz|\"\n+\t\t\t\"symmetric_toeplitz|symmetric_toeplitz_sort)\\n\"\n+\t\t\t\"    Set the RSS hash algorithm.\\n\\n\"\n+\n \t\t\t\"port config (port_id) dcb vt (on|off) (traffic_class)\"\n \t\t\t\" pfc (on|off)\\n\"\n \t\t\t\"    Set the DCB mode.\\n\\n\"\n@@ -2275,6 +2279,80 @@ static cmdline_parse_inst_t cmd_config_rss_hash_key = {\n \t},\n };\n \n+/* *** configure rss hash algorithm *** */\n+struct cmd_config_rss_hash_algo {\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t config;\n+\tportid_t port_id;\n+\tcmdline_fixed_string_t rss_hash_algo;\n+\tcmdline_fixed_string_t algo;\n+};\n+\n+static void\n+cmd_config_rss_hash_algo_parsed(void *parsed_result,\n+\t\t\t\t__rte_unused struct cmdline *cl,\n+\t\t\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_config_rss_hash_algo *res = parsed_result;\n+\tuint8_t rss_key[RSS_HASH_KEY_LENGTH];\n+\tstruct rte_eth_rss_conf rss_conf;\n+\tint ret;\n+\n+\trss_conf.rss_key_len = RSS_HASH_KEY_LENGTH;\n+\trss_conf.rss_key = rss_key;\n+\tret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf);\n+\tif (ret != 0) {\n+\t\tfprintf(stderr, \"failed to get port %u RSS confinguration\\n\",\n+\t\t\tres->port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_eth_find_rss_algo(res->algo, &rss_conf.algorithm);\n+\tif (ret != 0) {\n+\t\tfprintf(stderr, \"port %u configured invalid RSS hash algorithm: %s\\n\",\n+\t\t\tres->port_id, res->algo);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_eth_dev_rss_hash_update(res->port_id, &rss_conf);\n+\tif (ret != 0) {\n+\t\tfprintf(stderr, \"failed to set port %u RSS hash algorithm\\n\",\n+\t\t\tres->port_id);\n+\t\treturn;\n+\t}\n+}\n+\n+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, port, \"port\");\n+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_config =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, config,\n+\t\t\t\t \"config\");\n+static cmdline_parse_token_num_t cmd_config_rss_hash_algo_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_algo, port_id,\n+\t\t\t      RTE_UINT16);\n+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_rss_hash_algo =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo,\n+\t\t\t\t rss_hash_algo, \"rss-hash-algo\");\n+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_algo =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, algo,\n+\t\t\t\t \"default#simple_xor#toeplitz#\"\n+\t\t\t\t \"symmetric_toeplitz#symmetric_toeplitz_sort\");\n+\n+static cmdline_parse_inst_t cmd_config_rss_hash_algo = {\n+\t.f = cmd_config_rss_hash_algo_parsed,\n+\t.data = NULL,\n+\t.help_str = \"port config <port_id> rss-hash-algo \"\n+\t\t\"(default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort)\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_rss_hash_algo_port,\n+\t\t(void *)&cmd_config_rss_hash_algo_config,\n+\t\t(void *)&cmd_config_rss_hash_algo_port_id,\n+\t\t(void *)&cmd_config_rss_hash_algo_rss_hash_algo,\n+\t\t(void *)&cmd_config_rss_hash_algo_algo,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** cleanup txq mbufs *** */\n struct cmd_cleanup_txq_mbufs_result {\n \tcmdline_fixed_string_t port;\n@@ -13165,6 +13243,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,\n \t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,\n \t(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,\n+\t(cmdline_parse_inst_t *)&cmd_config_rss_hash_algo,\n \t(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,\n \t(cmdline_parse_inst_t *)&cmd_dump,\n \t(cmdline_parse_inst_t *)&cmd_dump_one,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 447e28e6944f..3c7d20c2db82 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -2263,6 +2263,17 @@ hash of input [IP] packets received on port::\n                      ipv6-udp-ex <string of hex digits \\\n                      (variable length, NIC dependent)>)\n \n+\n+port config rss hash algorithm\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+To configure the RSS hash algorithm used to compute the RSS\n+hash of input packets received on port::\n+\n+   testpmd> port config <port_id> rss-hash-algo (default|\\\n+                     simple_xor|toeplitz|symmetric_toeplitz|\\\n+                     symmetric_toeplitz_sort)\n+\n port cleanup txq mbufs\n ~~~~~~~~~~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "RESEND",
        "2/2"
    ]
}