1 Star 0 Fork 75

chenjiji09/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0161-net-hns3-revert-fix-mailbox-communication-with-HW.patch 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
From e438ad9ab2897ec33b94ee5f31bd1b2fbfc4e36e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 21 Oct 2022 15:36:37 +0800
Subject: [PATCH 161/189] net/hns3: revert fix mailbox communication with HW
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")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@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 b3563d4694..2de55a6417 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -436,8 +436,10 @@ hns3_handle_mbx_msg_out_intr(struct hns3_hw *hw)
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.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chenjiji09/dpdk.git
git@gitee.com:chenjiji09/dpdk.git
chenjiji09
dpdk
dpdk
master

搜索帮助