From patchwork Mon Jun 5 10:25:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 128118 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 4F48E42BCF; Mon, 5 Jun 2023 12:25:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 268FE40A7F; Mon, 5 Jun 2023 12:25:20 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B15774003C for ; Mon, 5 Jun 2023 12:25:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685960718; x=1717496718; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KRkaPk3+vyq+JZWg/IcHq3FpDu5V7kY+LbXztN3NY0M=; b=UYDg9CNBUn8VAK+Pbsmjn6Km8PFGqleBpYXDLkg8+TqZUsJjH1IS6kU1 ckshfb6d1FgCeqO9YVQ4MbKKscnQcvnlTYm4GlZ4QF3Zg81jpFTf+IY2C e0AcnAFFJkIYbVhMkxjo8P3YUbGwx2KW2xIVQ/z/6Y5R5jebeaRWvKoVH lT6a619Fvzs6FXiEgLZWYclC0GLh2gp7389kJltp+Ukha513V/HLoxPP/ owbxPnJ9sDjZWZZNBumHT36ubIWkr0Gm1YdKi9SfQGWVPMmKr5eEefFFg VOfpuOr7uxPA+/Qn2uomYWU5IrRv0cvUq59hUJKHiicvTNPmJv3VWcKtU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="419879462" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="419879462" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 03:25:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="1038730922" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="1038730922" Received: from dpdk-simei-icelake.sh.intel.com ([10.67.110.167]) by fmsmga005.fm.intel.com with ESMTP; 05 Jun 2023 03:25:15 -0700 From: Simei Su To: qi.z.zhang@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, Simei Su Subject: [RFC DPDK 21.11] net/ice/base: support customized DDP package Date: Mon, 5 Jun 2023 18:25:04 +0800 Message-Id: <20230605102504.2434887-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 based on DPDK 21.11. Signed-off-by: Simei Su --- 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(-) 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