!152 dpdk升级21.11适配gazelle特性补丁
Merge pull request !152 from 吴昌盛/openEuler-22.03-LTS-Next
This commit is contained in:
commit
9d7e3d2283
81
0002-dpdk-add-secure-compile-option-and-fPIC-option.patch
Normal file
81
0002-dpdk-add-secure-compile-option-and-fPIC-option.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From a655c865fce412d7e661d866bde0df30607fb6a4 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Thu, 16 Dec 2021 20:35:09 +0800
|
||||
Subject: [PATCH] huawei-0001-dpdk-add-secure-compile-option-and-fPIC
|
||||
|
||||
---
|
||||
app/meson.build | 2 ++
|
||||
buildtools/chkincs/meson.build | 2 ++
|
||||
drivers/meson.build | 2 ++
|
||||
examples/meson.build | 2 ++
|
||||
lib/meson.build | 2 ++
|
||||
5 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/app/meson.build b/app/meson.build
|
||||
index 93d8c15032..68be53c92d 100644
|
||||
--- a/app/meson.build
|
||||
+++ b/app/meson.build
|
||||
@@ -21,6 +21,8 @@ apps = [
|
||||
]
|
||||
|
||||
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
|
||||
+default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall', '-Werror']
|
||||
+default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines']
|
||||
default_ldflags = []
|
||||
if get_option('default_library') == 'static' and not is_windows
|
||||
default_ldflags += ['-Wl,--export-dynamic']
|
||||
diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build
|
||||
index 5ffca89761..e3d13a691c 100644
|
||||
--- a/buildtools/chkincs/meson.build
|
||||
+++ b/buildtools/chkincs/meson.build
|
||||
@@ -13,6 +13,8 @@ gen_c_files = generator(gen_c_file_for_header,
|
||||
|
||||
cflags = machine_args
|
||||
cflags += '-DALLOW_EXPERIMENTAL_API'
|
||||
+cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall', '-Werror']
|
||||
+cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines']
|
||||
|
||||
sources = files('main.c')
|
||||
sources += gen_c_files.process(dpdk_chkinc_headers)
|
||||
diff --git a/drivers/meson.build b/drivers/meson.build
|
||||
index d5f4e1c1f2..9e71057afb 100644
|
||||
--- a/drivers/meson.build
|
||||
+++ b/drivers/meson.build
|
||||
@@ -45,6 +45,8 @@ enable_drivers += always_enable
|
||||
default_cflags = machine_args
|
||||
default_cflags += ['-DALLOW_EXPERIMENTAL_API']
|
||||
default_cflags += ['-DALLOW_INTERNAL_API']
|
||||
+default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall', '-Werror']
|
||||
+default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines']
|
||||
|
||||
if cc.has_argument('-Wno-format-truncation')
|
||||
default_cflags += '-Wno-format-truncation'
|
||||
diff --git a/examples/meson.build b/examples/meson.build
|
||||
index bac9b76007..db8603542f 100644
|
||||
--- a/examples/meson.build
|
||||
+++ b/examples/meson.build
|
||||
@@ -90,6 +90,8 @@ default_ldflags = dpdk_extra_ldflags
|
||||
if get_option('default_library') == 'static' and not is_windows
|
||||
default_ldflags += ['-Wl,--export-dynamic']
|
||||
endif
|
||||
+default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall', '-Werror']
|
||||
+default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines']
|
||||
|
||||
foreach example: examples
|
||||
name = example.split('/')[-1]
|
||||
diff --git a/lib/meson.build b/lib/meson.build
|
||||
index 018976df17..668050dcc7 100644
|
||||
--- a/lib/meson.build
|
||||
+++ b/lib/meson.build
|
||||
@@ -94,6 +94,8 @@ endforeach
|
||||
default_cflags = machine_args
|
||||
default_cflags += ['-DALLOW_EXPERIMENTAL_API']
|
||||
default_cflags += ['-DALLOW_INTERNAL_API']
|
||||
+default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall', '-Werror']
|
||||
+default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines']
|
||||
|
||||
if cc.has_argument('-Wno-format-truncation')
|
||||
default_cflags += '-Wno-format-truncation'
|
||||
--
|
||||
2.27.0
|
||||
|
||||
70
0003-dpdk-bugfix-the-deadlock-in-rte_eal_init.patch
Normal file
70
0003-dpdk-bugfix-the-deadlock-in-rte_eal_init.patch
Normal file
@ -0,0 +1,70 @@
|
||||
From 5134068ace9870203f3e25d9f7b48281582fafbd Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Fri, 12 Nov 2021 16:17:36 +0800
|
||||
Subject: [PATCH] huawei-0003-dpdk-bugfix-the-deadlock-in-rte_eal_init
|
||||
|
||||
---
|
||||
lib/eal/linux/eal.c | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index 60b4924838..127b7f7b53 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -1145,7 +1145,7 @@ rte_eal_init(int argc, char **argv)
|
||||
rte_eal_init_alert("Cannot get hugepage information.");
|
||||
rte_errno = EACCES;
|
||||
__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1169,7 +1169,7 @@ rte_eal_init(int argc, char **argv)
|
||||
rte_eal_init_alert("Cannot init logging.");
|
||||
rte_errno = ENOMEM;
|
||||
__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
#ifdef VFIO_PRESENT
|
||||
@@ -1177,7 +1177,7 @@ rte_eal_init(int argc, char **argv)
|
||||
rte_eal_init_alert("Cannot init VFIO");
|
||||
rte_errno = EAGAIN;
|
||||
__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
#endif
|
||||
/* in secondary processes, memory init may allocate additional fbarrays
|
||||
@@ -1187,13 +1187,13 @@ rte_eal_init(int argc, char **argv)
|
||||
if (rte_eal_memzone_init() < 0) {
|
||||
rte_eal_init_alert("Cannot init memzone");
|
||||
rte_errno = ENODEV;
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (rte_eal_memory_init() < 0) {
|
||||
rte_eal_init_alert("Cannot init memory");
|
||||
rte_errno = ENOMEM;
|
||||
- return -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
/* the directories are locked during eal_hugepage_info_init */
|
||||
@@ -1332,6 +1332,10 @@ rte_eal_init(int argc, char **argv)
|
||||
eal_mcfg_complete();
|
||||
|
||||
return fctret;
|
||||
+
|
||||
+out:
|
||||
+ eal_hugedirs_unlock();
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
--
|
||||
2.27.0
|
||||
|
||||
27
0004-dpdk-master-core-donot-set-affinity-in-libstorage.patch
Normal file
27
0004-dpdk-master-core-donot-set-affinity-in-libstorage.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 1d18079dea84bd368605f851738f8f14b917c98d Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Thu, 16 Dec 2021 15:33:11 +0800
|
||||
Subject: [PATCH] huawei-0004-dpdk-master-core-donot-set-affinity-in-libstorage
|
||||
|
||||
---
|
||||
lib/eal/linux/eal.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index 127b7f7b53..47c2186bee 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -1219,7 +1219,9 @@ rte_eal_init(int argc, char **argv)
|
||||
|
||||
eal_check_mem_on_local_socket();
|
||||
|
||||
- if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
|
||||
+ /* Master thread don't set affinity in LibStorage application */
|
||||
+ if (strstr(logid, "LibStorage") != NULL &&
|
||||
+ pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
|
||||
&lcore_config[config->main_lcore].cpuset) != 0) {
|
||||
rte_eal_init_alert("Cannot set affinity");
|
||||
rte_errno = EINVAL;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
25
0005-dpdk-change-the-log-level-in-prepare_numa.patch
Normal file
25
0005-dpdk-change-the-log-level-in-prepare_numa.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From e6009977b9ecb1136489b483e312a5e3e09a5497 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Fri, 12 Nov 2021 17:04:22 +0800
|
||||
Subject: [PATCH] huawei-0005-dpdk-change-the-log-level-in-prepare_numa
|
||||
|
||||
---
|
||||
lib/eal/linux/eal_memalloc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
|
||||
index 337f2bc739..fc354f4a17 100644
|
||||
--- a/lib/eal/linux/eal_memalloc.c
|
||||
+++ b/lib/eal/linux/eal_memalloc.c
|
||||
@@ -167,7 +167,7 @@ prepare_numa(int *oldpolicy, struct bitmask *oldmask, int socket_id)
|
||||
RTE_LOG(DEBUG, EAL, "Trying to obtain current memory policy.\n");
|
||||
if (get_mempolicy(oldpolicy, oldmask->maskp,
|
||||
oldmask->size + 1, 0, 0) < 0) {
|
||||
- RTE_LOG(ERR, EAL,
|
||||
+ RTE_LOG(DEBUG, EAL,
|
||||
"Failed to get current mempolicy: %s. "
|
||||
"Assuming MPOL_DEFAULT.\n", strerror(errno));
|
||||
*oldpolicy = MPOL_DEFAULT;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
34
0006-dpdk-fix-dpdk-coredump-problem.patch
Normal file
34
0006-dpdk-fix-dpdk-coredump-problem.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From a76d953f02beecc057c96159e32e292b847b2d63 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Fri, 12 Nov 2021 17:18:23 +0800
|
||||
Subject: [PATCH] huawei-0006-dpdk-fix-dpdk-coredump-problem
|
||||
|
||||
---
|
||||
lib/eal/linux/eal_interrupts.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
|
||||
index 6e3925efd4..621e43626e 100644
|
||||
--- a/lib/eal/linux/eal_interrupts.c
|
||||
+++ b/lib/eal/linux/eal_interrupts.c
|
||||
@@ -1137,7 +1137,7 @@ eal_intr_thread_main(__rte_unused void *arg)
|
||||
*/
|
||||
if (epoll_ctl(pfd, EPOLL_CTL_ADD, intr_pipe.readfd,
|
||||
&pipe_event) < 0) {
|
||||
- rte_panic("Error adding fd to %d epoll_ctl, %s\n",
|
||||
+ RTE_LOG(ERR, EAL, "Error adding fd to %d epoll_ctl, %s\n",
|
||||
intr_pipe.readfd, strerror(errno));
|
||||
}
|
||||
numfds++;
|
||||
@@ -1159,7 +1159,7 @@ eal_intr_thread_main(__rte_unused void *arg)
|
||||
*/
|
||||
if (epoll_ctl(pfd, EPOLL_CTL_ADD,
|
||||
rte_intr_fd_get(src->intr_handle), &ev) < 0) {
|
||||
- rte_panic("Error adding fd %d epoll_ctl, %s\n",
|
||||
+ RTE_LOG(ERR, EAL, "Error adding fd %d epoll_ctl, %s\n",
|
||||
rte_intr_fd_get(src->intr_handle),
|
||||
strerror(errno));
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
From d0f302751a57cea1ee64261c749f59c4026f7af7 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Thu, 16 Dec 2021 11:46:58 +0800
|
||||
Subject: [PATCH]
|
||||
huawei-0008-dpdk-fix-cpu-flag-error-in-Intel-R-Xeon-R-CPU-E5-262
|
||||
|
||||
---
|
||||
config/meson.build | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/config/meson.build b/config/meson.build
|
||||
index 17b5bec406..293703a90d 100644
|
||||
--- a/config/meson.build
|
||||
+++ b/config/meson.build
|
||||
@@ -121,6 +121,10 @@ if cpu_instruction_set == 'generic'
|
||||
elif host_machine.cpu_family().startswith('ppc')
|
||||
cpu_instruction_set = 'power8'
|
||||
endif
|
||||
+elif host_machine.cpu_family().startswith('x86')
|
||||
+ if cc.get_define('__SSE4_2__', args:'-march=native') == ''
|
||||
+ cpu_instruction_set = 'corei7'
|
||||
+ endif
|
||||
endif
|
||||
|
||||
dpdk_conf.set('RTE_MACHINE', cpu_instruction_set)
|
||||
--
|
||||
2.27.0
|
||||
|
||||
2113
0008-dpdk-add-support-for-gazelle.patch
Normal file
2113
0008-dpdk-add-support-for-gazelle.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
||||
From 9a4c67c47896fb9aa0fd8935813f2016b543a9df Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 16:45:51 +0800
|
||||
Subject: [PATCH]
|
||||
huawei-0008-dpdk-fix-error-in-clearing-secondary-process-memseg-lists
|
||||
|
||||
---
|
||||
lib/eal/common/eal_common_fbarray.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
|
||||
index 9c125c104c..d4a4cea7c1 100644
|
||||
--- a/lib/eal/common/eal_common_fbarray.c
|
||||
+++ b/lib/eal/common/eal_common_fbarray.c
|
||||
@@ -1102,7 +1102,7 @@ int
|
||||
rte_sec_fbarray_destroy(struct rte_fbarray *arr,
|
||||
const int sec_idx)
|
||||
{
|
||||
- int fd, ret;
|
||||
+ int fd;
|
||||
char path[PATH_MAX];
|
||||
|
||||
if (arr == NULL) {
|
||||
@@ -1128,15 +1128,13 @@ rte_sec_fbarray_destroy(struct rte_fbarray *arr,
|
||||
if (flock(fd, LOCK_EX | LOCK_NB)) {
|
||||
RTE_LOG(DEBUG, EAL, "Cannot destroy fbarray - another process is using it\n");
|
||||
rte_errno = EBUSY;
|
||||
- ret = -1;
|
||||
} else {
|
||||
- ret = 0;
|
||||
unlink(path);
|
||||
memset(arr, 0, sizeof(*arr));
|
||||
}
|
||||
close(fd);
|
||||
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 097d8acb68c7d7dbfd7800c7f69eaf171ce9da4b Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 16:49:16 +0800
|
||||
Subject: [PATCH] 0009
|
||||
|
||||
---
|
||||
lib/eal/linux/eal.c | 17 ++++++++++++++---
|
||||
1 file changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index f269e67fae..2555043155 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -524,22 +524,29 @@ rte_config_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void
|
||||
+static int
|
||||
rte_sec_config_init(const int sec_idx)
|
||||
{
|
||||
int mem_cfg_fd = -1;
|
||||
int mmap_flags = PROT_READ | PROT_WRITE;
|
||||
+ int ret = -1;
|
||||
|
||||
struct rte_config *rte_cfg = rte_eal_sec_get_configuration(sec_idx);
|
||||
struct internal_config *internal_conf = rte_eal_sec_get_internal_config(sec_idx);
|
||||
|
||||
rte_cfg->process_type = internal_conf->process_type;
|
||||
|
||||
- __rte_eal_config_attach(mmap_flags, &mem_cfg_fd,
|
||||
+ ret = __rte_eal_config_attach(mmap_flags, &mem_cfg_fd,
|
||||
rte_eal_sec_get_runtime_dir(sec_idx),
|
||||
internal_conf, rte_cfg);
|
||||
+ if (ret < 0) {
|
||||
+ RTE_LOG(ERR, EAL, "Cannot attach shared memory\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
|
||||
close(mem_cfg_fd);
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1561,7 +1568,11 @@ rte_eal_sec_attach(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- rte_sec_config_init(sec_idx);
|
||||
+ ret = rte_sec_config_init(sec_idx);
|
||||
+ if (ret < 0) {
|
||||
+ RTE_LOG(ERR, EAL, "Cannot init sec config\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
ret = rte_eal_sec_memory_init(sec_idx);
|
||||
if (ret < 0) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
From dad8149d187448f85be497ce3bb6c34bf1ffde5e Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 16:54:03 +0800
|
||||
Subject: [PATCH] 0010
|
||||
|
||||
---
|
||||
lib/eal/common/eal_common_fbarray.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
|
||||
index d4a4cea7c1..fa726cd2f5 100644
|
||||
--- a/lib/eal/common/eal_common_fbarray.c
|
||||
+++ b/lib/eal/common/eal_common_fbarray.c
|
||||
@@ -1122,8 +1122,8 @@ rte_sec_fbarray_destroy(struct rte_fbarray *arr,
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
- RTE_LOG(ERR, EAL, "Could not open fbarray file: %s\n", strerror(errno));
|
||||
- return -1;
|
||||
+ RTE_LOG(WARNING, EAL, "Could not open %s: %s, and just skip it\n", path, strerror(errno));
|
||||
+ return 0;
|
||||
}
|
||||
if (flock(fd, LOCK_EX | LOCK_NB)) {
|
||||
RTE_LOG(DEBUG, EAL, "Cannot destroy fbarray - another process is using it\n");
|
||||
--
|
||||
2.27.0
|
||||
|
||||
42
0012-fix-rte-eal-sec-detach-coredump-count-rollover.patch
Normal file
42
0012-fix-rte-eal-sec-detach-coredump-count-rollover.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 8ca5f1cfbea80f7524eb2f2dfa67760be80666c3 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 16:57:31 +0800
|
||||
Subject: [PATCH] 0011
|
||||
|
||||
---
|
||||
lib/eal/linux/eal.c | 4 +++-
|
||||
lib/eal/linux/eal_memalloc.c | 4 ++++
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index 2555043155..c833b46c36 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -1627,6 +1627,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/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
|
||||
index dac9098c8c..38543bf8c4 100644
|
||||
--- a/lib/eal/linux/eal_memalloc.c
|
||||
+++ b/lib/eal/linux/eal_memalloc.c
|
||||
@@ -1814,6 +1814,10 @@ eal_sec_memalloc_destroy(const int sec_idx)
|
||||
struct rte_mem_config *mcfg = rte_eal_sec_get_configuration(sec_idx)->mem_config;
|
||||
int i, ret = 0;
|
||||
|
||||
+ if (mcfg == NULL) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < RTE_MAX_MEMSEG_LISTS; i++) {
|
||||
struct rte_memseg_list *msl = &mcfg->memsegs[i];
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
29
0013-fix-rte-eal-memory-init-double-unlock.patch
Normal file
29
0013-fix-rte-eal-memory-init-double-unlock.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From d9e578c64144bf35e3141d2a3f3ada2763534cb2 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Thu, 16 Dec 2021 19:26:51 +0800
|
||||
Subject: [PATCH] huawei-0015-fix-rte-eal-memory-init-double-unlock
|
||||
|
||||
---
|
||||
lib/eal/common/eal_common_memory.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
|
||||
index 15ce4341b0..d983e37cc8 100644
|
||||
--- a/lib/eal/common/eal_common_memory.c
|
||||
+++ b/lib/eal/common/eal_common_memory.c
|
||||
@@ -1150,8 +1150,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.27.0
|
||||
|
||||
25
0014-fix-last-argv-pointer-change-to-first.patch
Normal file
25
0014-fix-last-argv-pointer-change-to-first.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 23113e9f48414f534358274a732921cd3f5345cf Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Thu, 16 Dec 2021 20:12:42 +0800
|
||||
Subject: [PATCH] huawei-0016-fix-last-argv-pointer-change-to-first
|
||||
|
||||
---
|
||||
lib/eal/linux/eal.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index 16bb2b60cc..78c61a1979 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -935,8 +935,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.27.0
|
||||
|
||||
55
0015-fix-internal-cfg-and-fbarray-attach-mememory-leak.patch
Normal file
55
0015-fix-internal-cfg-and-fbarray-attach-mememory-leak.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From 847cbe34e8e45a0c0613cf5cd96f06ee31ada0f9 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 17:02:16 +0800
|
||||
Subject: [PATCH] 0014
|
||||
|
||||
---
|
||||
lib/eal/common/eal_common_fbarray.c | 13 ++++++++-----
|
||||
lib/eal/linux/eal.c | 1 +
|
||||
2 files changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
|
||||
index fa726cd2f5..b809d3c669 100644
|
||||
--- a/lib/eal/common/eal_common_fbarray.c
|
||||
+++ b/lib/eal/common/eal_common_fbarray.c
|
||||
@@ -911,17 +911,20 @@ __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_conf->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:
|
||||
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
|
||||
index f70c4d55fa..2dee945be4 100644
|
||||
--- a/lib/eal/linux/eal.c
|
||||
+++ b/lib/eal/linux/eal.c
|
||||
@@ -564,6 +564,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.27.0
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
From e8466bb5c02192727a140688df0c8882ed35ca59 Mon Sep 17 00:00:00 2001
|
||||
From: Changsheng Wu <wuchangsheng2@huawei.com>
|
||||
Date: Sat, 18 Dec 2021 17:09:27 +0800
|
||||
Subject: [PATCH] 15
|
||||
|
||||
---
|
||||
lib/eal/linux/eal_memalloc.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
|
||||
index d5fe856dd8..38543bf8c4 100644
|
||||
--- a/lib/eal/linux/eal_memalloc.c
|
||||
+++ b/lib/eal/linux/eal_memalloc.c
|
||||
@@ -1830,7 +1830,6 @@ eal_sec_memalloc_destroy(const int sec_idx)
|
||||
return ret;
|
||||
|
||||
rte_mem_unmap(msl->base_va, msl->len);
|
||||
- memset(msl, 0, sizeof(*msl));
|
||||
}
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
111
dpdk.spec
111
dpdk.spec
@ -1,25 +1,33 @@
|
||||
Name: dpdk
|
||||
Version: 21.11
|
||||
Release: 1
|
||||
Release: 2
|
||||
Packager: packaging@6wind.com
|
||||
URL: http://dpdk.org
|
||||
%global source_version 21.11
|
||||
Source: https://git.dpdk.org/dpdk/snapshot/%{name}-%{version}.tar.xz
|
||||
|
||||
Patch0: add-igb-uio.patch
|
||||
Patch9001: 0001-add-igb-uio.patch
|
||||
Patch9002: 0002-dpdk-add-secure-compile-option-and-fPIC-option.patch
|
||||
Patch9003: 0003-dpdk-bugfix-the-deadlock-in-rte_eal_init.patch
|
||||
Patch9004: 0004-dpdk-master-core-donot-set-affinity-in-libstorage.patch
|
||||
Patch9005: 0005-dpdk-change-the-log-level-in-prepare_numa.patch
|
||||
Patch9006: 0006-dpdk-fix-dpdk-coredump-problem.patch
|
||||
Patch9007: 0007-dpdk-fix-cpu-flag-error-in-Intel-R-Xeon-R-CPU-E5-262.patch
|
||||
Patch9008: 0008-dpdk-add-support-for-gazelle.patch
|
||||
Patch9009: 0009-dpdk-fix-error-in-clearing-secondary-process-memseg-lists.patch
|
||||
Patch9010: 0010-dpdk-fix-coredump-when-primary-process-attach-without-shared-file.patch
|
||||
Patch9011: 0011-dpdk-fix-fbarray-memseg-destory-error-during-detach.patch
|
||||
Patch9012: 0012-fix-rte-eal-sec-detach-coredump-count-rollover.patch
|
||||
Patch9013: 0013-fix-rte-eal-memory-init-double-unlock.patch
|
||||
Patch9014: 0014-fix-last-argv-pointer-change-to-first.patch
|
||||
Patch9015: 0015-fix-internal-cfg-and-fbarray-attach-mememory-leak.patch
|
||||
Patch9016: 0016-fix-error-that-the-secondary-attach-fails-due-to-detach.patch
|
||||
|
||||
Summary: Data Plane Development Kit core
|
||||
Group: System Environment/Libraries
|
||||
License: BSD and LGPLv2 and GPLv2
|
||||
|
||||
ExclusiveArch: i686 x86_64 aarch64
|
||||
%ifarch aarch64
|
||||
%global machine armv8a
|
||||
%global target arm64-%{machine}-linux-gcc
|
||||
%else
|
||||
%global machine native
|
||||
%global target x86_64-%{machine}-linux-gcc
|
||||
%endif
|
||||
|
||||
BuildRequires: meson ninja-build gcc diffutils python3-pyelftools python-pyelftools
|
||||
BuildRequires: kernel-devel numactl-devel
|
||||
@ -62,83 +70,42 @@ This package contains the pdump tool for capture the dpdk network packets.
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
meson %{target} -Ddisable_drivers=*/octeontx2 -Ddisable_drivers=*/fpga* -Ddisable_drivers=*/ifpga* -Denable_kmods=true
|
||||
ninja -C %{target}
|
||||
meson build
|
||||
ninja -C build
|
||||
|
||||
%install
|
||||
namer=%{kern_devel_ver}
|
||||
DESTDIR=$RPM_BUILD_ROOT/ meson install -C %{target}
|
||||
DESTDIR=$RPM_BUILD_ROOT/ ninja install -C %{target}
|
||||
DESTDIR=$RPM_BUILD_ROOT/ ninja install -C build
|
||||
|
||||
cd $RPM_BUILD_ROOT
|
||||
file `find -type f`| grep -w ELF | awk -F":" '{print $1}' | grep -v ko | for i in `xargs`
|
||||
do
|
||||
chrpath -d $i
|
||||
done
|
||||
cd -
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/lib64
|
||||
mv $RPM_BUILD_ROOT/usr/local/lib64/* $RPM_BUILD_ROOT/usr/lib64/
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
|
||||
echo "%{_bindir}/%{name}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
echo "/usr/local/bin/%{name}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
echo "/lib64/%{name}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
echo "/usr/local/lib64" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
echo "/usr/local/include" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/dpdk/%{target}
|
||||
ln -fs %{buildroot}/usr/local/include %{buildroot}/usr/share/dpdk/%{target}/include
|
||||
ln -fs %{buildroot}/usr/local/lib64 %{buildroot}/usr/share/dpdk/%{target}/lib
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
|
||||
ln -fs /usr/local/bin/dpdk-devbind.py $RPM_BUILD_ROOT/usr/local/bin/dpdk-devbind
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
||||
ln -fs /usr/local/bin/dpdk-devbind.py %{buildroot}/usr/sbin/dpdk-devbind
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_eal.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_mempool.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_ring.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/drivers/librte_mempool_ring.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_pci.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/drivers/librte_bus_pci.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_kvargs.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_acl.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_ethdev.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_mbuf.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_cmdline.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_net.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_meter.so* $RPM_BUILD_ROOT/lib64/
|
||||
cp -ar ./%{target}/lib/librte_telemetry.so* $RPM_BUILD_ROOT/lib64/
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||
cp ./%{target}/app/dpdk-pdump $RPM_BUILD_ROOT/usr/bin
|
||||
|
||||
strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko
|
||||
strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/igb_uio.ko
|
||||
strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/rte_kni.ko
|
||||
strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko
|
||||
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
%define _build_id_links none
|
||||
|
||||
%files
|
||||
/usr/local/bin/*.py
|
||||
/lib/modules/%{kern_devel_ver}/extra/dpdk/*
|
||||
/lib64/librte*.so*
|
||||
%{_sbindir}/dpdk-devbind
|
||||
%config(noreplace) /etc/ld.so.conf.d/*
|
||||
/usr/local/lib64/*
|
||||
%exclude /usr/local/lib64/*.a
|
||||
/usr/local/bin/*
|
||||
%exclude /usr/local/bin/dpdk-test*
|
||||
%exclude /usr/local/bin/dpdk-pdump
|
||||
/usr/local/bin/dpdk-devbind
|
||||
/lib/modules/%{kern_devel_ver}/extra/dpdk/*.ko
|
||||
/usr/lib64/*.so*
|
||||
|
||||
%files devel
|
||||
%dir /usr/local/include/
|
||||
/usr/local/include/*.h
|
||||
/usr/local/include/generic/*.h
|
||||
/usr/local/share/dpdk/examples/*
|
||||
/usr/share/dpdk/%{target}/include/*
|
||||
/usr/local/lib64/*.a
|
||||
/usr/local/include
|
||||
/usr/lib64/*.a
|
||||
|
||||
%files doc
|
||||
|
||||
%files tools
|
||||
/usr/bin/dpdk-pdump
|
||||
/usr/local/bin/dpdk-pdump
|
||||
/usr/local/bin/dpdk-dumpcap
|
||||
/usr/local/bin/dpdk-proc-info
|
||||
/usr/local/bin/dpdk-test
|
||||
/usr/local/bin/dpdk-testpmd
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
@ -149,10 +116,14 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/igb_uio.ko
|
||||
/usr/sbin/depmod
|
||||
|
||||
%changelog
|
||||
* Sat Dec 25 2021 wuchangsheng <wuchangsheng2@huawei.com> - 21.11-2
|
||||
- remove redundant file in rpm
|
||||
- add gazelle support
|
||||
|
||||
* Fri Dec 17 2021 jiangheng <jiangheng12@huawei.com> - 21.11-1
|
||||
- update to 21.11
|
||||
|
||||
* Sat Dec 17 2021 Min Hu <humin29@huawei.com> - 20.11-10
|
||||
* Fri Dec 17 2021 Min Hu <humin29@huawei.com> - 20.11-10
|
||||
- sync patches ranges from versoin 9 t0 17 from master branch
|
||||
|
||||
* Mon Sep 13 2021 chenchen <chen_aka_jan@163.com> - 20.11-9
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user