Thread (1 message) 1 message, 1 author, 2021-07-13

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

From: Li, Xiaoyun <hidden>
Date: 2021-07-13 03:30:26

-----Original Message-----
From: Wang, Jie1X <redacted>
Sent: Tuesday, July 13, 2021 10:34
To: Li, Xiaoyun <redacted>; andrew.rybchenko@oktetlabs.ru;
dev@dpdk.org
Cc: stable@dpdk.org
Subject: RE: [dpdk-dev] [PATCH] app/testpmd: fix testpmd doesn't show RSS
hash offload

Hi all,
I have tested this patch, it still worked on.

When we changed the port offloads, the port->dev_conf would change in the
same time. And in the function " rte_eth_dev_configure ", dev->data->dev_conf
copied the port->dev_conf parameter into the dev structure.
OK. A reminder: Please answer these under every part you want to explain not the very start. It looks messy in mail-list.
But still, this patch has issues.
Please see inlines.
-----Original Message-----
From: Li, Xiaoyun <redacted>
Sent: Monday, July 12, 2021 11:12 AM
To: Andrew Rybchenko <redacted>; Wang, Jie1X
[off-list ref]; dev@dpdk.org
Cc: stable@dpdk.org
Subject: RE: [dpdk-dev] [PATCH] app/testpmd: fix testpmd doesn't show RSS
hash offload


quoted
-----Original Message-----
From: Andrew Rybchenko <redacted>
Sent: Friday, July 9, 2021 17:27
To: Wang, Jie1X <redacted>; dev@dpdk.org
Cc: Li, Xiaoyun <redacted>; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix testpmd doesn't show
RSS hash offload

On 7/9/21 6:57 PM, Jie Wang wrote:
quoted
This patch reapply Rx/Tx offloads configuration for all ports after
the program configuring the device port. When the program configures
the ports, the default Rx/Tx offloads are modified.

So it is need to reapply Rx/Tx offloads configuration before testpmd
showing offloads.

Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <redacted>
---
 app/test-pmd/testpmd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
1cdd3cdd12..7089ae216d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2475,6 +2475,9 @@ start_port(portid_t pid)
 		}

 		if (port->need_reconfig > 0) {
+			const struct rte_eth_dev *dev = &rte_eth_devices[pi];
+			int k;
+
 			port->need_reconfig = 0;

 			if (flow_isolate_all) {
@@ -2508,6 +2511,18 @@ start_port(portid_t pid)
 				port->need_reconfig = 1;
 				return -1;
 			}
+
+			/* Apply TxRx configuration for all ports */
+			port->dev_conf.txmode = dev->data-
dev_conf.txmode;
+			port->dev_conf.rxmode = dev->data-
dev_conf.rxmode;
Direct assignment for a big struct is dangerous. Next time, if you're going to assign a struct, please use memcpy.
And actually, your issue will only happen for one time for rss_hash because it seems only rss_hash will be added in driver.
Doing these copies every time seems very redundant.
You'd better check if port->rxmode.offloads==dev->data->dev_conf.rx_mode.offloads, if it's not equal, do the new assignment, including queue offload. Otherwise, don't.
Same with txmode.offloads.
quoted
quoted
+			/* Apply Rx offloads configuration */
+			for (k = 0; k < port->dev_info.max_rx_queues; k++)
+				port->rx_conf[k].offloads =
+					port->dev_conf.rxmode.offloads;
+			/* Apply Tx offloads configuration */
+			for (k = 0; k < port->dev_info.max_tx_queues; k++)
+				port->tx_conf[k].offloads =
+					port->dev_conf.txmode.offloads;
Does testpmd really require these copies? May be the right fix is to
get rid of these copies at all and show actual information from data-
dev_conf ?
The "show" command cmd_rx_offload_get_configuration_parsed() actually
should only touch port->dev_conf.
And It doesn't only show dev_conf, but also per queue rx_conf. It's impossible to
show per queue rx conf info from data->dev_conf.

The copy is already done in init_config actually. But by then, dev->data-
quoted
dev_conf doesn't include RSS_HASH.
RSS_HASH is added by driver in dev_configure. That's why this patch wants to
copy again after dev_configure I guess.

But this patch is INCORRECT anyway.
Because any cmd that changes port offload will change port->dev_conf and
port->rx/tx_conf NOT dev->data->dev_conf.
So after this patch, if a user " port config 0 rx_offload xxx on", all of the new
config will disappear.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help