net/ice/base: support customized DDP package

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS

Commit Message

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

Comments

Simei Su June 6, 2023, 9:24 a.m. UTC | #1
This patch is for customized DDP package based on DPDK 23.03.
Customer use a custom package and a custom kernel driver, so DPDK won't upstream it.

> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Monday, June 5, 2023 5:38 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Su, Simei <simei.su@intel.com>
> Subject: [PATCH] net/ice/base: support customized DDP package
> 
> 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
  

Patch

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