summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2021-07-19 17:13:06 +0800
committerJakub Kicinski <kuba@kernel.org>2021-07-20 13:12:49 +0200
commit4671042f1ef0d37137884811afcc4ae67685ce07 (patch)
treec4b1e544a802303410e8e47aad6c27693f1071f7 /drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
parent1b713d14dc3c077ec45e65dab4ea01a8bc41b8c1 (diff)
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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
index 56b573e47072..aa86a81c8f4a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
@@ -98,6 +98,7 @@ struct hclgevf_mbx_resp_status {
u32 origin_mbx_msg;
bool received_resp;
int resp_status;
+ u16 match_id;
u8 additional_info[HCLGE_MBX_MAX_RESP_DATA_SIZE];
};