!678 [sync] PR-672: sync ltran optimize config file error message
From: @openeuler-sync-bot Reviewed-by: @jiangheng12 Signed-off-by: @jiangheng12
This commit is contained in:
commit
fefd5e1ae6
32
0106-fix-dpdk_alloc_pktmbuf-time-consuming.patch
Normal file
32
0106-fix-dpdk_alloc_pktmbuf-time-consuming.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From d40a2e46403547fc8d12ee1dacc6484eca1fbbeb Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiangheng <jiangheng14@huawei.com>
|
||||||
|
Date: Fri, 5 Jan 2024 10:15:22 +0800
|
||||||
|
Subject: [PATCH] fix dpdk_alloc_pktmbuf time-consuming
|
||||||
|
|
||||||
|
---
|
||||||
|
src/lstack/core/lstack_dpdk.c | 7 ++++++-
|
||||||
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
|
||||||
|
index 729a84c..3182bb5 100644
|
||||||
|
--- a/src/lstack/core/lstack_dpdk.c
|
||||||
|
+++ b/src/lstack/core/lstack_dpdk.c
|
||||||
|
@@ -271,9 +271,14 @@ int32_t create_shared_ring(struct protocol_stack *stack)
|
||||||
|
|
||||||
|
int32_t dpdk_alloc_pktmbuf(struct rte_mempool *pool, struct rte_mbuf **mbufs, uint32_t num)
|
||||||
|
{
|
||||||
|
- if (rte_mempool_avail_count(pool) < MBUFPOOL_RESERVE_NUM + num) {
|
||||||
|
+ /*
|
||||||
|
+ * don't use rte_mempool_avail_count, it traverse cpu local cache,
|
||||||
|
+ * when RTE_MAX_LCORE is too large, it's time-consuming
|
||||||
|
+ */
|
||||||
|
+ if (rte_ring_count(pool->pool_data) < MBUFPOOL_RESERVE_NUM + num) {
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
int32_t ret = rte_pktmbuf_alloc_bulk(pool, mbufs, num);
|
||||||
|
if (ret != 0) {
|
||||||
|
LSTACK_LOG(ERR, LSTACK, "rte_pktmbuf_alloc_bulk fail allocNum=%d, ret=%d, info:%s \n",
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
46
0107-ltran-optimize-config-file-error-message.patch
Normal file
46
0107-ltran-optimize-config-file-error-message.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
From e46c71fda9678df02d7373a1bb987cbc3979f1f6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiangheng <jiangheng14@huawei.com>
|
||||||
|
Date: Fri, 5 Jan 2024 18:07:42 +0800
|
||||||
|
Subject: [PATCH] ltran: optimize config file error message
|
||||||
|
|
||||||
|
---
|
||||||
|
src/ltran/ltran_param.c | 13 ++++++++++---
|
||||||
|
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/ltran/ltran_param.c b/src/ltran/ltran_param.c
|
||||||
|
index 11a4bc8..1eaace4 100644
|
||||||
|
--- a/src/ltran/ltran_param.c
|
||||||
|
+++ b/src/ltran/ltran_param.c
|
||||||
|
@@ -664,8 +664,15 @@ struct param_parser g_param_parse_tbl[] = {
|
||||||
|
int32_t parse_config_file_args(const char *conf_file_path, struct ltran_config *ltran_config)
|
||||||
|
{
|
||||||
|
config_t config;
|
||||||
|
- config_init(&config);
|
||||||
|
int32_t ret;
|
||||||
|
+ char real_path[PATH_MAX];
|
||||||
|
+
|
||||||
|
+ if (realpath(conf_file_path, real_path) == NULL) {
|
||||||
|
+ syslog(LOG_ERR, "Err: Config file path %s error, please check conf file path.\n", conf_file_path);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ config_init(&config);
|
||||||
|
|
||||||
|
ret = memset_s(ltran_config, sizeof(struct ltran_config), 0, sizeof(struct ltran_config));
|
||||||
|
if (ret != 0) {
|
||||||
|
@@ -673,10 +680,10 @@ int32_t parse_config_file_args(const char *conf_file_path, struct ltran_config *
|
||||||
|
syslog(LOG_ERR, "memset_s failed\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
- ret = config_read_file(&config, conf_file_path);
|
||||||
|
+ ret = config_read_file(&config, real_path);
|
||||||
|
if (ret == 0) {
|
||||||
|
+ syslog(LOG_ERR, "Err: Read config file \"%s\" error: %s\n", real_path, config_error_text(&config));
|
||||||
|
config_destroy(&config);
|
||||||
|
- syslog(LOG_ERR, "Err: Config file path %s error, please check conf file path.\n", conf_file_path);
|
||||||
|
return -GAZELLE_EPATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
10
gazelle.spec
10
gazelle.spec
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: gazelle
|
Name: gazelle
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 22
|
Release: 23
|
||||||
Summary: gazelle is a high performance user-mode stack
|
Summary: gazelle is a high performance user-mode stack
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
URL: https://gitee.com/openeuler/gazelle
|
URL: https://gitee.com/openeuler/gazelle
|
||||||
@ -116,9 +116,11 @@ Patch9099: 0099-fix-func-separate_str_to_array-overflow-problem.patch
|
|||||||
Patch9100: 0100-fix-func-separate_str_to_array-overflow-problem.patch
|
Patch9100: 0100-fix-func-separate_str_to_array-overflow-problem.patch
|
||||||
Patch9101: 0101-fix-func-separate_str_to_array-overflow-problem.patch
|
Patch9101: 0101-fix-func-separate_str_to_array-overflow-problem.patch
|
||||||
Patch9102: 0102-fix-func-separate_str_to_array-overflow-problem.patch
|
Patch9102: 0102-fix-func-separate_str_to_array-overflow-problem.patch
|
||||||
Patch9103: 0103-fix-func-stack_setup_thread-array-doesn-t-init.patc
|
Patch9103: 0103-fix-func-stack_setup_thread-array-doesn-t-init.patch
|
||||||
Patch9104: 0104-fix-stack_setup_thread-array-range.patch
|
Patch9104: 0104-fix-stack_setup_thread-array-range.patch
|
||||||
Patch9105: 0105-fix-func-separate_str_to_array-overflow-problem.patch
|
Patch9105: 0105-fix-func-separate_str_to_array-overflow-problem.patch
|
||||||
|
Patch9106: 0106-fix-dpdk_alloc_pktmbuf-time-consuming.patch
|
||||||
|
Patch9107: 0107-ltran-optimize-config-file-error-message.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{name} is a high performance user-mode stack.
|
%{name} is a high performance user-mode stack.
|
||||||
@ -160,6 +162,10 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
|
|||||||
%config(noreplace) %{conf_path}/ltran.conf
|
%config(noreplace) %{conf_path}/ltran.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jan 27 2024 yinbin6 <yinbin8@huawei.com> - 1.0.2-23
|
||||||
|
- fix dpdk_alloc_pktmbuf time-consuming
|
||||||
|
- ltran: optimize config file error message
|
||||||
|
|
||||||
* Wed Dec 27 2023 yinbin6 <yinbin8@huawei.com> - 1.0.2-22
|
* Wed Dec 27 2023 yinbin6 <yinbin8@huawei.com> - 1.0.2-22
|
||||||
- fix rte_ring_create/free time consuming
|
- fix rte_ring_create/free time consuming
|
||||||
- use default nonblock mode
|
- use default nonblock mode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user