net/ice: fix DDP package init

Message ID 20220907120603.169681-1-qi.z.zhang@intel.com (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fix DDP package init |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Qi Zhang Sept. 7, 2022, 12:06 p.m. UTC
  ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED and
ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED should not be treated as
a DDP package init failure. Use ice_is_init_pkg_successful
to check return value of ice_copy_and_init_pkg.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang Sept. 7, 2022, 12:05 p.m. UTC | #1
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Wednesday, September 7, 2022 8:06 PM
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Yang, SteveX <stevex.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: [PATCH] net/ice: fix DDP package init
> 
> ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED and
> ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED should not be treated as a
> DDP package init failure. Use ice_is_init_pkg_successful to check return value
> of ice_copy_and_init_pkg.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

The patch has been squashed into below patch which has not been merged.
https://patchwork.dpdk.org/project/dpdk/patch/20220815073206.2917968-21-qi.z.zhang@intel.com/

> ---
>  drivers/net/ice/ice_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> fc889420c7..50fe23fdc4 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -1836,7 +1836,7 @@ int ice_load_pkg(struct ice_adapter *adapter, bool
> use_dsn, uint64_t dsn)
>  	PMD_INIT_LOG(DEBUG, "DDP package name: %s", pkg_file);
> 
>  	err = ice_copy_and_init_pkg(hw, buf, bufsz);
> -	if (err) {
> +	if (!ice_is_init_pkg_successful(err)) {
>  		PMD_INIT_LOG(ERR, "ice_copy_and_init_hw failed: %d\n",
> err);
>  		goto out;
>  	}
> @@ -1846,7 +1846,7 @@ int ice_load_pkg(struct ice_adapter *adapter, bool
> use_dsn, uint64_t dsn)
> 
>  out:
>  	free(buf);
> -	return err;
> +	return 0;
>  }
> 
>  static void
> --
> 2.26.2
  
Qi Zhang Oct. 8, 2022, 5:46 a.m. UTC | #2
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, September 7, 2022 8:05 PM
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Yang, SteveX <stevex.yang@intel.com>
> Subject: RE: [PATCH] net/ice: fix DDP package init
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Wednesday, September 7, 2022 8:06 PM
> > To: Yang, Qiming <qiming.yang@intel.com>
> > Cc: dev@dpdk.org; Yang, SteveX <stevex.yang@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>
> > Subject: [PATCH] net/ice: fix DDP package init
> >
> > ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED and
> > ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED should not be treated as a
> DDP
> > package init failure. Use ice_is_init_pkg_successful to check return
> > value of ice_copy_and_init_pkg.
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> The patch has been squashed into below patch which has not been merged.
> https://patchwork.dpdk.org/project/dpdk/patch/20220815073206.2917968-
> 21-qi.z.zhang@intel.com/

There is a miss-operation in dpdk-next-net-intel, the patch actually has not been squashed.

At this moment, since the target patch already be merged,  a separated fix is required.

The good point is the original fix still has defect as a failure of ice_copy_and_init_pkg will not be escalated to the caller and V2 will fix this.

> 
> > ---
> >  drivers/net/ice/ice_ethdev.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_ethdev.c
> > b/drivers/net/ice/ice_ethdev.c index
> > fc889420c7..50fe23fdc4 100644
> > --- a/drivers/net/ice/ice_ethdev.c
> > +++ b/drivers/net/ice/ice_ethdev.c
> > @@ -1836,7 +1836,7 @@ int ice_load_pkg(struct ice_adapter *adapter,
> > bool use_dsn, uint64_t dsn)
> >  	PMD_INIT_LOG(DEBUG, "DDP package name: %s", pkg_file);
> >
> >  	err = ice_copy_and_init_pkg(hw, buf, bufsz);
> > -	if (err) {
> > +	if (!ice_is_init_pkg_successful(err)) {
> >  		PMD_INIT_LOG(ERR, "ice_copy_and_init_hw failed: %d\n",
> err);
> >  		goto out;
> >  	}
> > @@ -1846,7 +1846,7 @@ int ice_load_pkg(struct ice_adapter *adapter,
> > bool use_dsn, uint64_t dsn)
> >
> >  out:
> >  	free(buf);
> > -	return err;
> > +	return 0;
> >  }
> >
> >  static void
> > --
> > 2.26.2
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index fc889420c7..50fe23fdc4 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1836,7 +1836,7 @@  int ice_load_pkg(struct ice_adapter *adapter, bool use_dsn, uint64_t dsn)
 	PMD_INIT_LOG(DEBUG, "DDP package name: %s", pkg_file);
 
 	err = ice_copy_and_init_pkg(hw, buf, bufsz);
-	if (err) {
+	if (!ice_is_init_pkg_successful(err)) {
 		PMD_INIT_LOG(ERR, "ice_copy_and_init_hw failed: %d\n", err);
 		goto out;
 	}
@@ -1846,7 +1846,7 @@  int ice_load_pkg(struct ice_adapter *adapter, bool use_dsn, uint64_t dsn)
 
 out:
 	free(buf);
-	return err;
+	return 0;
 }
 
 static void