OSDN Git Service

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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2022 09:48:49 +0000 (10:48 +0100)
commitc59d606296842409a6e5a4828235b0bd46b12bc4
treef41bd6fb3f1227b8c782bf26f42092d9e8986072
parent7d413735cb18ff73aaba3457b16b08332e8d3cc4
net: hns3: add return value for mailbox handling in PF

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: 63b1279d9905 ("net: hns3: check queue id range before using")
Fixes: 532cfc0df1e4 ("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>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c