From b330a1c5c639d636c5eb08226af1385b1ec9c13b Mon Sep 17 00:00:00 2001 From: Xiaolong Ye Date: Mon, 13 Jan 2020 10:39:39 +0800 Subject: [PATCH] net/i40e/base: fix display of FEC settings Fix display of FEC settings for ethtool. This patch change variable 'phy.link_info.req_fec_info' sent to ethtool. Without this patch wrong FEC settings can be shown. Fixes: 1216fb9f0c8c ("net/i40e/base: store the requested FEC information") Signed-off-by: Jaroslaw Gawin Signed-off-by: Xiaolong Ye Acked-by: Qi Zhang Acked-by: Beilei Xing --- drivers/net/i40e/base/i40e_common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index a37e70599d..9ad0dd654b 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -2911,9 +2911,16 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) if (status) return status; - hw->phy.link_info.req_fec_info = - abilities.fec_cfg_curr_mod_ext_info & - (I40E_AQ_REQUEST_FEC_KR | I40E_AQ_REQUEST_FEC_RS); + if (abilities.fec_cfg_curr_mod_ext_info & + I40E_AQ_ENABLE_FEC_AUTO) + hw->phy.link_info.req_fec_info = + (I40E_AQ_REQUEST_FEC_KR | + I40E_AQ_REQUEST_FEC_RS); + else + hw->phy.link_info.req_fec_info = + abilities.fec_cfg_curr_mod_ext_info & + (I40E_AQ_REQUEST_FEC_KR | + I40E_AQ_REQUEST_FEC_RS); i40e_memcpy(hw->phy.link_info.module_type, &abilities.module_type, sizeof(hw->phy.link_info.module_type), I40E_NONDMA_TO_NONDMA); -- 2.20.1