[PATCH v3 039/129] net/ice/base: adapt No FEC in Auto support check to add E82X devices

Anatoly Burakov anatoly.burakov at intel.com
Tue Jun 25 13:12:44 CEST 2024


From: Eric Joyner <eric.joyner at intel.com>

Previously, the "No FEC in Auto mode" feature was added to the link management
engine (part of firmware) for E810 devices, and was unsupported at the time on
E82X devices. However, this support is now being extended to new FW versions for
E82X devices, and so the SW check to enable this mode must be changed to allow
E82X devices as well.

Importantly, to support this, modify the existing the ice_is_fw_min_ver()
function to no longer check FW Major/Minor/Patch versions across branches, since
features land in the E810 and E82X branches in different versions. Then, the
check in ice_fw_supports_fec_dis_auto() can check the supported versions in each
branch separately. ice_is_fw_min_ver() is only used in this function, so there's
no behavior change needed elsewhere.

Signed-off-by: Eric Joyner <eric.joyner at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 drivers/net/ice/base/ice_common.c | 11 +++++++----
 drivers/net/ice/base/ice_type.h   |  7 +++++++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 61cf6da3ad..5a34a0e86e 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -5951,8 +5951,6 @@ static bool ice_is_fw_min_ver(struct ice_hw *hw, u8 branch, u8 maj, u8 min,
 			if (hw->fw_min_ver == min && hw->fw_patch >= patch)
 				return true;
 		}
-	} else if (hw->fw_branch > branch) {
-		return true;
 	}
 
 	return false;
@@ -6166,11 +6164,16 @@ bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw)
  */
 bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw)
 {
-	return ice_is_fw_min_ver(hw, ICE_FW_FEC_DIS_AUTO_BRANCH,
+	return ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E810,
 				 ICE_FW_FEC_DIS_AUTO_MAJ,
 				 ICE_FW_FEC_DIS_AUTO_MIN,
-				 ICE_FW_FEC_DIS_AUTO_PATCH);
+				 ICE_FW_FEC_DIS_AUTO_PATCH) ||
+	       ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E82X,
+				 ICE_FW_FEC_DIS_AUTO_MAJ_E82X,
+				 ICE_FW_FEC_DIS_AUTO_MIN_E82X,
+				 ICE_FW_FEC_DIS_AUTO_PATCH_E82X);
 }
+
 /**
  * ice_is_fw_auto_drop_supported
  * @hw: pointer to the hardware structure
diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h
index 99eb758eeb..d5f17081af 100644
--- a/drivers/net/ice/base/ice_type.h
+++ b/drivers/net/ice/base/ice_type.h
@@ -1653,11 +1653,18 @@ struct ice_aq_get_set_rss_lut_params {
 
 #define ICE_FW_API_REPORT_DFLT_CFG_PATCH	3
 
+/* FW branch number for hardware families */
+#define ICE_FW_VER_BRANCH_E82X			0
+#define ICE_FW_VER_BRANCH_E810			1
+
 /* FW version for FEC disable in Auto FEC mode */
 #define ICE_FW_FEC_DIS_AUTO_BRANCH		1
 #define ICE_FW_FEC_DIS_AUTO_MAJ			7
 #define ICE_FW_FEC_DIS_AUTO_MIN			0
 #define ICE_FW_FEC_DIS_AUTO_PATCH		5
+#define ICE_FW_FEC_DIS_AUTO_MAJ_E82X		7
+#define ICE_FW_FEC_DIS_AUTO_MIN_E82X		1
+#define ICE_FW_FEC_DIS_AUTO_PATCH_E82X		2
 
 /* AQ API version for FW auto drop reports */
 #define ICE_FW_API_AUTO_DROP_MAJ		1
-- 
2.43.0



More information about the dev mailing list