From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24155A0547; Thu, 28 Oct 2021 13:54:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D961541100; Thu, 28 Oct 2021 13:54:29 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 41E1840DF4 for ; Thu, 28 Oct 2021 13:54:28 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Hg3p41t4VzZcVc; Thu, 28 Oct 2021 19:52:28 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Thu, 28 Oct 2021 19:54:25 +0800 From: "Min Hu (Connor)" To: CC: , Date: Thu, 28 Oct 2021 19:52:30 +0800 Message-ID: <20211028115230.27047-1-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/hns3: fix mailbox communication with HW X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Mailbox is the communication mechanism between SW and HW. There exist two approaches for SW to recongnize 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 approache, "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) --- 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 a47622b8a6..245652e2ed 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.33.0