net: hns3: fix return value error when query MAC link status fail
authorJian Shen <shenjian15@huawei.com>
Tue, 21 Jul 2020 11:03:54 +0000 (19:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:46 +0000 (10:19 +0200)
commit2e6940ea402c8d8529b9a3be1c0c42e39d8f66c3
tree26413b579cc5279100247a82421265d2b12b5d0a
parent3c237fa1a5b4fef7b5fe100d3356f79d13b77b00
net: hns3: fix return value error when query MAC link status fail

[ Upstream commit fac24df7b9a6d9363abdff0e351ade041dd16daa ]

Currently, PF queries the MAC link status per second by calling
function hclge_get_mac_link_status(). It return the error code
when failed to send cmdq command to firmware. It's incorrect,
because this return value is used as the MAC link status, which
0 means link down, and none-zero means link up. So fixes it.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h