]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: add return value for mailbox handling in PF
authorJian Shen <shenjian15@huawei.com>
Sun, 24 Apr 2022 12:57:25 +0000 (20:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:36 +0000 (09:14 +0200)
commitc1e3f7420720c389c2f97fe82d63b5175597b3a1
tree13a9b37729d7d68eb0d9d80243e147f83983edfa
parentb093b0dfb85b8b3893a53977a75a0a7d65e5dd11
net: hns3: add return value for mailbox handling in PF

[ Upstream commit 0487e1b1f2e6e90b72d6ca4dba1daa61adc6c37f ]

Currently, there are some querying mailboxes sent from VF to PF,
and VF will wait the PF's handling result. For mailbox
HCLGE_MBX_GET_QID_IN_PF and HCLGE_MBX_GET_RSS_KEY, it may fail
when the input parameter is invalid, but the prototype of their
handler function is void. In this case, PF always return success
to VF, which may cause the VF get incorrect result.

Fixes it by adding return value for these function.

Fixes: b146068962fa ("net: hns3: check queue id range before using")
Fixes: 5b048f5c9f91 ("net: hns3: add a check for index in hclge_get_rss_key()")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@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_mbx.c