dpdk/0230-net-hns3-fix-mailbox-communication-with-HW.patch
speech_white 6e262cb552 synchronize hns3 bugfixes from upstream
synchronize hns3 bugfixes from upstream

Signed-off-by: speech_white <humin29@huawei.com>
2021-11-01 20:32:31 +08:00

40 lines
1.3 KiB
Diff

From a277f7dbaa54e8ea10f41a7dc4dadec5f08b61b3 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29@huawei.com>
Date: Thu, 28 Oct 2021 19:52:30 +0800
Subject: [PATCH 17/17] net/hns3: fix mailbox communication with HW
Mailbox is the communication mechanism between SW and HW. There exist
two approaches for SW to recognize mailbox message from HW. One way is
using match_id, the other is to compare the message code. The two
approaches are independent and used in different scenarios.
But for the second approach, "next_to_use" should be updated and written
to HW register. If it not done, HW do not know the position SW steps,
then, the communication between SW and HW will turn to be failed.
Fixes: dbbbad23e380 ("net/hns3: fix VF handling LSC event in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/hns3/hns3_mbx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index a4d9afc45..3ad85e721 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -435,6 +435,9 @@ hns3_handle_mbx_msg_out_intr(struct hns3_hw *hw)
scan_next:
next_to_use = (next_to_use + 1) % hw->cmq.crq.desc_num;
}
+
+ crq->next_to_use = next_to_use;
+ hns3_write_dev(hw, HNS3_CMDQ_RX_HEAD_REG, crq->next_to_use);
}
void
--
2.23.0