[RFC,21.11] net/ice/base: support customized DDP package
Checks
Commit Message
This patch adds support for custom DDP version 255.4.0.0
based on DPDK 21.11.
Signed-off-by: Simei Su <simei.su@intel.com>
---
drivers/net/ice/base/ice_flex_pipe.c | 43 +++++++++++++++++++++++++---
drivers/net/ice/base/ice_flex_pipe.h | 1 +
2 files changed, 40 insertions(+), 4 deletions(-)
@@ -1457,15 +1457,32 @@ static void ice_init_pkg_regs(struct ice_hw *hw)
}
/**
- * ice_chk_pkg_version - check package version for compatibility with driver
+ * ice_chk_pkg_vesrion_customize - check package version for custom package
* @pkg_ver: pointer to a version structure to check
*
- * Check to make sure that the package about to be downloaded is compatible with
- * the driver. To be compatible, the major and minor components of the package
+ * To be compatible, the major and minor components of the package
* version must match our ICE_PKG_SUPP_VER_MAJ and ICE_PKG_SUPP_VER_MNR
* definitions.
*/
-static enum ice_status ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
+static enum ice_status
+ice_chk_pkg_vesrion_customize(struct ice_pkg_ver *pkg_ver)
+{
+ if (pkg_ver->major == ICE_PKG_SUPP_VER_CUSTOM_MAJ)
+ return ICE_SUCCESS;
+ else
+ return ICE_ERR_NOT_SUPPORTED;
+}
+
+/**
+ * ice_chk_pkg_vesrion_general - check package version for general package
+ * @pkg_ver: pointer to a version structure to check
+ *
+ * To be compatible, the major and minor components of the package
+ * version must match our ICE_PKG_SUPP_VER_MAJ and ICE_PKG_SUPP_VER_MNR
+ * definitions.
+ */
+static enum ice_status
+ice_chk_pkg_vesrion_general(struct ice_pkg_ver *pkg_ver)
{
if (pkg_ver->major != ICE_PKG_SUPP_VER_MAJ ||
pkg_ver->minor != ICE_PKG_SUPP_VER_MNR)
@@ -1474,6 +1491,24 @@ static enum ice_status ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
return ICE_SUCCESS;
}
+/**
+ * ice_chk_pkg_version - check package version for compatibility with driver
+ * @pkg_ver: pointer to a version structure to check
+ *
+ * Check to make sure that the package about to be downloaded is compatible with
+ * the driver. To be compatible, the major and minor components of the package
+ * version must match our ICE_PKG_SUPP_VER_MAJ and ICE_PKG_SUPP_VER_MNR
+ * definitions.
+ */
+static enum ice_status ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
+{
+ if (!ice_chk_pkg_vesrion_general(pkg_ver) ||
+ !ice_chk_pkg_vesrion_customize(pkg_ver))
+ return ICE_SUCCESS;
+ else
+ return ICE_ERR_NOT_SUPPORTED;
+}
+
/**
* ice_chk_pkg_compat
* @hw: pointer to the hardware structure
@@ -10,6 +10,7 @@
/* Package minimal version supported */
#define ICE_PKG_SUPP_VER_MAJ 1
#define ICE_PKG_SUPP_VER_MNR 3
+#define ICE_PKG_SUPP_VER_CUSTOM_MAJ 255
/* Package format version */
#define ICE_PKG_FMT_VER_MAJ 1