[dpdk-dev] [PATCH] app/testpmd: fix offloads default set error

Kevin Traynor ktraynor at redhat.com
Mon Jun 10 12:09:32 CEST 2019


On 10/06/2019 07:45, Wei Zhao wrote:
> There is no need to use default offloads configuration
> if offloads configuration has been pass down from uplayer.
> 

It doesn't seem like the right fix to me. It means if a user
enable/disable one offload in the command line they are silently
changing from the default behaviour of other offloads? I could
understand if the user set all offloads in one go through a mask but not
when they are set seemingly independent.

It looks like you need to track which ones have been enabled/disabled by
the user, and use the default for for the other offloads.

> Fixes: 5e91aeef218c ("app/testpmd: fix offload flags after port config")
> 
> Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
> ---
>  app/test-pmd/testpmd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 0148b0a..b5f5801 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2815,7 +2815,8 @@ rxtx_port_config(struct rte_port *port)
>  	for (qid = 0; qid < nb_rxq; qid++) {
>  		offloads = port->rx_conf[qid].offloads;
>  		port->rx_conf[qid] = port->dev_info.default_rxconf;
> -		port->rx_conf[qid].offloads |= offloads;
> +		if (offloads)
> +			port->rx_conf[qid].offloads = offloads;
>  
>  		/* Check if any Rx parameters have been passed */
>  		if (rx_pthresh != RTE_PMD_PARAM_UNSET)
> @@ -2839,7 +2840,8 @@ rxtx_port_config(struct rte_port *port)
>  	for (qid = 0; qid < nb_txq; qid++) {
>  		offloads = port->tx_conf[qid].offloads;
>  		port->tx_conf[qid] = port->dev_info.default_txconf;
> -		port->tx_conf[qid].offloads |= offloads;
> +		if (offloads)
> +			port->tx_conf[qid].offloads = offloads;
>  
>  		/* Check if any Tx parameters have been passed */
>  		if (tx_pthresh != RTE_PMD_PARAM_UNSET)
> 



More information about the dev mailing list