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

Li, Xiaoyun xiaoyun.li at intel.com
Mon Jul 12 05:12:19 CEST 2021



> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Sent: Friday, July 9, 2021 17:27
> To: Wang, Jie1X <jie1x.wang at intel.com>; dev at dpdk.org
> Cc: Li, Xiaoyun <xiaoyun.li at intel.com>; stable at 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:
> > 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 at dpdk.org
> >
> > Signed-off-by: Jie Wang <jie1x.wang at intel.com>
> > ---
> >  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;
> > +			/* 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.


More information about the dev mailing list