From 130894500339b99daf445e35396d43169f5ca441 Mon Sep 17 00:00:00 2001 From: kircher Date: Tue, 8 Nov 2022 15:37:20 +0800 Subject: [PATCH] sync add pdump support in lstack (cherry picked from commit bd94fd820c724568f85cb2c6d9408bb50b0b0712) --- 0121-add-pdump-support-in-lstack.patch | 76 ++++++++++++++++++++++++++ gazelle.spec | 6 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 0121-add-pdump-support-in-lstack.patch diff --git a/0121-add-pdump-support-in-lstack.patch b/0121-add-pdump-support-in-lstack.patch new file mode 100644 index 0000000..39da366 --- /dev/null +++ b/0121-add-pdump-support-in-lstack.patch @@ -0,0 +1,76 @@ +From 421ecec20e2dadf33941ab1b42c2eb592845ff21 Mon Sep 17 00:00:00 2001 +From: kircher +Date: Mon, 7 Nov 2022 23:06:50 +0800 +Subject: [PATCH] add pdump support in lstack + +--- + src/lstack/api/lstack_epoll.c | 18 +++++++----------- + src/lstack/core/lstack_dpdk.c | 9 +++++++++ + 2 files changed, 16 insertions(+), 11 deletions(-) + +diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c +index 6ac049c..6979e12 100644 +--- a/src/lstack/api/lstack_epoll.c ++++ b/src/lstack/api/lstack_epoll.c +@@ -172,11 +172,9 @@ int32_t lstack_do_epoll_create(int32_t fd) + wakeup->epollfd = fd; + sock->wakeup = wakeup; + +- if (!get_global_cfg_params()->app_bind_numa) { +- update_epoll_max_stack(wakeup); +- change_epollfd_kernel_thread(wakeup, wakeup->bind_stack, wakeup->max_stack); +- wakeup->bind_stack = wakeup->max_stack; +- } ++ update_epoll_max_stack(wakeup); ++ change_epollfd_kernel_thread(wakeup, wakeup->bind_stack, wakeup->max_stack); ++ wakeup->bind_stack = wakeup->max_stack; + + return fd; + } +@@ -508,12 +506,10 @@ static int32_t init_poll_wakeup_data(struct wakeup_poll *wakeup) + list_add_node(&stack_group->poll_list, &wakeup->poll_list); + pthread_spin_unlock(&stack_group->poll_list_lock); + +- if (!get_global_cfg_params()->app_bind_numa) { +- int32_t stack_count[PROTOCOL_STACK_MAX] = {0}; +- uint16_t bind_id = find_max_cnt_stack(stack_count, stack_group->stack_num, wakeup->bind_stack); +- change_epollfd_kernel_thread(wakeup, wakeup->bind_stack, stack_group->stacks[bind_id]); +- wakeup->bind_stack = stack_group->stacks[bind_id]; +- } ++ int32_t stack_count[PROTOCOL_STACK_MAX] = {0}; ++ uint16_t bind_id = find_max_cnt_stack(stack_count, stack_group->stack_num, wakeup->bind_stack); ++ change_epollfd_kernel_thread(wakeup, wakeup->bind_stack, stack_group->stacks[bind_id]); ++ wakeup->bind_stack = stack_group->stacks[bind_id]; + + return 0; + } +diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c +index c63fbaa..77ae3eb 100644 +--- a/src/lstack/core/lstack_dpdk.c ++++ b/src/lstack/core/lstack_dpdk.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -104,6 +105,14 @@ int32_t dpdk_eal_init(void) + { + int32_t ret; + struct cfg_params *global_params = get_global_cfg_params(); ++ ++ ret = rte_pdump_init(); ++ if (ret < 0) { ++ LSTACK_PRE_LOG(LSTACK_ERR, "rte_pdump_init failed init, rte_errno %d\n", rte_errno); ++ /* We do not care whether the pdump is successfully loaded. So, just print an alarm. */ ++ } else { ++ LSTACK_PRE_LOG(LSTACK_INFO, "rte_pdump_init success\n"); ++ } + + ret = rte_eal_init(global_params->dpdk_argc, global_params->dpdk_argv); + if (ret < 0) { +-- +2.33.0 + diff --git a/gazelle.spec b/gazelle.spec index fd7b063..c79e0af 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.1 -Release: 19 +Release: 20 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -135,6 +135,7 @@ Patch9117: 0117-add-gro.patch Patch9118: 0118-expand-nic-rx-desc-size.patch Patch9119: 0119-add-kni-local-support-in-lstack.patch Patch9120: 0120-resolve-the-conflict-between-the-eth_dev_ops-variabl.patch +Patch9121: 0121-add-pdump-support-in-lstack.patch %description %{name} is a high performance user-mode stack. @@ -175,6 +176,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Tue Nov 8 2022 kircher - 1.0.1-20 +- add pdump support in lstack + * Sat Nov 07 2022 wuchangsheng - 1.0.1-19 - resolve the conflict between the eth_dev_ops variable and the dpdk-19.11