[v4,6/7] app/proc-info: support querying RSS hash algorithm

Message ID 20230908080030.3837515-7-haijie1@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series support setting and querying RSS algorithms |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Hai Sept. 8, 2023, 8 a.m. UTC
  Display RSS hash algorithm with command show-port as below.
  - RSS info
	  -- hash algorithm : toeplitz

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 app/proc-info/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Pattan, Reshma Sept. 13, 2023, 11:42 a.m. UTC | #1
> -----Original Message-----
> From: Jie Hai <haijie1@huawei.com>
> Subject: [PATCH v4 6/7] app/proc-info: support querying RSS hash algorithm
> 
> Display RSS hash algorithm with command show-port as below.
>   - RSS info
> 	  -- hash algorithm : toeplitz
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>

Acked-by: Reshma Pattan <reshma.pattan@intel.com>
  
Pattan, Reshma Sept. 13, 2023, 11:44 a.m. UTC | #2
> -----Original Message-----
> From: Jie Hai <haijie1@huawei.com>
> Sent: Friday, September 8, 2023 9:00 AM
> To: dev@dpdk.org; Pattan, Reshma <reshma.pattan@intel.com>
> Cc: haijie1@huawei.com; lihuisong@huawei.com
> Subject: [PATCH v4 6/7] app/proc-info: support querying RSS hash algorithm
> 
> Display RSS hash algorithm with command show-port as below.
>   - RSS info
> 	  -- hash algorithm : toeplitz
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>

Acked-by: Reshma Pattan <reshma.pattan@intel.com>
  

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 735cfd5249ab..3da63a4821f2 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -153,6 +153,13 @@  static struct desc_param rx_desc_param;
 static struct desc_param tx_desc_param;
 
 #define RSS_HASH_KEY_SIZE 64
+static const char * const rss_hash_algos[] = {
+	[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = "simple_xor",
+	[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = "toeplitz",
+	[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = "symmetric_toeplitz",
+	[RTE_ETH_HASH_FUNCTION_DEFAULT] = "default",
+	[RTE_ETH_HASH_FUNCTION_MAX] = "unknown"
+};
 
 /* display usage */
 static void
@@ -1186,6 +1193,8 @@  show_port(void)
 				printf("%02x", rss_conf.rss_key[k]);
 			printf("\n\t  -- hf : 0x%"PRIx64"\n",
 					rss_conf.rss_hf);
+			printf("\t  -- hash algorithm : %s\n",
+				rss_hash_algos[rss_conf.func]);
 		}
 
 #ifdef RTE_LIB_SECURITY