net: hns3: add match_id to check mailbox response from PF to VF
authorPeng Li <lipeng321@huawei.com>
Mon, 19 Jul 2021 09:13:06 +0000 (17:13 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Jul 2021 11:12:49 +0000 (13:12 +0200)
commit4671042f1ef0d37137884811afcc4ae67685ce07
treec4b1e544a802303410e8e47aad6c27693f1071f7
parent1b713d14dc3c077ec45e65dab4ea01a8bc41b8c1
net: hns3: add match_id to check mailbox response from PF to VF

When VF need response from PF, VF will wait (1us - 1s) to receive
the response, or it will wait timeout and the VF action fails.
If VF do not receive response in 1st action because timeout,
the 2nd action may receive response for the 1st action, and get
incorrect response data.VF must reciveve the right response from
PF,or it will cause unexpected error.

This patch adds match_id to check mailbox response from PF to VF,
to make sure VF get the right response:
1. The message sent from VF was labelled with match_id which was a
unique 16-bit non-zero value.
2. The response sent from PF will label with match_id which got from
the request.
3. The VF uses the match_id to match request and response message.

This scheme depends on PF driver supports match_id, if PF driver doesn't
support then VF will uses the original scheme.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c