From 491333ae684b8303e019536900bb931b9f64b1ce Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Thu, 16 Mar 2023 20:58:14 +0800
Subject: app/testpmd: display RSS hash key of flow rule

[ upstream commit f958bbe2210dcc888032e81ec1326c0df5e5c518 ]

There are two ways to set RSS hash key with rte flow rule:
1. 'key_len' isn't zero and 'key' is NULL.
2. 'key_len' isn't zero and 'key' isn't NULL.
This patch adds displaying for the hash key of rte flow rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 873d1f1357..78af232a8a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1651,6 +1651,21 @@ rss_config_display(struct rte_flow_action_rss *rss_conf)
 		return;
 	}
 
+	printf(" RSS key:\n");
+	if (rss_conf->key_len == 0) {
+		printf("  none");
+	} else {
+		printf("  key_len: %u\n", rss_conf->key_len);
+		printf("  key: ");
+		if (rss_conf->key == NULL) {
+			printf("none");
+		} else {
+			for (i = 0; i < rss_conf->key_len; i++)
+				printf("%02X", rss_conf->key[i]);
+		}
+	}
+	printf("\n");
+
 	printf(" types:\n");
 	if (rss_conf->types == 0) {
 		printf("  none\n");
-- 
2.23.0

