Skip to contentSkip to conversation

net/ice: fix DDP package init

PATCH Superseded Qi Zhang 2 participants 6 messages Sep 7, 2022 – Oct 8, 2022 Network drivers

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_ethdev.c +2 -2
index fc889420c7..50fe23fdc4 100644
@@ -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
Signature · 1 line
2.26.2
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, September 7, 2022 8:06 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Yang, SteveX <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH] net/ice: fix DDP package init

Quoted 6 lines

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.

The patch has been squashed into below patch which has not been merged.
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

Quoted 31 lines
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_ethdev.c index renamed from drivers/net/ice/ice_ethdev.c +0 -0

fc889420c7..50fe23fdc4 100644

drivers/net/ice/ice_ethdev.c +1 -1
@@ -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);
drivers/net/ice/ice_ethdev.c +1 -1
 		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

#2 lore raw
Quoted 22 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, September 7, 2022 8:05 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Yang, SteveX <[email protected]>
Subject: RE: [PATCH] net/ice: fix DDP package init

Quoted 10 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Wednesday, September 7, 2022 8:06 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Yang, SteveX <[email protected]>; Zhang, Qi Z <[email protected]>
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

Quoted 8 lines
Quoted 4 lines

package init failure. Use ice_is_init_pkg_successful to check return value of ice_copy_and_init_pkg.

The patch has been squashed into below patch which has not been merged.
https://patchwork.dpdk.org/project/dpdk/patch/20220815073206.2917968-
[email protected]/

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.

Quoted 33 lines
Quoted 11 lines
---
 drivers/net/ice/ice_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index fc889420c7..50fe23fdc4 100644

drivers/net/ice/ice_ethdev.c int ice_load_pkg(struct ice_adapter *adapter, · line 1841

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +1 -1
@@ -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);

Quoted 14 lines
drivers/net/ice/ice_ethdev.c +0 -0
 		goto out;
drivers/net/ice/ice_ethdev.c +1 -1
 	}
@@ -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

author
#3 lore raw

PATCH v2 1/1 net/ice: fix DDP package init

In reply to Qi Zhang

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.

---

v2:
- fix error from ice_copy_and_init_pkg not be esculated.

 drivers/net/ice/ice_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ice/ice_ethdev.c +4 -4
index 8aa37722c3..6e21c38152 100644
@@ -1841,17 +1841,17 @@ 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;
+		free(buf);
+		return -1;
 	}
 
 	/* store the loaded pkg type info */
 	adapter->active_pkg_type = ice_load_pkg_type(hw);
 
-out:
 	free(buf);
-	return err;
+	return 0;
 }
 
 static void
Signature · 1 line
2.31.1
Tested-by on v2 1/1
#4 lore raw
Quoted 12 lines

-----Original Message-----
From: Qi Zhang <[email protected]>
Sent: Saturday, October 8, 2022 10:06 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2] 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.

Quoted 6 lines

---

v2:
- fix error from ice_copy_and_init_pkg not be esculated.

author Applied
#5 lore raw
Quoted 23 lines

-----Original Message-----
From: Huang, ZhiminX <[email protected]>
Sent: Saturday, October 8, 2022 2:11 PM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: RE: [PATCH v2] net/ice: fix DDP package init

Quoted 9 lines

-----Original Message-----
From: Qi Zhang <[email protected]>
Sent: Saturday, October 8, 2022 10:06 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2] 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

Quoted 3 lines

package init failure. Use ice_is_init_pkg_successful to check return value of ice_copy_and_init_pkg.

Quoted 7 lines
Quoted 6 lines

---

v2:
- fix error from ice_copy_and_init_pkg not be esculated.

Applied to dpdk-next-net-intel.

Thanks
Qi