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:
463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
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);