Thread (76 messages) 76 messages, 7 authors, 2021-10-15

Re: [dpdk-dev] [PATCH v8 2/2] app/testpmd: fix testpmd doesn't show RSS hash offload

From: Ferruh Yigit <hidden>
Date: 2021-09-08 16:51:20

On 8/27/2021 9:17 AM, Jie Wang wrote:
quoted hunk ↗ jump to hunk
The driver may change offloads info into dev->data->dev_conf
in dev_configure which may cause port->dev_conf and port->rx_conf
contain outdated values.

This patch updates the offloads info if it changes to fix this issue.

Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")

Signed-off-by: Jie Wang <redacted>
---
 app/test-pmd/testpmd.c | 34 ++++++++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h |  2 ++
 app/test-pmd/util.c    | 15 +++++++++++++++
 3 files changed, 51 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6cbe9ba3c8..bd67291160 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2461,6 +2461,9 @@ start_port(portid_t pid)
 		}
 
 		if (port->need_reconfig > 0) {
+			struct rte_eth_conf dev_conf_info;
+			int k;
+
 			port->need_reconfig = 0;
 
 			if (flow_isolate_all) {
@@ -2498,6 +2501,37 @@ start_port(portid_t pid)
 				port->need_reconfig = 1;
 				return -1;
 			}
+			/* get rte_eth_conf info */
+			if (0 !=
+				eth_dev_conf_info_get_print_err(pi,
+							&dev_conf_info)) {
+				fprintf(stderr,
+					"port %d can not get device configuration info\n",
+					pi);
+				return -1;
+			}
+			/* Apply Rx offloads configuration */
+			if (dev_conf_info.rxmode.offloads !=
+				port->dev_conf.rxmode.offloads) {
+				port->dev_conf.rxmode.offloads =
+					dev_conf_info.rxmode.offloads;
+				for (k = 0;
+				     k < port->dev_info.max_rx_queues;
+				     k++)
+					port->rx_conf[k].offloads =
+						dev_conf_info.rxmode.offloads;
+			}
+			/* Apply Tx offloads configuration */
+			if (dev_conf_info.txmode.offloads !=
+				port->dev_conf.txmode.offloads) {
+				port->dev_conf.txmode.offloads =
+					dev_conf_info.txmode.offloads;
+				for (k = 0;
+				     k < port->dev_info.max_tx_queues;
+				     k++)
+					port->tx_conf[k].offloads =
+						dev_conf_info.txmode.offloads;
+			}
 		}
Above implementation gets the configuration from device and applies it to the
testpmd configuration.

Instead, what about a long level target to get rid of testpmd specific copy of
the configuration and rely and the config provided by devices. @Xiaoyun, what do
you think, does this make sense?

So instead of above code, update where RSS hash offload information printed to
use device retrieved config instead of testpmd config, will it work?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help