Skip to content

Commit 6ad3da7

Browse files
Jijie Shaosmb49
authored andcommitted
net: hns3: fix VF wrong speed and duplex issue
BugLink: https://bugs.launchpad.net/bugs/2050038 [ Upstream commit dff655e ] If PF is down, firmware will returns 10 Mbit/s rate and half-duplex mode when PF queries the port information from firmware. After imp reset command is executed, PF status changes to down, and PF will query link status and updates port information from firmware in a periodic scheduled task. However, there is a low probability that port information is updated when PF is down, and then PF link status changes to up. In this case, PF synchronizes incorrect rate and duplex mode to VF. This patch fixes it by updating port information before PF synchronizes the rate and duplex to the VF when PF changes to up. Fixes: 18b6e31 ("net: hns3: PF add support for pushing link status to VFs") Signed-off-by: Jijie Shao <shaojijie@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 0433709 commit 6ad3da7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static void hclge_sync_promisc_mode(struct hclge_dev *hdev);
7272
static void hclge_sync_fd_table(struct hclge_dev *hdev);
7373
static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret,
7474
int wait_cnt);
75+
static int hclge_update_port_info(struct hclge_dev *hdev);
7576

7677
static struct hnae3_ae_algo ae_algo;
7778

@@ -2950,6 +2951,9 @@ static void hclge_update_link_status(struct hclge_dev *hdev)
29502951

29512952
if (state != hdev->hw.mac.link) {
29522953
hdev->hw.mac.link = state;
2954+
if (state == HCLGE_LINK_STATUS_UP)
2955+
hclge_update_port_info(hdev);
2956+
29532957
client->ops->link_status_change(handle, state);
29542958
hclge_config_mac_tnl_int(hdev, state);
29552959
if (rclient && rclient->ops->link_status_change)

0 commit comments

Comments
 (0)