From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36BAC4404F; Wed, 12 Jun 2024 17:18:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72A5C42F13; Wed, 12 Jun 2024 17:05:55 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 4793342F00 for ; Wed, 12 Jun 2024 17:05:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204751; x=1749740751; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dczPWbEuxUq6RtH+cKFpHNj0taWcnArCeN9PyYYXTes=; b=lnnp8F7n5hJTSo8THJskZI1UYzvNzBbaIe8uJTX923PtbOQY+cjAAj3w PayIRzh+LOtd+61u1VkC9Fq0UEgew+WkaKlthedjvE7sNvXXVZqrRoVfc oRn8M74mNgmU95KyG5RLBPGEwVPc46WooXvWbahtyjHsXGWzKhGMG3kkk oWGcgpmmHaRPvllxpYvR6w/yVBrQjjas2OZltzYe4ZkxlfOoIyhB9k9Cf 28hjLaqTc4nRhTvVWyI8tk9BdocV4KKN9tz+fRCeVLjVJNW86HLC0DVOU e1h4kaodh9vDylSuhWldMCLigr+sT7jZFk4S90UOsyNuNuhw2YvQvAgm1 w==; X-CSE-ConnectionGUID: q4Ig8dmhTq6NdtaniMhb5w== X-CSE-MsgGUID: zbNAMhCoT66xl39i92LeAg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459795" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459795" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:05:50 -0700 X-CSE-ConnectionGUID: OQPDT34NQK6mJIMsfVQjOw== X-CSE-MsgGUID: eK5j/zHDRluROLXoJbFP6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925666" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:05:49 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Dan Nowlin Subject: [PATCH v2 093/148] net/ice/base: allow different FW API versions based on MAC type Date: Wed, 12 Jun 2024 16:01:27 +0100 Message-ID: <893ccdcefc040c09c9f7fcca6194b34a8cbe4770.1718204529.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Ian Stokes Allow the driver to be compatible with different FW API versions based on the device's MAC type. Currently, E810 is only compatible with one FW API version. Now the driver can be compatible with different FW API versions for both E810 and E830. Signed-off-by: Dan Nowlin Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_controlq.c | 17 ++++++++++------- drivers/net/ice/base/ice_controlq.h | 22 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c index c2cf747b65..edc068481e 100644 --- a/drivers/net/ice/base/ice_controlq.c +++ b/drivers/net/ice/base/ice_controlq.c @@ -479,24 +479,27 @@ ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) */ static bool ice_aq_ver_check(struct ice_hw *hw) { - if (hw->api_maj_ver > EXP_FW_API_VER_MAJOR) { + u8 exp_fw_api_ver_major = EXP_FW_API_VER_MAJOR_BY_MAC(hw); + u8 exp_fw_api_ver_minor = EXP_FW_API_VER_MINOR_BY_MAC(hw); + +if (hw->api_maj_ver > exp_fw_api_ver_major) { /* Major API version is newer than expected, don't load */ ice_warn(hw, "The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n"); return false; - } else if (hw->api_maj_ver == EXP_FW_API_VER_MAJOR) { - if (hw->api_min_ver > (EXP_FW_API_VER_MINOR + 2)) + } else if (hw->api_maj_ver == exp_fw_api_ver_major) { + if (hw->api_min_ver > (exp_fw_api_ver_minor + 2)) ice_info(hw, "The driver for the device detected a newer version (%u.%u) of the NVM image than expected (%u.%u). Please install the most recent version of the network driver.\n", hw->api_maj_ver, hw->api_min_ver, - EXP_FW_API_VER_MAJOR, EXP_FW_API_VER_MINOR); - else if ((hw->api_min_ver + 2) < EXP_FW_API_VER_MINOR) + exp_fw_api_ver_major, exp_fw_api_ver_minor); + else if ((hw->api_min_ver + 2) < exp_fw_api_ver_minor) ice_info(hw, "The driver for the device detected an older version (%u.%u) of the NVM image than expected (%u.%u). Please update the NVM image.\n", hw->api_maj_ver, hw->api_min_ver, - EXP_FW_API_VER_MAJOR, EXP_FW_API_VER_MINOR); + exp_fw_api_ver_major, exp_fw_api_ver_minor); } else { /* Major API version is older than expected, log a warning */ ice_info(hw, "The driver for the device detected an older version (%u.%u) of the NVM image than expected (%u.%u). Please update the NVM image.\n", hw->api_maj_ver, hw->api_min_ver, - EXP_FW_API_VER_MAJOR, EXP_FW_API_VER_MINOR); + exp_fw_api_ver_major, exp_fw_api_ver_minor); } return true; } diff --git a/drivers/net/ice/base/ice_controlq.h b/drivers/net/ice/base/ice_controlq.h index 45394ee695..24e34d9579 100644 --- a/drivers/net/ice/base/ice_controlq.h +++ b/drivers/net/ice/base/ice_controlq.h @@ -22,9 +22,25 @@ /* Defines that help manage the driver vs FW API checks. * Take a look at ice_aq_ver_check in ice_controlq.c for actual usage. */ -#define EXP_FW_API_VER_BRANCH 0x00 -#define EXP_FW_API_VER_MAJOR 0x01 -#define EXP_FW_API_VER_MINOR 0x05 +#define EXP_FW_API_VER_BRANCH_E830 0x00 +#define EXP_FW_API_VER_MAJOR_E830 0x01 +#define EXP_FW_API_VER_MINOR_E830 0x07 + +#define EXP_FW_API_VER_BRANCH_E810 0x00 +#define EXP_FW_API_VER_MAJOR_E810 0x01 +#define EXP_FW_API_VER_MINOR_E810 0x05 + +#define EXP_FW_API_VER_BRANCH_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_BRANCH_E830 : \ + EXP_FW_API_VER_BRANCH_E810) + +#define EXP_FW_API_VER_MAJOR_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MAJOR_E830 : \ + EXP_FW_API_VER_MAJOR_E810) + +#define EXP_FW_API_VER_MINOR_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MINOR_E830 : \ + EXP_FW_API_VER_MINOR_E810) /* Different control queue types: These are mainly for SW consumption. */ enum ice_ctl_q { -- 2.43.0