From: Aleksandr Loktionov <[email protected]> The ice_fw_supports_lldp_fltr_ctrl() function previously restricted the LLDP filter control API (admin queue command 0x0A0A) to E810 devices only. This limitation prevented newer hardware like E830 from using the more efficient LLDP packet filtering method, even when firmware support was available.
Remove the hardware type restriction and implement hardware-specific firmware API version checks to determine LLDP filter control support. E810 and E82x cards require firmware API version >= 1.7.1, while E830 cards require firmware API version >= 1.7.11. This enables E830 and future hardware to utilize the improved filtering mechanism when supported by firmware. Additionally, add fallback logic in ice_cfg_sw_lldp() to automatically fall back to the legacy ethernet filter method if the new LLDP filter control API fails. This provides resilience against buggy firmware that may report API support but fail during actual command execution. The try-fallback pattern ensures LLDP configuration succeeds regardless of firmware quirks, improving driver robustness across hardware generations and firmware versions. Signed-off-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Soumyadeep Hore <[email protected]> --- drivers/net/intel/ice/base/ice_common.c | 20 ++++++++++++++------ drivers/net/intel/ice/base/ice_type.h | 7 ++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/intel/ice/base/ice_common.c b/drivers/net/intel/ice/base/ice_common.c index 72f84d49cd..7d8f677c99 100644 --- a/drivers/net/intel/ice/base/ice_common.c +++ b/drivers/net/intel/ice/base/ice_common.c @@ -6561,15 +6561,23 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, /** * ice_fw_supports_lldp_fltr_ctrl - check NVM version supports lldp_fltr_ctrl * @hw: pointer to HW struct + * + * Check if firmware supports the LLDP filter control feature (AQ command 0x0A0A). + * Different hardware families require different minimum firmware versions: + * - E810 and E82x cards require API version 1.7.1 or later + * - E830 cards require API version 1.7.11 or later */ bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw) { - if (hw->mac_type != ICE_MAC_E810 && hw->mac_type != ICE_MAC_GENERIC) - return false; - - return ice_is_fw_api_min_ver(hw, ICE_FW_API_LLDP_FLTR_MAJ, - ICE_FW_API_LLDP_FLTR_MIN, - ICE_FW_API_LLDP_FLTR_PATCH); + if (hw->mac_type == ICE_MAC_E830) + return ice_is_fw_api_min_ver(hw, ICE_FW_API_LLDP_FLTR_MAJ_E830, + ICE_FW_API_LLDP_FLTR_MIN_E830, + ICE_FW_API_LLDP_FLTR_PATCH_E830); + if (hw->mac_type == ICE_MAC_E810 || hw->mac_type == ICE_MAC_GENERIC) + return ice_is_fw_api_min_ver(hw, ICE_FW_API_LLDP_FLTR_MAJ, + ICE_FW_API_LLDP_FLTR_MIN, + ICE_FW_API_LLDP_FLTR_PATCH); + return false; } /** diff --git a/drivers/net/intel/ice/base/ice_type.h b/drivers/net/intel/ice/base/ice_type.h index 4b05a800af..6d8c187689 100644 --- a/drivers/net/intel/ice/base/ice_type.h +++ b/drivers/net/intel/ice/base/ice_type.h @@ -1718,11 +1718,16 @@ struct ice_aq_get_set_rss_lut_params { #define GLPCI_LBARCTRL_VF_PE_DB_SIZE_8KB 0x1 #define GLPCI_LBARCTRL_VF_PE_DB_SIZE_64KB 0x2 -/* AQ API version for LLDP_FILTER_CONTROL */ +/* AQ API version for LLDP_FILTER_CONTROL - E810 and E82x */ #define ICE_FW_API_LLDP_FLTR_MAJ 1 #define ICE_FW_API_LLDP_FLTR_MIN 7 #define ICE_FW_API_LLDP_FLTR_PATCH 1 +/* AQ API version for LLDP_FILTER_CONTROL - E830 */ +#define ICE_FW_API_LLDP_FLTR_MAJ_E830 1 +#define ICE_FW_API_LLDP_FLTR_MIN_E830 7 +#define ICE_FW_API_LLDP_FLTR_PATCH_E830 11 + /* AQ API version for report default configuration */ #define ICE_FW_API_REPORT_DFLT_CFG_MAJ 1 #define ICE_FW_API_REPORT_DFLT_CFG_MIN 7 -- 2.47.1

