> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Monday, July 22, 2019 6:36 PM
> To: [email protected]; Jerin Jacob Kollanukkaran <[email protected]>; Nithin
> Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda
> <[email protected]>
> Cc: Krzysztof Kanas <[email protected]>
> Subject: [dpdk-dev] [PATCH] net/octeontx2: fix driver reconfiguration
> 
> From: Krzysztof Kanas <[email protected]>
> 
> 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 <[email protected]>
> Reviewed-by: Jerin Jacob Kollanukkaran <[email protected]>
> Reviewed-by: Nithin Kumar Dabilpuram <[email protected]>
> ---
>  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;
> -     }

Reply via email to