Skip to content

Commit

Permalink
net/hns3: fix VF mailbox head field
Browse files Browse the repository at this point in the history
[ upstream commit 38d5b71 ]

Currently, the VF mailbox synchronization communication is based on
three fields: head/tail/lost, when head equals tail plus lost, it
means the response is received successfully.

The head field indicates the number of requests that are successfully
sent. If the request sending fails, it should not be updated.

This patch fix the above bug by roll back updates when the sending
fails.

Fixes: 463e748 ("net/hns3: support mailbox")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
fengchengwen authored and steevenlee committed May 8, 2021
1 parent bb24098 commit d0897ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/hns3/hns3_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
hw->mbx_resp.head++;
ret = hns3_cmd_send(hw, &desc, 1);
if (ret) {
hw->mbx_resp.head--;
rte_spinlock_unlock(&hw->mbx_resp.lock);
hns3_err(hw, "VF failed(=%d) to send mbx message to PF",
ret);
Expand Down

0 comments on commit d0897ad

Please sign in to comment.