DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] app/testpmd: support set RSS hash algorithm
@ 2023-11-22  9:48 Jie Hai
  2023-11-22  9:48 ` [PATCH 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-22  9:48 UTC (permalink / raw)
  To: dev; +Cc: lihuisong, fengchengwen, liudongdong3, haijie1

This patch set supports setting RSS hash algorithm.

Jie Hai (2):
  ethdev: add new API to get RSS hash algorithm by name
  app/testpmd: support set RSS hash algorithm

 app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
 doc/guides/rel_notes/release_23_11.rst      |  3 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 lib/ethdev/rte_ethdev.c                     | 15 ++++
 lib/ethdev/rte_ethdev.h                     | 20 ++++++
 lib/ethdev/version.map                      |  1 +
 6 files changed, 129 insertions(+)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/2] ethdev: add new API to get RSS hash algorithm by name
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
@ 2023-11-22  9:48 ` Jie Hai
  2023-11-22  9:48 ` [PATCH 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-22  9:48 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: lihuisong, fengchengwen, liudongdong3, haijie1

This patch supports conversion from names to hash algorithms(see
RTE_ETH_HASH_FUNCTION_XXX).

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  3 +++
 lib/ethdev/rte_ethdev.c                | 15 +++++++++++++++
 lib/ethdev/rte_ethdev.h                | 20 ++++++++++++++++++++
 lib/ethdev/version.map                 |  1 +
 4 files changed, 39 insertions(+)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 520321c71e9c..b157fb9d307e 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -124,6 +124,9 @@ New Features
   * Added new function ``rte_eth_dev_rss_algo_name``
     to get name of RSS hash algorithm.
 
+  * Added new function ``rte_eth_find_rss_algo``
+    to get RSS hash algorithm by its name.
+
 * **Added packet type flow matching criteria.**
 
   Added ``RTE_FLOW_ITEM_TYPE_PTYPE`` to allow matching on L2/L3/L4
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 3858983fcc80..c0398d945502 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4826,6 +4826,21 @@ rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo)
 	return name;
 }
 
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo)
+{
+	unsigned int i;
+
+	for (i = 0; i < RTE_DIM(rte_eth_dev_rss_algo_names); i++) {
+		if (strcmp(name, rte_eth_dev_rss_algo_names[i].name) == 0) {
+			*algo = rte_eth_dev_rss_algo_names[i].algo;
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
 int
 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
 				struct rte_eth_udp_tunnel *udp_tunnel)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 77331ce6525e..3bde5c4c17a6 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4667,6 +4667,26 @@ __rte_experimental
 const char *
 rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
+ *
+ *  Get RSS hash algorithm by its name.
+ *
+ * @param name
+ *   RSS hash algorithm.
+ *
+ * @param algo
+ *   return the RSS hash algorithm found, @see rte_eth_hash_function.
+ *
+ * @return
+ *   - (0) if successful.
+ *   - (-EINVAL) if not found.
+ */
+__rte_experimental
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo);
+
 /**
  * Add UDP tunneling port for a type of tunnel.
  *
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 5c4917c020dc..d585c12c0110 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -313,6 +313,7 @@ EXPERIMENTAL {
 
 	# added in 23.11
 	rte_eth_dev_rss_algo_name;
+	rte_eth_find_rss_algo;
 	rte_eth_recycle_rx_queue_info_get;
 	rte_flow_group_set_miss_actions;
 	rte_flow_calc_table_hash;
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/2] app/testpmd: support set RSS hash algorithm
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
  2023-11-22  9:48 ` [PATCH 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
@ 2023-11-22  9:48 ` Jie Hai
  2023-11-22 10:46 ` [PATCH 0/2] " Ferruh Yigit
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-22  9:48 UTC (permalink / raw)
  To: dev, Aman Singh, Yuying Zhang
  Cc: lihuisong, fengchengwen, liudongdong3, haijie1

Since API rte_eth_dev_rss_hash_update() supports setting RSS hash
algorithm, add new command to support it:

testpmd> port config 0 rss-hash-algo symmetric_toeplitz

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 2 files changed, 90 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9369d3b4c526..2cd85c918a09 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -726,6 +726,10 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
 			"    Set the RSS redirection table.\n\n"
 
+			"port config port-id rss-hash-algo (default|simple_xor|toeplitz|"
+			"symmetric_toeplitz|symmetric_toeplitz_sort)\n"
+			"    Set the RSS hash algorithm.\n\n"
+
 			"port config (port_id) dcb vt (on|off) (traffic_class)"
 			" pfc (on|off)\n"
 			"    Set the DCB mode.\n\n"
@@ -2275,6 +2279,80 @@ static cmdline_parse_inst_t cmd_config_rss_hash_key = {
 	},
 };
 
+/* *** configure rss hash algorithm *** */
+struct cmd_config_rss_hash_algo {
+	cmdline_fixed_string_t port;
+	cmdline_fixed_string_t config;
+	portid_t port_id;
+	cmdline_fixed_string_t rss_hash_algo;
+	cmdline_fixed_string_t algo;
+};
+
+static void
+cmd_config_rss_hash_algo_parsed(void *parsed_result,
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
+{
+	struct cmd_config_rss_hash_algo *res = parsed_result;
+	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
+	struct rte_eth_rss_conf rss_conf;
+	int ret;
+
+	rss_conf.rss_key_len = RSS_HASH_KEY_LENGTH;
+	rss_conf.rss_key = rss_key;
+	ret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to get port %u RSS confinguration\n",
+			res->port_id);
+		return;
+	}
+
+	ret = rte_eth_find_rss_algo(res->algo, &rss_conf.algorithm);
+	if (ret != 0) {
+		fprintf(stderr, "port %u configured invalid RSS hash algorithm: %s\n",
+			res->port_id, res->algo);
+		return;
+	}
+
+	ret = rte_eth_dev_rss_hash_update(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to set port %u RSS hash algorithm\n",
+			res->port_id);
+		return;
+	}
+}
+
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, port, "port");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_config =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, config,
+				 "config");
+static cmdline_parse_token_num_t cmd_config_rss_hash_algo_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_algo, port_id,
+			      RTE_UINT16);
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_rss_hash_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo,
+				 rss_hash_algo, "rss-hash-algo");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, algo,
+				 "default#simple_xor#toeplitz#"
+				 "symmetric_toeplitz#symmetric_toeplitz_sort");
+
+static cmdline_parse_inst_t cmd_config_rss_hash_algo = {
+	.f = cmd_config_rss_hash_algo_parsed,
+	.data = NULL,
+	.help_str = "port config <port_id> rss-hash-algo "
+		"(default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort)",
+	.tokens = {
+		(void *)&cmd_config_rss_hash_algo_port,
+		(void *)&cmd_config_rss_hash_algo_config,
+		(void *)&cmd_config_rss_hash_algo_port_id,
+		(void *)&cmd_config_rss_hash_algo_rss_hash_algo,
+		(void *)&cmd_config_rss_hash_algo_algo,
+		NULL,
+	},
+};
+
 /* *** cleanup txq mbufs *** */
 struct cmd_cleanup_txq_mbufs_result {
 	cmdline_fixed_string_t port;
@@ -13165,6 +13243,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
+	(cmdline_parse_inst_t *)&cmd_config_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
 	(cmdline_parse_inst_t *)&cmd_dump,
 	(cmdline_parse_inst_t *)&cmd_dump_one,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 447e28e6944f..3c7d20c2db82 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2263,6 +2263,17 @@ hash of input [IP] packets received on port::
                      ipv6-udp-ex <string of hex digits \
                      (variable length, NIC dependent)>)
 
+
+port config rss hash algorithm
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To configure the RSS hash algorithm used to compute the RSS
+hash of input packets received on port::
+
+   testpmd> port config <port_id> rss-hash-algo (default|\
+                     simple_xor|toeplitz|symmetric_toeplitz|\
+                     symmetric_toeplitz_sort)
+
 port cleanup txq mbufs
 ~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
  2023-11-22  9:48 ` [PATCH 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
  2023-11-22  9:48 ` [PATCH 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
@ 2023-11-22 10:46 ` Ferruh Yigit
  2023-11-23  6:32   ` Jie Hai
  2023-11-30  9:02 ` Ferruh Yigit
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Ferruh Yigit @ 2023-11-22 10:46 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 11/22/2023 9:48 AM, Jie Hai wrote:
> This patch set supports setting RSS hash algorithm.
> 
> Jie Hai (2):
>   ethdev: add new API to get RSS hash algorithm by name
>   app/testpmd: support set RSS hash algorithm
> 

Hi Jie,

It is too late for the current release, can you please rebase it on
v24.03-rc0 when it is out and send again?

Thanks,
ferruh


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-22 10:46 ` [PATCH 0/2] " Ferruh Yigit
@ 2023-11-23  6:32   ` Jie Hai
  0 siblings, 0 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-23  6:32 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 2023/11/22 18:46, Ferruh Yigit wrote:
> On 11/22/2023 9:48 AM, Jie Hai wrote:
>> This patch set supports setting RSS hash algorithm.
>>
>> Jie Hai (2):
>>    ethdev: add new API to get RSS hash algorithm by name
>>    app/testpmd: support set RSS hash algorithm
>>
> 
> Hi Jie,
> 
Hi, ferruh,
> It is too late for the current release, can you please rebase it on
> v24.03-rc0 when it is out and send again?
Thanks and I will wait and send again.
> 
> Thanks,
> ferruh
> 

Thanks,
Jie Hai
> .

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
                   ` (2 preceding siblings ...)
  2023-11-22 10:46 ` [PATCH 0/2] " Ferruh Yigit
@ 2023-11-30  9:02 ` Ferruh Yigit
  2023-11-30 10:01   ` Jie Hai
  2023-11-30 10:44 ` [RESEND " Jie Hai
  2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
  5 siblings, 1 reply; 18+ messages in thread
From: Ferruh Yigit @ 2023-11-30  9:02 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 11/22/2023 9:48 AM, Jie Hai wrote:
> This patch set supports setting RSS hash algorithm.
> 
> Jie Hai (2):
>   ethdev: add new API to get RSS hash algorithm by name
>   app/testpmd: support set RSS hash algorithm
> 
>  app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
>  doc/guides/rel_notes/release_23_11.rst      |  3 +
>

Hi Jie,

Can you rebase the patchset to new release please?

>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
>  lib/ethdev/rte_ethdev.c                     | 15 ++++
>  lib/ethdev/rte_ethdev.h                     | 20 ++++++
>  lib/ethdev/version.map                      |  1 +
>  6 files changed, 129 insertions(+)
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-30  9:02 ` Ferruh Yigit
@ 2023-11-30 10:01   ` Jie Hai
  0 siblings, 0 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-30 10:01 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 2023/11/30 17:02, Ferruh Yigit wrote:
> On 11/22/2023 9:48 AM, Jie Hai wrote:
>> This patch set supports setting RSS hash algorithm.
>>
>> Jie Hai (2):
>>    ethdev: add new API to get RSS hash algorithm by name
>>    app/testpmd: support set RSS hash algorithm
>>
>>   app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
>>   doc/guides/rel_notes/release_23_11.rst      |  3 +
>>
> 
> Hi Jie,
> 
> Can you rebase the patchset to new release please?
> 
Hi, Ferruh,

Thanks, I will do it as soon as possible.

Thanks,
Jie Hai
>>   doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
>>   lib/ethdev/rte_ethdev.c                     | 15 ++++
>>   lib/ethdev/rte_ethdev.h                     | 20 ++++++
>>   lib/ethdev/version.map                      |  1 +
>>   6 files changed, 129 insertions(+)
>>
> 
> .

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RESEND 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
                   ` (3 preceding siblings ...)
  2023-11-30  9:02 ` Ferruh Yigit
@ 2023-11-30 10:44 ` Jie Hai
  2023-11-30 10:44   ` [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
  2023-11-30 10:44   ` [RESEND 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
  2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
  5 siblings, 2 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-30 10:44 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

This patch set supports setting RSS hash algorithm.

Jie Hai (2):
  ethdev: add new API to get RSS hash algorithm by name
  app/testpmd: support set RSS hash algorithm

 app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
 doc/guides/rel_notes/release_24_03.rst      |  5 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 lib/ethdev/rte_ethdev.c                     | 15 ++++
 lib/ethdev/rte_ethdev.h                     | 20 ++++++
 lib/ethdev/version.map                      |  3 +
 6 files changed, 133 insertions(+)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name
  2023-11-30 10:44 ` [RESEND " Jie Hai
@ 2023-11-30 10:44   ` Jie Hai
  2023-11-30 11:23     ` Ferruh Yigit
  2023-11-30 10:44   ` [RESEND 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
  1 sibling, 1 reply; 18+ messages in thread
From: Jie Hai @ 2023-11-30 10:44 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

This patch supports conversion from names to hash algorithm
(see RTE_ETH_HASH_FUNCTION_XXX).

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
---
 doc/guides/rel_notes/release_24_03.rst |  5 +++++
 lib/ethdev/rte_ethdev.c                | 15 +++++++++++++++
 lib/ethdev/rte_ethdev.h                | 20 ++++++++++++++++++++
 lib/ethdev/version.map                 |  3 +++
 4 files changed, 43 insertions(+)

diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index e9c9717706a0..bd84875d4f17 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Improved support of RSS hash algorithm.**
+
+  * Added new function ``rte_eth_find_rss_algo`` to get RSS hash
+    algorithm by its name.
+
 
 Removed Items
 -------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 3858983fcc80..c0398d945502 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4826,6 +4826,21 @@ rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo)
 	return name;
 }
 
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo)
+{
+	unsigned int i;
+
+	for (i = 0; i < RTE_DIM(rte_eth_dev_rss_algo_names); i++) {
+		if (strcmp(name, rte_eth_dev_rss_algo_names[i].name) == 0) {
+			*algo = rte_eth_dev_rss_algo_names[i].algo;
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
 int
 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
 				struct rte_eth_udp_tunnel *udp_tunnel)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 77331ce6525e..3bde5c4c17a6 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4667,6 +4667,26 @@ __rte_experimental
 const char *
 rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
+ *
+ *  Get RSS hash algorithm by its name.
+ *
+ * @param name
+ *   RSS hash algorithm.
+ *
+ * @param algo
+ *   return the RSS hash algorithm found, @see rte_eth_hash_function.
+ *
+ * @return
+ *   - (0) if successful.
+ *   - (-EINVAL) if not found.
+ */
+__rte_experimental
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo);
+
 /**
  * Add UDP tunneling port for a type of tunnel.
  *
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 5c4917c020dc..a050baab0fe7 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -316,6 +316,9 @@ EXPERIMENTAL {
 	rte_eth_recycle_rx_queue_info_get;
 	rte_flow_group_set_miss_actions;
 	rte_flow_calc_table_hash;
+
+	# added in 24.03
+	rte_eth_find_rss_algo;
 };
 
 INTERNAL {
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RESEND 2/2] app/testpmd: support set RSS hash algorithm
  2023-11-30 10:44 ` [RESEND " Jie Hai
  2023-11-30 10:44   ` [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
@ 2023-11-30 10:44   ` Jie Hai
  2023-11-30 11:37     ` Ferruh Yigit
  2023-11-30 11:38     ` Ferruh Yigit
  1 sibling, 2 replies; 18+ messages in thread
From: Jie Hai @ 2023-11-30 10:44 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

Since API rte_eth_dev_rss_hash_update() supports setting RSS hash
algorithm, add new command to support it:

testpmd> port config 0 rss-hash-algo symmetric_toeplitz

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 2 files changed, 90 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9369d3b4c526..2cd85c918a09 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -726,6 +726,10 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
 			"    Set the RSS redirection table.\n\n"
 
+			"port config port-id rss-hash-algo (default|simple_xor|toeplitz|"
+			"symmetric_toeplitz|symmetric_toeplitz_sort)\n"
+			"    Set the RSS hash algorithm.\n\n"
+
 			"port config (port_id) dcb vt (on|off) (traffic_class)"
 			" pfc (on|off)\n"
 			"    Set the DCB mode.\n\n"
@@ -2275,6 +2279,80 @@ static cmdline_parse_inst_t cmd_config_rss_hash_key = {
 	},
 };
 
+/* *** configure rss hash algorithm *** */
+struct cmd_config_rss_hash_algo {
+	cmdline_fixed_string_t port;
+	cmdline_fixed_string_t config;
+	portid_t port_id;
+	cmdline_fixed_string_t rss_hash_algo;
+	cmdline_fixed_string_t algo;
+};
+
+static void
+cmd_config_rss_hash_algo_parsed(void *parsed_result,
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
+{
+	struct cmd_config_rss_hash_algo *res = parsed_result;
+	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
+	struct rte_eth_rss_conf rss_conf;
+	int ret;
+
+	rss_conf.rss_key_len = RSS_HASH_KEY_LENGTH;
+	rss_conf.rss_key = rss_key;
+	ret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to get port %u RSS confinguration\n",
+			res->port_id);
+		return;
+	}
+
+	ret = rte_eth_find_rss_algo(res->algo, &rss_conf.algorithm);
+	if (ret != 0) {
+		fprintf(stderr, "port %u configured invalid RSS hash algorithm: %s\n",
+			res->port_id, res->algo);
+		return;
+	}
+
+	ret = rte_eth_dev_rss_hash_update(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to set port %u RSS hash algorithm\n",
+			res->port_id);
+		return;
+	}
+}
+
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, port, "port");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_config =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, config,
+				 "config");
+static cmdline_parse_token_num_t cmd_config_rss_hash_algo_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_algo, port_id,
+			      RTE_UINT16);
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_rss_hash_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo,
+				 rss_hash_algo, "rss-hash-algo");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, algo,
+				 "default#simple_xor#toeplitz#"
+				 "symmetric_toeplitz#symmetric_toeplitz_sort");
+
+static cmdline_parse_inst_t cmd_config_rss_hash_algo = {
+	.f = cmd_config_rss_hash_algo_parsed,
+	.data = NULL,
+	.help_str = "port config <port_id> rss-hash-algo "
+		"(default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort)",
+	.tokens = {
+		(void *)&cmd_config_rss_hash_algo_port,
+		(void *)&cmd_config_rss_hash_algo_config,
+		(void *)&cmd_config_rss_hash_algo_port_id,
+		(void *)&cmd_config_rss_hash_algo_rss_hash_algo,
+		(void *)&cmd_config_rss_hash_algo_algo,
+		NULL,
+	},
+};
+
 /* *** cleanup txq mbufs *** */
 struct cmd_cleanup_txq_mbufs_result {
 	cmdline_fixed_string_t port;
@@ -13165,6 +13243,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
+	(cmdline_parse_inst_t *)&cmd_config_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
 	(cmdline_parse_inst_t *)&cmd_dump,
 	(cmdline_parse_inst_t *)&cmd_dump_one,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 447e28e6944f..3c7d20c2db82 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2263,6 +2263,17 @@ hash of input [IP] packets received on port::
                      ipv6-udp-ex <string of hex digits \
                      (variable length, NIC dependent)>)
 
+
+port config rss hash algorithm
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To configure the RSS hash algorithm used to compute the RSS
+hash of input packets received on port::
+
+   testpmd> port config <port_id> rss-hash-algo (default|\
+                     simple_xor|toeplitz|symmetric_toeplitz|\
+                     symmetric_toeplitz_sort)
+
 port cleanup txq mbufs
 ~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name
  2023-11-30 10:44   ` [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
@ 2023-11-30 11:23     ` Ferruh Yigit
  0 siblings, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2023-11-30 11:23 UTC (permalink / raw)
  To: Jie Hai, thomas, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

On 11/30/2023 10:44 AM, Jie Hai wrote:
> This patch supports conversion from names to hash algorithm
> (see RTE_ETH_HASH_FUNCTION_XXX).
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Reviewed-by: Huisong Li <lihuisong@huawei.com>
> 

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RESEND 2/2] app/testpmd: support set RSS hash algorithm
  2023-11-30 10:44   ` [RESEND 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
@ 2023-11-30 11:37     ` Ferruh Yigit
  2023-11-30 11:38     ` Ferruh Yigit
  1 sibling, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2023-11-30 11:37 UTC (permalink / raw)
  To: Jie Hai, thomas, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

On 11/30/2023 10:44 AM, Jie Hai wrote:
> Since API rte_eth_dev_rss_hash_update() supports setting RSS hash
> algorithm, add new command to support it:
> 
> testpmd> port config 0 rss-hash-algo symmetric_toeplitz
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Reviewed-by: Huisong Li <lihuisong@huawei.com>
> ---
>  app/test-pmd/cmdline.c                      | 79 +++++++++++++++++++++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
>  2 files changed, 90 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 9369d3b4c526..2cd85c918a09 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -726,6 +726,10 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
>  			"    Set the RSS redirection table.\n\n"
>  
> +			"port config port-id rss-hash-algo (default|simple_xor|toeplitz|"
>

Variables marked by putting them within (), so 'port-id' should be
(port_id).

<...>

> +static cmdline_parse_inst_t cmd_config_rss_hash_algo = {
> +	.f = cmd_config_rss_hash_algo_parsed,
> +	.data = NULL,
> +	.help_str = "port config <port_id> rss-hash-algo "
> +		"(default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort)",
>

'simple_xor', 'toeplitz', etc.. are keywords, not name of variable, so
should not use (). Instead like:
"port config <port_id> rss-hash-algo default|simple_xor|..."


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RESEND 2/2] app/testpmd: support set RSS hash algorithm
  2023-11-30 10:44   ` [RESEND 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
  2023-11-30 11:37     ` Ferruh Yigit
@ 2023-11-30 11:38     ` Ferruh Yigit
  1 sibling, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2023-11-30 11:38 UTC (permalink / raw)
  To: Jie Hai, thomas, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

On 11/30/2023 10:44 AM, Jie Hai wrote:
> +static void
> +cmd_config_rss_hash_algo_parsed(void *parsed_result,
> +				__rte_unused struct cmdline *cl,
> +				__rte_unused void *data)
> +{
> +	struct cmd_config_rss_hash_algo *res = parsed_result;
> +	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
> +	struct rte_eth_rss_conf rss_conf;
> +	int ret;
> +
> +	rss_conf.rss_key_len = RSS_HASH_KEY_LENGTH;
> +	rss_conf.rss_key = rss_key;
> +	ret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf);
> +	if (ret != 0) {
> +		fprintf(stderr, "failed to get port %u RSS confinguration\n",
> 

s/confinguration/configuration/


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 0/2] app/testpmd: support set RSS hash algorithm
  2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
                   ` (4 preceding siblings ...)
  2023-11-30 10:44 ` [RESEND " Jie Hai
@ 2023-12-01  8:52 ` Jie Hai
  2023-12-01  8:52   ` [PATCH v2 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
                     ` (2 more replies)
  5 siblings, 3 replies; 18+ messages in thread
From: Jie Hai @ 2023-12-01  8:52 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

This patch set supports setting RSS hash algorithm.

--
v2:
1. fix misspelling and format.
2. fix CI compile error.
3. add reviewed-by for patch 1.
--

Jie Hai (2):
  ethdev: add new API to get RSS hash algorithm by name
  app/testpmd: support set RSS hash algorithm

 app/test-pmd/cmdline.c                      | 81 +++++++++++++++++++++
 doc/guides/rel_notes/release_24_03.rst      |  5 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 lib/ethdev/rte_ethdev.c                     | 15 ++++
 lib/ethdev/rte_ethdev.h                     | 20 +++++
 lib/ethdev/version.map                      |  3 +
 6 files changed, 135 insertions(+)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/2] ethdev: add new API to get RSS hash algorithm by name
  2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
@ 2023-12-01  8:52   ` Jie Hai
  2023-12-01  8:52   ` [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
  2023-12-04 13:57   ` [PATCH v2 0/2] " Ferruh Yigit
  2 siblings, 0 replies; 18+ messages in thread
From: Jie Hai @ 2023-12-01  8:52 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

This patch supports conversion from names to hash algorithm
(see RTE_ETH_HASH_FUNCTION_XXX).

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/guides/rel_notes/release_24_03.rst |  5 +++++
 lib/ethdev/rte_ethdev.c                | 15 +++++++++++++++
 lib/ethdev/rte_ethdev.h                | 20 ++++++++++++++++++++
 lib/ethdev/version.map                 |  3 +++
 4 files changed, 43 insertions(+)

diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index e9c9717706a0..bd84875d4f17 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -55,6 +55,11 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Improved support of RSS hash algorithm.**
+
+  * Added new function ``rte_eth_find_rss_algo`` to get RSS hash
+    algorithm by its name.
+
 
 Removed Items
 -------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 3858983fcc80..c0398d945502 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4826,6 +4826,21 @@ rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo)
 	return name;
 }
 
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo)
+{
+	unsigned int i;
+
+	for (i = 0; i < RTE_DIM(rte_eth_dev_rss_algo_names); i++) {
+		if (strcmp(name, rte_eth_dev_rss_algo_names[i].name) == 0) {
+			*algo = rte_eth_dev_rss_algo_names[i].algo;
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
 int
 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
 				struct rte_eth_udp_tunnel *udp_tunnel)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 77331ce6525e..3bde5c4c17a6 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -4667,6 +4667,26 @@ __rte_experimental
 const char *
 rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
+ *
+ *  Get RSS hash algorithm by its name.
+ *
+ * @param name
+ *   RSS hash algorithm.
+ *
+ * @param algo
+ *   return the RSS hash algorithm found, @see rte_eth_hash_function.
+ *
+ * @return
+ *   - (0) if successful.
+ *   - (-EINVAL) if not found.
+ */
+__rte_experimental
+int
+rte_eth_find_rss_algo(const char *name, uint32_t *algo);
+
 /**
  * Add UDP tunneling port for a type of tunnel.
  *
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 5c4917c020dc..a050baab0fe7 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -316,6 +316,9 @@ EXPERIMENTAL {
 	rte_eth_recycle_rx_queue_info_get;
 	rte_flow_group_set_miss_actions;
 	rte_flow_calc_table_hash;
+
+	# added in 24.03
+	rte_eth_find_rss_algo;
 };
 
 INTERNAL {
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm
  2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
  2023-12-01  8:52   ` [PATCH v2 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
@ 2023-12-01  8:52   ` Jie Hai
  2023-12-01 11:26     ` Ferruh Yigit
  2023-12-04 13:57   ` [PATCH v2 0/2] " Ferruh Yigit
  2 siblings, 1 reply; 18+ messages in thread
From: Jie Hai @ 2023-12-01  8:52 UTC (permalink / raw)
  To: thomas, ferruh.yigit, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

Since API rte_eth_dev_rss_hash_update() supports setting RSS hash
algorithm, add new command to support it:

testpmd> port config 0 rss-hash-algo symmetric_toeplitz

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/cmdline.c                      | 81 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9369d3b4c526..f704319771f1 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -726,6 +726,10 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
 			"    Set the RSS redirection table.\n\n"
 
+			"port config (port_id) rss-hash-algo (default|simple_xor|toeplitz|"
+			"symmetric_toeplitz|symmetric_toeplitz_sort)\n"
+			"    Set the RSS hash algorithm.\n\n"
+
 			"port config (port_id) dcb vt (on|off) (traffic_class)"
 			" pfc (on|off)\n"
 			"    Set the DCB mode.\n\n"
@@ -2275,6 +2279,82 @@ static cmdline_parse_inst_t cmd_config_rss_hash_key = {
 	},
 };
 
+/* *** configure rss hash algorithm *** */
+struct cmd_config_rss_hash_algo {
+	cmdline_fixed_string_t port;
+	cmdline_fixed_string_t config;
+	portid_t port_id;
+	cmdline_fixed_string_t rss_hash_algo;
+	cmdline_fixed_string_t algo;
+};
+
+static void
+cmd_config_rss_hash_algo_parsed(void *parsed_result,
+				__rte_unused struct cmdline *cl,
+				__rte_unused void *data)
+{
+	struct cmd_config_rss_hash_algo *res = parsed_result;
+	uint8_t rss_key[RSS_HASH_KEY_LENGTH];
+	struct rte_eth_rss_conf rss_conf;
+	uint32_t algorithm;
+	int ret;
+
+	rss_conf.rss_key_len = RSS_HASH_KEY_LENGTH;
+	rss_conf.rss_key = rss_key;
+	ret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to get port %u RSS configuration\n",
+			res->port_id);
+		return;
+	}
+
+	algorithm = (uint32_t)rss_conf.algorithm;
+	ret = rte_eth_find_rss_algo(res->algo, &algorithm);
+	if (ret != 0) {
+		fprintf(stderr, "port %u configured invalid RSS hash algorithm: %s\n",
+			res->port_id, res->algo);
+		return;
+	}
+
+	ret = rte_eth_dev_rss_hash_update(res->port_id, &rss_conf);
+	if (ret != 0) {
+		fprintf(stderr, "failed to set port %u RSS hash algorithm\n",
+			res->port_id);
+		return;
+	}
+}
+
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, port, "port");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_config =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, config,
+				 "config");
+static cmdline_parse_token_num_t cmd_config_rss_hash_algo_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_algo, port_id,
+			      RTE_UINT16);
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_rss_hash_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo,
+				 rss_hash_algo, "rss-hash-algo");
+static cmdline_parse_token_string_t cmd_config_rss_hash_algo_algo =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, algo,
+				 "default#simple_xor#toeplitz#"
+				 "symmetric_toeplitz#symmetric_toeplitz_sort");
+
+static cmdline_parse_inst_t cmd_config_rss_hash_algo = {
+	.f = cmd_config_rss_hash_algo_parsed,
+	.data = NULL,
+	.help_str = "port config <port_id> rss-hash-algo "
+		"default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort",
+	.tokens = {
+		(void *)&cmd_config_rss_hash_algo_port,
+		(void *)&cmd_config_rss_hash_algo_config,
+		(void *)&cmd_config_rss_hash_algo_port_id,
+		(void *)&cmd_config_rss_hash_algo_rss_hash_algo,
+		(void *)&cmd_config_rss_hash_algo_algo,
+		NULL,
+	},
+};
+
 /* *** cleanup txq mbufs *** */
 struct cmd_cleanup_txq_mbufs_result {
 	cmdline_fixed_string_t port;
@@ -13165,6 +13245,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,
 	(cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,
+	(cmdline_parse_inst_t *)&cmd_config_rss_hash_algo,
 	(cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs,
 	(cmdline_parse_inst_t *)&cmd_dump,
 	(cmdline_parse_inst_t *)&cmd_dump_one,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 447e28e6944f..3c7d20c2db82 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2263,6 +2263,17 @@ hash of input [IP] packets received on port::
                      ipv6-udp-ex <string of hex digits \
                      (variable length, NIC dependent)>)
 
+
+port config rss hash algorithm
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To configure the RSS hash algorithm used to compute the RSS
+hash of input packets received on port::
+
+   testpmd> port config <port_id> rss-hash-algo (default|\
+                     simple_xor|toeplitz|symmetric_toeplitz|\
+                     symmetric_toeplitz_sort)
+
 port cleanup txq mbufs
 ~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm
  2023-12-01  8:52   ` [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
@ 2023-12-01 11:26     ` Ferruh Yigit
  0 siblings, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2023-12-01 11:26 UTC (permalink / raw)
  To: Jie Hai, thomas, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

On 12/1/2023 8:52 AM, Jie Hai wrote:
> Since API rte_eth_dev_rss_hash_update() supports setting RSS hash
> algorithm, add new command to support it:
> 
> testpmd> port config 0 rss-hash-algo symmetric_toeplitz
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Reviewed-by: Huisong Li <lihuisong@huawei.com>
>

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/2] app/testpmd: support set RSS hash algorithm
  2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
  2023-12-01  8:52   ` [PATCH v2 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
  2023-12-01  8:52   ` [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
@ 2023-12-04 13:57   ` Ferruh Yigit
  2 siblings, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2023-12-04 13:57 UTC (permalink / raw)
  To: Jie Hai, thomas, dev, andrew.rybchenko; +Cc: fengchengwen, lihuisong

On 12/1/2023 8:52 AM, Jie Hai wrote:
> This patch set supports setting RSS hash algorithm.
> 
> --
> v2:
> 1. fix misspelling and format.
> 2. fix CI compile error.
> 3. add reviewed-by for patch 1.
> --
> 
> Jie Hai (2):
>   ethdev: add new API to get RSS hash algorithm by name
>   app/testpmd: support set RSS hash algorithm
>

Series applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-12-04 13:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22  9:48 [PATCH 0/2] app/testpmd: support set RSS hash algorithm Jie Hai
2023-11-22  9:48 ` [PATCH 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
2023-11-22  9:48 ` [PATCH 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
2023-11-22 10:46 ` [PATCH 0/2] " Ferruh Yigit
2023-11-23  6:32   ` Jie Hai
2023-11-30  9:02 ` Ferruh Yigit
2023-11-30 10:01   ` Jie Hai
2023-11-30 10:44 ` [RESEND " Jie Hai
2023-11-30 10:44   ` [RESEND 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
2023-11-30 11:23     ` Ferruh Yigit
2023-11-30 10:44   ` [RESEND 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
2023-11-30 11:37     ` Ferruh Yigit
2023-11-30 11:38     ` Ferruh Yigit
2023-12-01  8:52 ` [PATCH v2 0/2] " Jie Hai
2023-12-01  8:52   ` [PATCH v2 1/2] ethdev: add new API to get RSS hash algorithm by name Jie Hai
2023-12-01  8:52   ` [PATCH v2 2/2] app/testpmd: support set RSS hash algorithm Jie Hai
2023-12-01 11:26     ` Ferruh Yigit
2023-12-04 13:57   ` [PATCH v2 0/2] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).