net/hns3: fix link update when failed to get link info
authorHuisong Li <lihuisong@huawei.com>
Tue, 23 Mar 2021 13:45:55 +0000 (21:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 30 Mar 2021 10:30:46 +0000 (12:30 +0200)
commit398ee80192b1d44026bcf02a27dd62a6d3df236d
tree4ddd9933521993afb9871273e941284508a6efd1
parent8f01e2f847569e8c21f0628389a6e6a8a1c44a31
net/hns3: fix link update when failed to get link info

In the "hns3_dev_link_update" API, the link information of the port is
obtained first, and then 'dev_link' in dev->data is updated. When the
driver is resetting or fails to obtain link info, the current driver
still reports the previous link info to the user. This may cause that
the dev->data->dev_link may be inconsistent with the hw link status.

Therefore, the link status consistency between the hardware, driver,
and framework can be ensured in this interface regardless of whether
the driver is normal or abnormal.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/hns3/hns3_ethdev.c