gazelle/0165-remove-dpdk_skip_nic_init-for-dpdk-23.11.patch
yinbin6 9eefc78f74 sync patch from openEuler/gazelle
(cherry picked from commit 1185c3193bc1cc5b7732bfc25cc5ea40b9b47aae)
2024-04-12 17:05:37 +08:00

55 lines
2.1 KiB
Diff

From aae704235da3299fb2d6920aef46afd560ab2c01 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Tue, 9 Apr 2024 17:50:46 +0800
Subject: [PATCH] remove dpdk_skip_nic_init for dpdk-23.11
---
src/lstack/core/lstack_init.c | 4 ++++
src/lstack/include/lstack_dpdk.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c
index f1ef134..79b4060 100644
--- a/src/lstack/core/lstack_init.c
+++ b/src/lstack/core/lstack_init.c
@@ -144,7 +144,9 @@ static void create_control_thread(void)
pthread_t tid;
if (use_ltran()) {
/* The function call here should be in strict order. */
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
dpdk_skip_nic_init();
+#endif
if (control_init_client(false) != 0) {
LSTACK_EXIT(1, "control_init_client failed\n");
}
@@ -279,7 +281,9 @@ __attribute__((constructor)) void gazelle_network_init(void)
/* Init control plane and dpdk init */
create_control_thread();
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
dpdk_restore_pci();
+#endif
/* cancel the core binding from DPDK initialization */
if (!get_global_cfg_params()->main_thread_affinity) {
diff --git a/src/lstack/include/lstack_dpdk.h b/src/lstack/include/lstack_dpdk.h
index c7cfbdf..fe3d07b 100644
--- a/src/lstack/include/lstack_dpdk.h
+++ b/src/lstack/include/lstack_dpdk.h
@@ -48,9 +48,11 @@ int32_t create_shared_ring(struct protocol_stack *stack);
void lstack_log_level_init(void);
int dpdk_ethdev_init(int port_id, bool bond_port);
int dpdk_ethdev_start(void);
+#if RTE_VERSION < RTE_VERSION_NUM(23, 11, 0, 0)
void dpdk_skip_nic_init(void);
-int32_t dpdk_init_lstack_kni(void);
void dpdk_restore_pci(void);
+#endif
+int32_t dpdk_init_lstack_kni(void);
bool port_in_stack_queue(gz_addr_t *src_ip, gz_addr_t *dst_ip, uint16_t src_port, uint16_t dst_port);
struct rte_mempool *create_pktmbuf_mempool(const char *name, uint32_t nb_mbuf,
uint32_t mbuf_cache_size, uint16_t queue_id, unsigned numa_id);
--
2.33.0