代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4d12b47a714217615a04f2a084b9c4857167e258 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Thu, 6 Oct 2022 15:14:21 +0800
Subject: [PATCH 12/21] lstack restore pci bus after init
---
src/lstack/core/lstack_dpdk.c | 14 +++++++++++---
src/lstack/core/lstack_init.c | 1 +
src/lstack/include/lstack_dpdk.h | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
index 340ae94..10207d1 100644
--- a/src/lstack/core/lstack_dpdk.c
+++ b/src/lstack/core/lstack_dpdk.c
@@ -53,6 +53,7 @@ struct eth_params {
struct rte_eth_txconf tx_conf;
};
struct rte_kni;
+static rte_bus *g_pci_bus = NULL;
int32_t thread_affinity_default(void)
{
@@ -536,9 +537,16 @@ int32_t dpdk_init_lstack_kni(void)
void dpdk_skip_nic_init(void)
{
/* when lstack init nic again, ltran can't read pkts from nic. unregister pci_bus to avoid init nic in lstack */
- struct rte_bus *pci_bus = rte_bus_find_by_name("pci");
- if (pci_bus != NULL) {
- rte_bus_unregister(pci_bus);
+ g_pci_bus = rte_bus_find_by_name("pci");
+ if (g_pci_bus != NULL) {
+ rte_bus_unregister(g_pci_bus);
+ }
+}
+
+void dpdk_restore_pci(void)
+{
+ if (g_pci_bus != NULL) {
+ rte_bus_register(g_pci_bus);
}
}
diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c
index 9fafda9..b1c69e6 100644
--- a/src/lstack/core/lstack_init.c
+++ b/src/lstack/core/lstack_init.c
@@ -251,6 +251,7 @@ __attribute__((constructor)) void gazelle_network_init(void)
/*
* Init control plane and dpdk init */
create_control_thread();
+ dpdk_restore_pci();
/*
* cancel the core binding from DPDK initialization */
diff --git a/src/lstack/include/lstack_dpdk.h b/src/lstack/include/lstack_dpdk.h
index f0bf4a1..e224f23 100644
--- a/src/lstack/include/lstack_dpdk.h
+++ b/src/lstack/include/lstack_dpdk.h
@@ -50,5 +50,6 @@ int dpdk_ethdev_init(void);
int dpdk_ethdev_start(void);
void dpdk_skip_nic_init(void);
int32_t dpdk_init_lstack_kni(void);
+void dpdk_restore_pci(void);
#endif /* GAZELLE_DPDK_H */
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。