Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/131136/?format=api
http://patchwork.dpdk.org/api/patches/131136/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230904061044.5692-6-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": "<20230904061044.5692-6-haijie1@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230904061044.5692-6-haijie1@huawei.com", "date": "2023-09-04T06:10:44", "name": "[v3,5/5] app/testpmd: add RSS hash algorithms setting", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ad2b5ae50970e2925aed1aefd8fd37ed6da10000", "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/20230904061044.5692-6-haijie1@huawei.com/mbox/", "series": [ { "id": 29410, "url": "http://patchwork.dpdk.org/api/series/29410/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29410", "date": "2023-09-04T06:10:39", "name": "support setting and querying RSS algorithms", "version": 3, "mbox": "http://patchwork.dpdk.org/series/29410/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/131136/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/131136/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 E5ACC424EC;\n\tMon, 4 Sep 2023 08:14:56 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DE9EF402E2;\n\tMon, 4 Sep 2023 08:14:37 +0200 (CEST)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 3162F402CC\n for <dev@dpdk.org>; Mon, 4 Sep 2023 08:14:34 +0200 (CEST)", "from kwepemi500020.china.huawei.com (unknown [172.30.72.56])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RfJG71jxrzrSDT\n for <dev@dpdk.org>; Mon, 4 Sep 2023 14:12:47 +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:32 +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 5/5] app/testpmd: add RSS hash algorithms setting", "Date": "Mon, 4 Sep 2023 14:10:44 +0800", "Message-ID": "<20230904061044.5692-6-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": "Add command \"port config <port_id> rss-hash-func <func>\" to set RSS\nhash algorithms.\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n app/test-pmd/cmdline.c | 78 ++++++++++++++++++++++++++++++++++++++++--\n app/test-pmd/config.c | 16 ++++-----\n app/test-pmd/testpmd.h | 3 +-\n 3 files changed, 84 insertions(+), 13 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex e7888be305da..375f16fcee14 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -2136,6 +2136,76 @@ static cmdline_parse_inst_t cmd_config_rss = {\n \t},\n };\n \n+/* *** configure rss hash algorithms *** */\n+struct cmd_config_rss_hash_func {\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t config;\n+\tportid_t port_id;\n+\tcmdline_fixed_string_t rss_hash_func;\n+\tcmdline_fixed_string_t func;\n+};\n+\n+static void\n+cmd_config_rss_hash_func_parsed(void *parsed_result,\n+\t\t\t __rte_unused struct cmdline *cl,\n+\t\t\t __rte_unused void *data)\n+{\n+\tstruct cmd_config_rss_hash_func *res = parsed_result;\n+\tstruct rte_eth_rss_conf rss_conf = {0};\n+\tstruct {\n+\t\tconst char *name;\n+\t\tenum rte_eth_hash_function func;\n+\t} hash_func_map[] = {\n+\t\t{\"default\",\t\tRTE_ETH_HASH_FUNCTION_DEFAULT},\n+\t\t{\"toeplitz\",\t\tRTE_ETH_HASH_FUNCTION_TOEPLITZ},\n+\t\t{\"simple_xor\",\t\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR},\n+\t\t{\"symmetric_toeplitz\",\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ},\n+\t\t{NULL,\t\t\tRTE_ETH_HASH_FUNCTION_MAX},\n+\t};\n+\tint i = 0;\n+\n+\trss_conf.func = RTE_ETH_HASH_FUNCTION_MAX;\n+\twhile (hash_func_map[i].name != NULL) {\n+\t\tif (!strcmp(hash_func_map[i].name, res->func)) {\n+\t\t\trss_conf.func = hash_func_map[i].func;\n+\t\t\tbreak;\n+\t\t}\n+\t\ti++;\n+\t}\n+\n+\tport_rss_hash_key_update(res->port_id, &rss_conf);\n+}\n+\n+static cmdline_parse_token_string_t cmd_config_rss_hash_func_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_func, port, \"port\");\n+static cmdline_parse_token_string_t cmd_config_rss_hash_func_config =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_func, config,\n+\t\t\t\t \"config\");\n+static cmdline_parse_token_num_t cmd_config_rss_hash_func_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_func, port_id,\n+\t\t\t\t RTE_UINT16);\n+static cmdline_parse_token_string_t cmd_config_rss_hash_func_rss_hash_func =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_func,\n+\t\t\t\t rss_hash_func, \"rss-hash-func\");\n+static cmdline_parse_token_string_t cmd_config_rss_hash_func_value =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_func, func,\n+\t\t\t\t\"default#toeplitz#simple_xor#symmetric_toeplitz\");\n+\n+static cmdline_parse_inst_t cmd_config_rss_hash_func = {\n+\t.f = cmd_config_rss_hash_func_parsed,\n+\t.data = NULL,\n+\t.help_str = \"port config <port_id> rss-hash-func\"\n+\t\t\"default|toeplitz|simple_xor|symmetric_toeplitz\",\n+\t.tokens = {\n+\t\t(void *)&cmd_config_rss_hash_func_port,\n+\t\t(void *)&cmd_config_rss_hash_func_config,\n+\t\t(void *)&cmd_config_rss_hash_func_port_id,\n+\t\t(void *)&cmd_config_rss_hash_func_rss_hash_func,\n+\t\t(void *)&cmd_config_rss_hash_func_value,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** configure rss hash key *** */\n struct cmd_config_rss_hash_key {\n \tcmdline_fixed_string_t port;\n@@ -2182,6 +2252,7 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,\n \tuint8_t xdgt0;\n \tuint8_t xdgt1;\n \tint i;\n+\tstruct rte_eth_rss_conf rss_conf = {0};\n \tstruct rte_eth_dev_info dev_info;\n \tuint8_t hash_key_size;\n \tuint32_t key_len;\n@@ -2217,8 +2288,10 @@ cmd_config_rss_hash_key_parsed(void *parsed_result,\n \t\t\treturn;\n \t\thash_key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);\n \t}\n-\tport_rss_hash_key_update(res->port_id, res->rss_type, hash_key,\n-\t\t\thash_key_size);\n+\trss_conf.rss_key = hash_key;\n+\trss_conf.rss_key_len = hash_key_size;\n+\trss_conf.rss_hf = str_to_rsstypes(res->rss_type);\n+\tport_rss_hash_key_update(res->port_id, &rss_conf);\n }\n \n static cmdline_parse_token_string_t cmd_config_rss_hash_key_port =\n@@ -12946,6 +13019,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\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_config_rss_hash_func,\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/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 65eca8467d61..2f27642c31d2 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -4477,21 +4477,19 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key, int show_rss_func)\n }\n \n void\n-port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,\n-\t\t\t uint8_t hash_key_len)\n+port_rss_hash_key_update(portid_t port_id, struct rte_eth_rss_conf *conf)\n {\n-\tstruct rte_eth_rss_conf rss_conf;\n+\tstruct rte_eth_rss_conf rss_conf = {0};\n \tint diag;\n \n-\trss_conf.rss_key = NULL;\n-\trss_conf.rss_key_len = 0;\n-\trss_conf.rss_hf = str_to_rsstypes(rss_type);\n \tdiag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);\n \tif (diag == 0) {\n-\t\trss_conf.rss_key = hash_key;\n-\t\trss_conf.rss_key_len = hash_key_len;\n-\t\tdiag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);\n+\t\tconf->rss_key = conf->rss_key == NULL ? rss_conf.rss_key : conf->rss_key;\n+\t\tconf->rss_key_len = conf->rss_key_len == 0 ? rss_conf.rss_key_len : conf->rss_key_len;\n+\t\tconf->rss_hf = conf->rss_hf == 0 ? rss_conf.rss_hf : conf->rss_hf;\n+\t\tdiag = rte_eth_dev_rss_hash_update(port_id, conf);\n \t}\n+\n \tif (diag == 0)\n \t\treturn;\n \ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 3dc2f47280ad..8ec7fd39e586 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -1147,8 +1147,7 @@ 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, 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+void port_rss_hash_key_update(portid_t port_id, struct rte_eth_rss_conf *rss_conf);\n int rx_queue_id_is_invalid(queueid_t rxq_id);\n int tx_queue_id_is_invalid(queueid_t txq_id);\n #ifdef RTE_LIB_GRO\n", "prefixes": [ "v3", "5/5" ] }{ "id": 131136, "url": "