[5/5] app/proc-info: support querying RSS hash algorithm

Message ID 20230315110033.30143-6-liudongdong3@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
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Dongdong Liu March 15, 2023, 11 a.m. UTC
  From: Jie Hai <haijie1@huawei.com>

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 | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 7b6f8f1228..4c2a113a1a 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -879,6 +879,23 @@  show_offloads(uint64_t offloads,
 	}
 }
 
+static const char *
+rss_func_to_str(enum rte_eth_hash_function func)
+{
+	switch (func) {
+	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
+		return "simple_xor";
+	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
+		return "toeplitz";
+	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
+		return "symmetric_toeplitz";
+	case RTE_ETH_HASH_FUNCTION_DEFAULT:
+		return "default";
+	default:
+		return "unknown";
+	}
+}
+
 static void
 show_rss_types(uint64_t rss_types)
 {
@@ -1097,6 +1114,8 @@  show_port(void)
 			} else {
 				printf("\t  -- hf:\n");
 				show_rss_types(rss_conf.rss_hf);
+				printf("\t  -- hash algorithm: %s\n",
+					rss_func_to_str(rss_conf.func));
 				printf("\t  -- key len: %u\n",
 						rss_conf.rss_key_len);
 				printf("\t  -- key (hex): ");