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 C8B8345501; Wed, 26 Jun 2024 14:01:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 946E843405; Wed, 26 Jun 2024 13:56:04 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id DF90A42E95 for ; Wed, 26 Jun 2024 13:44:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402273; x=1750938273; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+GXATK54kCxXyovOU13ZVeieExhC4pK4rANuulgjyAU=; b=FrkpBCLxBuqHzrPQpmlrgd7VP9GMnS57WB7/Z/RP+bBXa3d+pqYY+opR NRdJZam0F/Rd/68JThMzAWZN4SMTq0ebf3raMtxDGBmN0pq6J3UK4XZ5B jQLdBLbHrRT57yHE7p9ewKTvf1WwIau8/fsd2B6e/B2QQVASl/2irT299 zp6SMHKboCwEGxnEL4Ye/j7nGN1Sv4tLzPektq0JGcz9ixj0da+LQfjyj tN1sVFap+q3c0yADjbURK193m8EpptXfJVTUqQBGe52wVTL48Bnzq9EBq T66pDYUoUjyBQym/L0IR8UQN8gT5977MrNw1KdWMHlHPp+NGqEXuNCNPM Q==; X-CSE-ConnectionGUID: q/ksILxuQa+pWW/6TUzlag== X-CSE-MsgGUID: 2Sr0O1DQR+SiricIHfd9Vw== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979446" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979446" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:44:32 -0700 X-CSE-ConnectionGUID: 0pvlWxk3QHqi0CU/uXsP2g== X-CSE-MsgGUID: SvCICnSTT9CMUW1xq+YItQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873991" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:44:31 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Dan Nowlin , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 055/103] net/ice/base: allow different FW API versions based on MAC type Date: Wed, 26 Jun 2024 12:41:43 +0100 Message-ID: <612456ff0df7973505e82b6e5e5af915b86f6d6f.1719401848.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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: Dan Nowlin 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..436551a82d 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