Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/132510/?format=api
http://patchwork.dpdk.org/api/patches/132510/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231011092805.693171-3-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": "<20231011092805.693171-3-haijie1@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231011092805.693171-3-haijie1@huawei.com", "date": "2023-10-11T09:27:27", "name": "[v5,02/40] ethdev: support setting and querying RSS algorithm", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "6da49df08abfe0cf6e73cbc7ff77ead6c6605954", "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/20231011092805.693171-3-haijie1@huawei.com/mbox/", "series": [ { "id": 29816, "url": "http://patchwork.dpdk.org/api/series/29816/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29816", "date": "2023-10-11T09:27:25", "name": "support setting and querying RSS algorithms", "version": 5, "mbox": "http://patchwork.dpdk.org/series/29816/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/132510/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/132510/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 904504235E;\n\tWed, 11 Oct 2023 11:31:53 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9219F40DCE;\n\tWed, 11 Oct 2023 11:31:35 +0200 (CEST)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id A7370402C2\n for <dev@dpdk.org>; Wed, 11 Oct 2023 11:31:30 +0200 (CEST)", "from kwepemi500020.china.huawei.com (unknown [172.30.72.54])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S56sL1VhdzrTPR;\n Wed, 11 Oct 2023 17:28:54 +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; Wed, 11 Oct 2023 17:31:28 +0800" ], "From": "Jie Hai <haijie1@huawei.com>", "To": "<dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit\n <ferruh.yigit@amd.com>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, Ori\n Kam <orika@nvidia.com>", "CC": "<lihuisong@huawei.com>, <fengchengwen@huawei.com>,\n <liudongdong3@huawei.com>", "Subject": "[PATCH v5 02/40] ethdev: support setting and querying RSS algorithm", "Date": "Wed, 11 Oct 2023 17:27:27 +0800", "Message-ID": "<20231011092805.693171-3-haijie1@huawei.com>", "X-Mailer": "git-send-email 2.30.0", "In-Reply-To": "<20231011092805.693171-1-haijie1@huawei.com>", "References": "<20230908080030.3837515-1-haijie1@huawei.com>\n <20231011092805.693171-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": "Currently, rte_eth_rss_conf supports configuring and querying\nRSS hash functions, rss key and it's length, but not RSS hash\nalgorithm.\n\nThe structure ``rte_eth_rss_conf`` is extended by adding a new\nfield \"algorithm\". This represents the RSS algorithms to apply.\nThe following API will be affected:\n\t- rte_eth_dev_configure\n\t- rte_eth_dev_rss_hash_update\n\t- rte_eth_dev_rss_hash_conf_get\n\nIf the value of \"algorithm\" used for configuration is a gibberish\nvalue, report the error and return. Do the same for\nrte_eth_dev_rss_hash_update and rte_eth_dev_configure.\n\nTo check whether the drivers report valid \"algorithm\", it is set\nto default value before querying.\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n doc/guides/rel_notes/release_23_11.rst | 2 ++\n lib/ethdev/rte_ethdev.c | 17 ++++++++++++++++\n lib/ethdev/rte_ethdev.h | 27 +++++++++++++++++++++++++\n lib/ethdev/rte_flow.c | 1 -\n lib/ethdev/rte_flow.h | 28 ++------------------------\n 5 files changed, 48 insertions(+), 27 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst\nindex e13d57728071..92a445ab2ed3 100644\n--- a/doc/guides/rel_notes/release_23_11.rst\n+++ b/doc/guides/rel_notes/release_23_11.rst\n@@ -197,6 +197,8 @@ ABI Changes\n fields, to move ``rxq`` and ``txq`` fields, to change the size of\n ``reserved1`` and ``reserved2`` fields.\n \n+* ethdev: Added \"algorithm\" field to ``rte_eth_rss_conf`` structure for RSS\n+ hash algorithm.\n \n Known Issues\n ------------\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 18a4b950b184..2eda1b8072e5 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \t\tgoto rollback;\n \t}\n \n+\tif (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t\"Ethdev port_id=%u invalid RSS algorithm: 0x%\"PRIx64\"\\n\",\n+\t\t\tport_id, dev_conf->rx_adv_conf.rss_conf.algorithm);\n+\t\tret = -EINVAL;\n+\t\tgoto rollback;\n+\t}\n+\n \t/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */\n \tif (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&\n \t (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {\n@@ -4673,6 +4681,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,\n \t\treturn -ENOTSUP;\n \t}\n \n+\tif (rss_conf->algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t\"Ethdev port_id=%u invalid RSS algorithm: 0x%\"PRIx64\"\\n\",\n+\t\t\tport_id, rss_conf->algorithm);\n+\t\treturn -EINVAL;\n+\t}\n+\n \tif (*dev->dev_ops->rss_hash_update == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,\n@@ -4700,6 +4715,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,\n \t\treturn -EINVAL;\n \t}\n \n+\trss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;\n+\n \tif (*dev->dev_ops->rss_hash_conf_get == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex b9e4e21189d2..42c4250bd509 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -445,6 +445,32 @@ struct rte_vlan_filter_conf {\n \tuint64_t ids[64];\n };\n \n+/**\n+ * Hash function types.\n+ */\n+enum rte_eth_hash_function {\n+\t/**\n+\t * DEFAULT means driver decides which hash algorithm to pick.\n+\t */\n+\tRTE_ETH_HASH_FUNCTION_DEFAULT = 0,\n+\tRTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */\n+\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */\n+\t/**\n+\t * Symmetric Toeplitz: src, dst will be replaced by\n+\t * xor(src, dst). For the case with src/dst only,\n+\t * src or dst address will xor with zero pair.\n+\t */\n+\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,\n+\t/**\n+\t * Symmetric Toeplitz: L3 and L4 fields are sorted prior to\n+\t * the hash function.\n+\t * If src_ip > dst_ip, swap src_ip and dst_ip.\n+\t * If src_port > dst_port, swap src_port and dst_port.\n+\t */\n+\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,\n+\tRTE_ETH_HASH_FUNCTION_MAX,\n+};\n+\n /**\n * A structure used to configure the Receive Side Scaling (RSS) feature\n * of an Ethernet port.\n@@ -465,6 +491,7 @@ struct rte_eth_rss_conf {\n \t * Setting *rss_hf* to zero disables the RSS feature.\n \t */\n \tuint64_t rss_hf;\n+\tenum rte_eth_hash_function algorithm;\t/**< Hash algorithm. */\n };\n \n /*\ndiff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c\nindex ba8bf27090fb..deedce08fb0a 100644\n--- a/lib/ethdev/rte_flow.c\n+++ b/lib/ethdev/rte_flow.c\n@@ -13,7 +13,6 @@\n #include <rte_branch_prediction.h>\n #include <rte_string_fns.h>\n #include <rte_mbuf_dyn.h>\n-#include \"rte_ethdev.h\"\n #include \"rte_flow_driver.h\"\n #include \"rte_flow.h\"\n \ndiff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h\nindex 5d9e3c68af7b..877a2e1d6ad3 100644\n--- a/lib/ethdev/rte_flow.h\n+++ b/lib/ethdev/rte_flow.h\n@@ -40,6 +40,8 @@\n #include <rte_macsec.h>\n #include <rte_ib.h>\n \n+#include \"rte_ethdev.h\"\n+\n #ifdef __cplusplus\n extern \"C\" {\n #endif\n@@ -3223,32 +3225,6 @@ struct rte_flow_query_count {\n \tuint64_t bytes; /**< Number of bytes through this rule [out]. */\n };\n \n-/**\n- * Hash function types.\n- */\n-enum rte_eth_hash_function {\n-\t/**\n-\t * DEFAULT means driver decides which hash algorithm to pick.\n-\t */\n-\tRTE_ETH_HASH_FUNCTION_DEFAULT = 0,\n-\tRTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */\n-\tRTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */\n-\t/**\n-\t * Symmetric Toeplitz: src, dst will be replaced by\n-\t * xor(src, dst). For the case with src/dst only,\n-\t * src or dst address will xor with zero pair.\n-\t */\n-\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,\n-\t/**\n-\t * Symmetric Toeplitz: L3 and L4 fields are sorted prior to\n-\t * the hash function.\n-\t * If src_ip > dst_ip, swap src_ip and dst_ip.\n-\t * If src_port > dst_port, swap src_port and dst_port.\n-\t */\n-\tRTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,\n-\tRTE_ETH_HASH_FUNCTION_MAX,\n-};\n-\n /**\n * RTE_FLOW_ACTION_TYPE_RSS\n *\n", "prefixes": [ "v5", "02/40" ] }{ "id": 132510, "url": "