[RFC,21.11] net/ice/base: support customized DDP package

Message ID 20230605102504.2434887-1-simei.su@intel.com (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series [RFC,21.11] net/ice/base: support customized DDP package |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation warning apply patch failure
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues
ci/intel-Functional success Functional PASS

Commit Message

Simei Su June 5, 2023, 10:25 a.m. UTC
  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(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 395787806b..38976df106 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -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
diff --git a/drivers/net/ice/base/ice_flex_pipe.h b/drivers/net/ice/base/ice_flex_pipe.h
index 23ba45564a..2e0f4bed7f 100644
--- a/drivers/net/ice/base/ice_flex_pipe.h
+++ b/drivers/net/ice/base/ice_flex_pipe.h
@@ -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