!180 [sync] PR-177: support gazelle feature

From: @openeuler-sync-bot 
Reviewed-by: @wu-changsheng 
Signed-off-by: @wu-changsheng
This commit is contained in:
openeuler-ci-bot 2022-06-10 11:23:01 +00:00 committed by Gitee
commit 6b37089a38
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 189 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 73a222f904e1c5d69966a7716f5a1fd5c82e66cc Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Thu, 3 Jun 2021 17:31:51 +0800
Subject: [PATCH] fix rte eal sec detach coredump
---
lib/librte_eal/linux/eal/eal.c | 4 +++-
lib/librte_eal/linux/eal/eal_memalloc.c | 5 ++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index ff86ff9..7718e3a 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1616,6 +1616,8 @@ rte_eal_sec_detach(const char *file_prefix, int length)
return -1;
}
- sec_count--;
+ if (sec_count) {
+ sec_count--;
+ }
return 0;
}
diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
index 8e7f120..80646a2 100644
--- a/lib/librte_eal/linux/eal/eal_memalloc.c
+++ b/lib/librte_eal/linux/eal/eal_memalloc.c
@@ -1667,7 +1667,10 @@ eal_memalloc_destroy(const int sec_idx)
int msl_idx = 0;
struct rte_memseg_list *msl;
struct rte_mem_config *mcfg = rte_eal_sec_get_configuration(sec_idx)->mem_config;
-
+
+ if (mcfg == NULL) {
+ return 0;
+ }
for (msl_idx = 0; msl_idx < RTE_MAX_MEMSEG_LISTS; msl_idx++) {
msl = &mcfg->memsegs[msl_idx];
--
2.23.0

View File

@ -0,0 +1,29 @@
From 6271d4d2365298ea7e25fe867605618e559b15a4 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Fri, 11 Jun 2021 17:56:16 +0800
Subject: [PATCH] stuck
---
lib/librte_eal/common/eal_common_memory.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 842fc9b..ffb0c04 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -967,8 +967,10 @@ rte_eal_sec_memory_init(const int sec_idx)
ret = __rte_eal_memory_init(rte_eal_sec_get_runtime_dir(sec_idx),
rte_eal_sec_get_internal_config(sec_idx), rte_cfg,
true, sec_idx);
-
- rte_rwlock_read_unlock(&rte_cfg->mem_config->memory_hotplug_lock);
+ if (ret == 0) {
+ /* when ret != 0 unlock in __rte_eal_memory_init */
+ rte_rwlock_read_unlock(&rte_cfg->mem_config->memory_hotplug_lock);
+ }
return ret;
}
--
2.23.0

View File

@ -0,0 +1,25 @@
From 8f69aa023ffa1ea951615defb24138d7d5ef3db3 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Sun, 18 Jul 2021 19:43:51 +0800
Subject: [PATCH] fix-arfgs
---
lib/librte_eal/linux/eal/eal.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 60074ff..4385031 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -958,8 +958,6 @@ __eal_parse_args(int argc, char **argv, char *runtime_dir, const int buflen,
goto out;
}
- if (optind >= 0)
- argv[optind-1] = prgname;
ret = optind-1;
out:
--
2.23.0

View File

@ -0,0 +1,57 @@
From 9e7b1be6e2d25663b3a997edd0ec8e9e603a770c Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Mon, 19 Jul 2021 23:09:53 +0800
Subject: [PATCH] test
---
lib/librte_eal/common/eal_common_fbarray.c | 15 +++++++++------
lib/librte_eal/linux/eal/eal.c | 1 +
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index d1aa074..adfcd09 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -915,18 +915,21 @@ __rte_fbarray_attach(struct rte_fbarray *arr, const char *runtime_dir,
fd = -1;
}
- /* store our new memory area */
- ma->addr = data;
- ma->fd = fd; /* keep fd until detach/destroy */
- ma->len = mmap_len;
if (!internal_cfg->pri_and_sec) {
+ /* store our new memory area */
+ ma->addr = data;
+ ma->fd = fd; /* keep fd until detach/destroy */
+ ma->len = mmap_len;
+
TAILQ_INSERT_TAIL(&mem_area_tailq, ma, next);
/* we're done */
-
rte_spinlock_unlock(&mem_area_lock);
- }
+ } else {
+ /* pri_and_sec don't use mem_area_tailq */
+ free(ma);
+ }
return 0;
fail:
if (data)
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 4385031..92f1b56 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -608,6 +608,7 @@ eal_sec_config_cleanup(const int sec_idx)
}
memset(lc_rte_cfg, 0, sizeof(*lc_rte_cfg));
+ eal_cleanup_config(lc_internal_cfg);
memset(lc_internal_cfg, 0, sizeof(*lc_internal_cfg));
memset(lc_runtime_dir, 0, PATH_MAX);
--
2.23.0

View File

@ -0,0 +1,26 @@
From d4236bd136c94d8272a145525ac9128d2fefce13 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Wed, 21 Jul 2021 15:13:59 +0800
Subject: [PATCH] fix detach memset rte mem config
eal_memalloc_destroy memset rte_mem_config while detach. rte_mem_config mmap from file witch share with primary proc. this break rte_mem_config of primary proc
---
lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c
index f50954e..e345d94 100644
--- a/lib/librte_eal/linux/eal/eal_memalloc.c
+++ b/lib/librte_eal/linux/eal/eal_memalloc.c
@@ -1688,7 +1688,6 @@ eal_memalloc_destroy(const int sec_idx)
RTE_LOG(ERR, EAL, "Failed to unmap memseg lists\n");
return -1;
}
- memset(msl, 0, sizeof(*msl));
if (fd_list_destroy_walk(msl, sec_idx)) {
RTE_LOG(ERR, EAL, "Failed to clear secondary fd_list.\n");
--
2.23.0

View File

@ -1,6 +1,6 @@
Name: dpdk
Version: 19.11
Release: 15
Release: 16
Packager: packaging@6wind.com
URL: http://dpdk.org
%global source_version 19.11
@ -36,6 +36,11 @@ Patch26: backport-0003-vhost-fix-crash-on-reconnect.patch
Patch27: backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch
Patch28: backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch
Patch29: backport-0006-distributor-fix-128-bit-write-alignment.patch
Patch30: 0014-fix-rte-eal-sec-detach-coredump-count-rollover.patch
Patch31: 0015-fix-rte-eal-memory-init-double-unlock.patch
Patch32: 0016-fix-last-argv-pointer-change-to-first.patch
Patch33: 0017-fix-internal-cfg-and-fbarray-attach-mememory-leak.patch
Patch34: 0018-fix-error-that-the-secondary-attach-fails-due-to-detach.patch
Summary: Data Plane Development Kit core
Group: System Environment/Libraries
@ -185,6 +190,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko
/usr/sbin/depmod
%changelog
* Thu Jun 9 2022 xiusailong <xiusailong@huawei.com> - 19.11-16
- support gazelle feature
* Mon Nov 15 2021 wuchangsheng <wuchangsheng2@huawei.com> - 19.11-15
- backport pathes from community
- net/softnic fix memory leak as profile is freed