1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0171-net-bonding-fix-double-slave-link-status-query.patch 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
From 7ec0325f9c2bfe2ea961e66588f8ba9e22bb6483 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 21 Oct 2022 15:36:47 +0800
Subject: [PATCH 171/189] net/bonding: fix double slave link status query
When link status polling mode is used, the slave link status is
queried twice, which may be inconsistent. To fix this, we can keep
the latest queried link state.
Fixes: a45b288ef21a ("bond: support link status polling")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 828fb5f96d..3be2b08128 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2400,9 +2400,6 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg)
* event callback */
if (slave_ethdev->data->dev_link.link_status !=
internals->slaves[i].last_link_status) {
- internals->slaves[i].last_link_status =
- slave_ethdev->data->dev_link.link_status;
-
bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
RTE_ETH_EVENT_INTR_LSC,
&bonded_ethdev->data->port_id,
@@ -2901,7 +2898,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
uint8_t lsc_flag = 0;
int valid_slave = 0;
- uint16_t active_pos;
+ uint16_t active_pos, slave_idx;
uint16_t i;
if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)
@@ -2922,6 +2919,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
for (i = 0; i < internals->slave_count; i++) {
if (internals->slaves[i].port_id == port_id) {
valid_slave = 1;
+ slave_idx = i;
break;
}
}
@@ -3010,6 +3008,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
* slaves
*/
bond_ethdev_link_update(bonded_eth_dev, 0);
+ internals->slaves[slave_idx].last_link_status = link.link_status;
if (lsc_flag) {
/* Cancel any possible outstanding interrupts if delays are enabled */
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助