Skip to content

Commit

Permalink
net: hns3: fix for FEC configuration
Browse files Browse the repository at this point in the history
The FEC capbility may be changed with port speed changes. Driver
needs to read the active FEC mode, and update FEC capability
when port speed changes.

Fixes: 7e6ec91 ("net: hns3: add support for FEC encoding control")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jian Shen authored and David S. Miller committed May 26, 2019
1 parent d93ed94 commit f438bfe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,9 @@ static void hclge_update_link_status(struct hclge_dev *hdev)

static void hclge_update_port_capability(struct hclge_mac *mac)
{
/* update fec ability by speed */
hclge_convert_setting_fec(mac);

/* firmware can not identify back plane type, the media type
* read from configuration can help deal it
*/
Expand Down Expand Up @@ -2584,6 +2587,10 @@ static int hclge_get_sfp_info(struct hclge_dev *hdev, struct hclge_mac *mac)
mac->speed_ability = le32_to_cpu(resp->speed_ability);
mac->autoneg = resp->autoneg;
mac->support_autoneg = resp->autoneg_ability;
if (!resp->active_fec)
mac->fec_mode = 0;
else
mac->fec_mode = BIT(resp->active_fec);
} else {
mac->speed_type = QUERY_SFP_SPEED;
}
Expand Down

0 comments on commit f438bfe

Please sign in to comment.