[dpdk-dev] [PATCH] net/octeontx2: fix driver reconfiguration

Jerin Jacob Kollanukkaran jerinj at marvell.com
Mon Jul 22 16:39:42 CEST 2019


> -----Original Message-----
> From: kkanas at marvell.com <kkanas at marvell.com>
> Sent: Monday, July 22, 2019 6:36 PM
> To: dev at dpdk.org; Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Nithin
> Kumar Dabilpuram <ndabilpuram at marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark at marvell.com>
> Cc: Krzysztof Kanas <kkanas at marvell.com>
> Subject: [dpdk-dev] [PATCH] net/octeontx2: fix driver reconfiguration
> 
> From: Krzysztof Kanas <kkanas at marvell.com>
> 
> When configure returns error, e.g. in case not supported offloads (outer ip
> and sctp) driver released Rx,Tx queues. Then in case of correct configuration
> the driver could not start due to queues already released but the driver
> thought it was configured correctly.
> 
> Secondly if driver returns error from configuration librte_ethdev will release,
> rx queues and tx queues, without chaining driver configured state.
> 
> Fix that by 'releasing' configuration and changing driver state when error is
> returned from otx2_nix_configure.
> 
> Fixes: 548b5839a32b ("net/octeontx2: add device configure operation")
> 
> Signed-off-by: Krzysztof Kanas <kkanas at marvell.com>
> Reviewed-by: Jerin Jacob Kollanukkaran <jerinj at marvell.com>
> Reviewed-by: Nithin Kumar Dabilpuram <ndabilpuram at marvell.com>
> ---
>  drivers/net/octeontx2/otx2_ethdev.c | 65 +++++++++++++++++------------
>  1 file changed, 38 insertions(+), 27 deletions(-)
> 
> +	if (otx2_dev_is_A0(dev) &&

Please change to otx2_dev_is_Ax(). See below.

> +	    (txmode->offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) &&
> +	    ((txmode->offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)
> ||
> +	    (txmode->offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM))) {
> +		otx2_err("Outer IP and SCTP checksum unsupported");
> +		goto fail_configure;
>  	}
> 
>  	/* Free the resources allocated from the previous configure */ @@ -
> 1230,20 +1238,11 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)
>  		nix_set_nop_rxtx_function(eth_dev);
>  		rc = nix_store_queue_cfg_and_then_release(eth_dev);
>  		if (rc)
> -			goto fail;
> +			goto fail_configure;
>  		otx2_nix_tm_fini(eth_dev);
>  		nix_lf_free(dev);
>  	}
> 
> -	if (otx2_dev_is_Ax(dev) &&

See above.

> -	    (txmode->offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) &&
> -	    ((txmode->offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)
> ||
> -	    (txmode->offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM))) {
> -		otx2_err("Outer IP and SCTP checksum unsupported");
> -		rc = -EINVAL;
> -		goto fail;
> -	}


More information about the dev mailing list