]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hns3: fix VF wrong speed and duplex issue
authorJijie Shao <shaojijie@huawei.com>
Fri, 10 Nov 2023 09:37:13 +0000 (17:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:23 +0000 (16:56 +0000)
commit359c65daf6b573ab9c866aecddb5a52e66f22c68
tree819d531b1c2a9a355266af8b7dfce80be9511c24
parent406be003d69856c8db15e0f1f2e0f05bee083aef
net: hns3: fix VF wrong speed and duplex issue

[ Upstream commit dff655e82faffc287d4a72a59f66fa120bf904e4 ]

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: 18b6e31f8bf4 ("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>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c