Re: [dpdk-dev] [PATCH] app/testpmd: fix testpmd doesn't show RSS hash offload
From: Li, Xiaoyun <hidden>
Date: 2021-07-12 03:12:29
-----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 index1cdd3cdd12..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; + /* 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->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.