Skip to content

Commit 36c824c

Browse files
iveceraanguy11
authored andcommitted
i40e: Fix firmware version comparison function
Helper i40e_is_fw_ver_eq() compares incorrectly given firmware version as it returns true when the major version of running firmware is greater than the given major version that is wrong and results in failure during getting of DCB configuration where this helper is used. Fix the check and return true only if the running FW version is exactly equals to the given version. Reproducer: 1. Load i40e driver 2. Check dmesg output [root@host ~]# modprobe i40e [root@host ~]# dmesg | grep 'i40e.*DCB' [ 74.750642] i40e 0000:02:00.0: Query for DCB configuration failed, err -EIO aq_err I40E_AQ_RC_EINVAL [ 74.759770] i40e 0000:02:00.0: DCB init failed -5, disabled [ 74.966550] i40e 0000:02:00.1: Query for DCB configuration failed, err -EIO aq_err I40E_AQ_RC_EINVAL [ 74.975683] i40e 0000:02:00.1: DCB init failed -5, disabled Fixes: cf488e1 ("i40e: Add other helpers to check version of running firmware and AQ API") Signed-off-by: Ivan Vecera <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 6c5b6ca commit 36c824c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_prototype.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,7 @@ static inline bool i40e_is_fw_ver_lt(struct i40e_hw *hw, u16 maj, u16 min)
567567
**/
568568
static inline bool i40e_is_fw_ver_eq(struct i40e_hw *hw, u16 maj, u16 min)
569569
{
570-
return (hw->aq.fw_maj_ver > maj ||
571-
(hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min));
570+
return (hw->aq.fw_maj_ver == maj && hw->aq.fw_min_ver == min);
572571
}
573572

574573
#endif /* _I40E_PROTOTYPE_H_ */

0 commit comments

Comments
 (0)