patch 'net/hns3: revert fix mailbox communication with HW' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 3 10:27:47 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/05/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1fa481da5bdd86946062f431901db52ae3bfd835

Thanks.

Luca Boccassi

---
>From 1fa481da5bdd86946062f431901db52ae3bfd835 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Fri, 30 Sep 2022 15:22:18 +0800
Subject: [PATCH] net/hns3: revert fix mailbox communication with HW

[ upstream commit e0ec62d6e9185890716761ba00d9775d82507293 ]

VF's command receive queue was mainly used to receive mailbox messages
from PF. There are two type mailbox messages: request response message
and message pushed by PF.

There are two types of threads that can handle these messages:
1) the interrupt thread of the main process: it could handle both types
of messages.
2) other threads: it could only handle request response messages.

The collaboration mechanism between the two type threads is that other
threads set the opcode of processed messages to zero so that the
interrupt thread of the main process does not process these messages
again. Because other threads can only process part of the messages,
after the processing is complete, the next-to-use pointer of the
command receive queue should not be updated. Otherwise, some messages
(e.g. messages pushed by PF) maybe discarded.

Unfortunately, the patch to be reverted updates next-to-use pointer of
the command receive queue in other threads context, and this will lead
to discard some mailbox message.

So this commit reverts
commit 599ef84add7e ("net/hns3: fix mailbox communication with HW")

Fixes: 599ef84add7e ("net/hns3: fix mailbox communication with HW")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
 drivers/net/hns3/hns3_mbx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index 1c95eb219d..e8d336f516 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -442,8 +442,10 @@ 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);
+	/*
+	 * Note: the crq->next_to_use field should not updated, otherwise,
+	 * mailbox messages may be discarded.
+	 */
 }
 
 void
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-03 09:27:30.899653474 +0000
+++ 0089-net-hns3-revert-fix-mailbox-communication-with-HW.patch	2022-11-03 09:27:25.549425848 +0000
@@ -1 +1 @@
-From e0ec62d6e9185890716761ba00d9775d82507293 Mon Sep 17 00:00:00 2001
+From 1fa481da5bdd86946062f431901db52ae3bfd835 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e0ec62d6e9185890716761ba00d9775d82507293 ]
+
@@ -31 +32,0 @@
-Cc: stable at dpdk.org
@@ -40 +41 @@
-index 02028dcd9c..910a16c999 100644
+index 1c95eb219d..e8d336f516 100644
@@ -43 +44 @@
-@@ -436,8 +436,10 @@ scan_next:
+@@ -442,8 +442,10 @@ scan_next:


More information about the stable mailing list