[v2,22/33] net/ice: treat unknown package as OS default package

Message ID 20220413160932.2074781-23-kevinx.liu@intel.com (mailing list archive)
State Superseded, archived
Headers
Series support full function of DCF |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kevin Liu April 13, 2022, 4:09 p.m. UTC
  From: Alvin Zhang <alvinx.zhang@intel.com>

In order to use custom package, unknown package should be treated
as OS default package.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 73e550f5fb..ad9b09d081 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1710,13 +1710,16 @@  ice_load_pkg_type(struct ice_hw *hw)
 
 	/* store the activated package type (OS default or Comms) */
 	if (!strncmp((char *)hw->active_pkg_name, ICE_OS_DEFAULT_PKG_NAME,
-		ICE_PKG_NAME_SIZE))
+		     ICE_PKG_NAME_SIZE)) {
 		package_type = ICE_PKG_TYPE_OS_DEFAULT;
-	else if (!strncmp((char *)hw->active_pkg_name, ICE_COMMS_PKG_NAME,
-		ICE_PKG_NAME_SIZE))
+	} else if (!strncmp((char *)hw->active_pkg_name, ICE_COMMS_PKG_NAME,
+			    ICE_PKG_NAME_SIZE)) {
 		package_type = ICE_PKG_TYPE_COMMS;
-	else
-		package_type = ICE_PKG_TYPE_UNKNOWN;
+	} else {
+		PMD_INIT_LOG(WARNING,
+			     "The package type is not identified, treaded as OS default type");
+		package_type = ICE_PKG_TYPE_OS_DEFAULT;
+	}
 
 	PMD_INIT_LOG(NOTICE, "Active package is: %d.%d.%d.%d, %s (%s VLAN mode)",
 		hw->active_pkg_ver.major, hw->active_pkg_ver.minor,