DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice/base: support customized DDP package
@ 2023-06-05  9:38 Simei Su
  2023-06-06  9:24 ` Su, Simei
  0 siblings, 1 reply; 2+ messages in thread
From: Simei Su @ 2023-06-05  9:38 UTC (permalink / raw)
  To: qi.z.zhang, qiming.yang; +Cc: dev, Simei Su

This patch adds support for custom DDP version 255.4.0.0.

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/ice/base/ice_ddp.c | 41 ++++++++++++++++++++++++++++++----
 drivers/net/ice/base/ice_ddp.h |  1 +
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_ddp.c b/drivers/net/ice/base/ice_ddp.c
index d1cae48047..7164a600b4 100644
--- a/drivers/net/ice/base/ice_ddp.c
+++ b/drivers/net/ice/base/ice_ddp.c
@@ -1014,15 +1014,32 @@ void ice_free_seg(struct ice_hw *hw)
 }
 
 /**
- * ice_chk_pkg_version - check package version for compatibility with driver
+ * ice_chk_pkg_vesrion_customize - check package version for GRE_EXTEND support
  * @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_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
+static enum ice_ddp_state
+ice_chk_pkg_vesrion_customize(struct ice_pkg_ver *pkg_ver)
+{
+	if (pkg_ver->major == ICE_PKG_SUPP_VER_CUSTOM_MAJ)
+		return ICE_DDP_PKG_SUCCESS;
+	else
+		return ICE_DDP_PKG_ERR;
+}
+
+/**
+ * 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_ddp_state
+ice_chk_pkg_vesrion_general(struct ice_pkg_ver *pkg_ver)
 {
 	if (pkg_ver->major > ICE_PKG_SUPP_VER_MAJ ||
 	    (pkg_ver->major == ICE_PKG_SUPP_VER_MAJ &&
@@ -1036,6 +1053,22 @@ static enum ice_ddp_state ice_chk_pkg_version(struct ice_pkg_ver *pkg_ver)
 	return ICE_DDP_PKG_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.
+ */
+static enum ice_ddp_state 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_DDP_PKG_SUCCESS;
+	else
+		return ICE_DDP_PKG_ERR;
+}
+
 /**
  * ice_chk_pkg_compat
  * @hw: pointer to the hardware structure
diff --git a/drivers/net/ice/base/ice_ddp.h b/drivers/net/ice/base/ice_ddp.h
index 53bbbe2a5a..b8d79e89ac 100644
--- a/drivers/net/ice/base/ice_ddp.h
+++ b/drivers/net/ice/base/ice_ddp.h
@@ -15,6 +15,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
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-06  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05  9:38 [PATCH] net/ice/base: support customized DDP package Simei Su
2023-06-06  9:24 ` Su, Simei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).