mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
net: hns3: fix incorrect resp_msg issue
[ Upstream commita710b9ffbe] In hclge_mbx_handler(), if there are two consecutive mailbox messages that requires resp_msg, the resp_msg is not cleared after processing the first message, which will cause the resp_msg data of second message incorrect. Fix it by clearing the resp_msg before processing every mailbox message. Fixes:bb5790b71b("net: hns3: refactor mailbox response scheme between PF and VF") Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
815eb57e04
commit
09867c500e
|
|
@ -678,7 +678,6 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
|
||||||
unsigned int flag;
|
unsigned int flag;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
memset(&resp_msg, 0, sizeof(resp_msg));
|
|
||||||
/* handle all the mailbox requests in the queue */
|
/* handle all the mailbox requests in the queue */
|
||||||
while (!hclge_cmd_crq_empty(&hdev->hw)) {
|
while (!hclge_cmd_crq_empty(&hdev->hw)) {
|
||||||
if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) {
|
if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) {
|
||||||
|
|
@ -706,6 +705,9 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
|
||||||
|
|
||||||
trace_hclge_pf_mbx_get(hdev, req);
|
trace_hclge_pf_mbx_get(hdev, req);
|
||||||
|
|
||||||
|
/* clear the resp_msg before processing every mailbox message */
|
||||||
|
memset(&resp_msg, 0, sizeof(resp_msg));
|
||||||
|
|
||||||
switch (req->msg.code) {
|
switch (req->msg.code) {
|
||||||
case HCLGE_MBX_MAP_RING_TO_VECTOR:
|
case HCLGE_MBX_MAP_RING_TO_VECTOR:
|
||||||
ret = hclge_map_unmap_ring_to_vf_vector(vport, true,
|
ret = hclge_map_unmap_ring_to_vf_vector(vport, true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user