From patchwork Mon Jun 5 09:38:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 128117 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F58442C34; Mon, 5 Jun 2023 11:38:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00B6C40A7F; Mon, 5 Jun 2023 11:38:39 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id CC8064003C for ; Mon, 5 Jun 2023 11:38:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685957917; x=1717493917; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dAkNjWbdsQHv6Sec+XjIXwiNZbc998dbR8XhmX1PLcE=; b=XJH6E6gdCsXv9Bo4alv7lQDvvzQPA1UgC5gmpw2dq7nXudqU78RXOONO zvnYqau8wfW4s/0UWzvTUCShWK0fuxkfcdXYjZ/LBcdwBQJKTs15+N6f7 uOaAeGb4t3Cbi4X687vIco4F+1Raq7FNuVa0AibL4vbrf+aY9XMWyr/R+ eM6S25tjoMCwEOCloPFMWHj4o1e2rdiUZ/Q2NmRwcHz7KrwDmEuUA4OaQ MYqPv3ayyXNRcWIJz+Vymud02Etm7ScevA6699hhqDXKGytu9l4I377Oa rA6ApMekLmLffCz59XjWwPs7tSg73Q7RBZFceE2tbcJ64zM8yL/DCp1yp w==; X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="384628924" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="384628924" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 02:38:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="852907686" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="852907686" Received: from dpdk-simei-icelake.sh.intel.com ([10.67.110.167]) by fmsmga001.fm.intel.com with ESMTP; 05 Jun 2023 02:38:34 -0700 From: Simei Su To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, Simei Su Subject: [PATCH] net/ice/base: support customized DDP package Date: Mon, 5 Jun 2023 17:38:01 +0800 Message-Id: <20230605093801.2362170-1-simei.su@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch adds support for custom DDP version 255.4.0.0. Signed-off-by: Simei Su --- 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