提交 681cf91c 编写于 作者: Y Yonglong Liu

net: hns3: add barrier in vf mailbox reply process

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7OQCS
CVE: NA

----------------------------

In hclgevf_mbx_handler() and hclgevf_get_mbx_resp() functions,
there is a typical store-store and load-load scenario between
received_resp and additional_info. This patch adds barrier
to fix the problem.
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
上级 dcd93089
......@@ -82,6 +82,9 @@ static int hclgevf_get_mbx_resp(struct hclgevf_dev *hdev, u16 code0, u16 code1,
i++;
}
/* ensure additional_info will be seen after received_resp */
smp_rmb();
if (i >= HCLGEVF_MAX_TRY_TIMES) {
dev_err(&hdev->pdev->dev,
"VF could not get mbx(%u,%u) resp(=%d) from PF in %d tries\n",
......@@ -240,6 +243,11 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
temp++;
}
/* ensure additional_info will be seen before setting
* received_resp
*/
smp_wmb();
if (req->match_id) {
/* If match_id is not zero, it means PF support
* match_id. If the match_id is right, VF get
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册