From 2a1991799ea11c9fe10cffd3f25f06a418e37f35 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 27 Mar 2020 02:15:35 +0100 Subject: [PATCH] eal: move arch-specific C files The arch-specific directories arm, ppc and x86 in common/arch/ are moved at the same level as the OS-specific directories. It makes more clear that EAL is covering a matrix combining OS and arch. Signed-off-by: Thomas Monjalon Reviewed-by: David Christensen Acked-by: David Marchand --- MAINTAINERS | 6 +++--- devtools/build-tags.sh | 7 +++---- lib/librte_eal/arm/meson.build | 8 ++++++++ lib/librte_eal/{common/arch => }/arm/rte_cpuflags.c | 0 lib/librte_eal/{common/arch => }/arm/rte_cycles.c | 0 lib/librte_eal/{common/arch => }/arm/rte_hypervisor.c | 0 lib/librte_eal/common/arch/arm/meson.build | 5 ----- lib/librte_eal/common/arch/ppc | 1 - lib/librte_eal/common/arch/x86/meson.build | 5 ----- lib/librte_eal/common/meson.build | 7 ------- lib/librte_eal/freebsd/eal/Makefile | 2 +- lib/librte_eal/linux/eal/Makefile | 2 +- lib/librte_eal/meson.build | 4 +++- lib/librte_eal/{common/arch/ppc_64 => ppc}/meson.build | 7 +++++-- .../{common/arch/ppc_64 => ppc}/rte_cpuflags.c | 0 lib/librte_eal/{common/arch/ppc_64 => ppc}/rte_cycles.c | 0 .../{common/arch/ppc_64 => ppc}/rte_hypervisor.c | 0 lib/librte_eal/x86/meson.build | 9 +++++++++ lib/librte_eal/{common/arch => }/x86/rte_cpuflags.c | 0 lib/librte_eal/{common/arch => }/x86/rte_cpuid.h | 0 lib/librte_eal/{common/arch => }/x86/rte_cycles.c | 0 lib/librte_eal/{common/arch => }/x86/rte_hypervisor.c | 0 lib/librte_eal/{common/arch => }/x86/rte_spinlock.c | 0 23 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 lib/librte_eal/arm/meson.build rename lib/librte_eal/{common/arch => }/arm/rte_cpuflags.c (100%) rename lib/librte_eal/{common/arch => }/arm/rte_cycles.c (100%) rename lib/librte_eal/{common/arch => }/arm/rte_hypervisor.c (100%) delete mode 100644 lib/librte_eal/common/arch/arm/meson.build delete mode 120000 lib/librte_eal/common/arch/ppc delete mode 100644 lib/librte_eal/common/arch/x86/meson.build rename lib/librte_eal/{common/arch/ppc_64 => ppc}/meson.build (51%) rename lib/librte_eal/{common/arch/ppc_64 => ppc}/rte_cpuflags.c (100%) rename lib/librte_eal/{common/arch/ppc_64 => ppc}/rte_cycles.c (100%) rename lib/librte_eal/{common/arch/ppc_64 => ppc}/rte_hypervisor.c (100%) create mode 100644 lib/librte_eal/x86/meson.build rename lib/librte_eal/{common/arch => }/x86/rte_cpuflags.c (100%) rename lib/librte_eal/{common/arch => }/x86/rte_cpuid.h (100%) rename lib/librte_eal/{common/arch => }/x86/rte_cycles.c (100%) rename lib/librte_eal/{common/arch => }/x86/rte_hypervisor.c (100%) rename lib/librte_eal/{common/arch => }/x86/rte_spinlock.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index a3f1a53c4e..b373efc578 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -261,7 +261,7 @@ F: app/test/test_rand_perf.c ARM v7 M: Jan Viktorin M: Gavin Hu -F: lib/librte_eal/common/arch/arm/ +F: lib/librte_eal/arm/ F: lib/librte_eal/common/include/arch/arm/ ARM v8 @@ -281,7 +281,7 @@ F: drivers/net/virtio/virtio_rxtx_simple_neon.c IBM POWER (alpha) M: David Christensen -F: lib/librte_eal/common/arch/ppc_64/ +F: lib/librte_eal/ppc/ F: lib/librte_eal/common/include/arch/ppc_64/ F: drivers/net/i40e/i40e_rxtx_vec_altivec.c F: examples/l3fwd/*altivec.h @@ -289,7 +289,7 @@ F: examples/l3fwd/*altivec.h Intel x86 M: Bruce Richardson M: Konstantin Ananyev -F: lib/librte_eal/common/arch/x86/ +F: lib/librte_eal/x86/ F: lib/librte_eal/common/include/arch/x86/ Linux EAL (with overlaps) diff --git a/devtools/build-tags.sh b/devtools/build-tags.sh index dc037f92b3..8221f90f70 100755 --- a/devtools/build-tags.sh +++ b/devtools/build-tags.sh @@ -79,7 +79,7 @@ bsd_sources() arm_common() { - find_sources "lib/librte_eal/common/arch/arm" '*.[chS]' + find_sources "lib/librte_eal/arm" '*.[chS]' find_sources "$source_dirs" '*neon*.[chS]' } @@ -100,8 +100,7 @@ arm_64_sources() x86_common() { - find_sources "lib/librte_eal/common/arch/x86" '*.[chS]' - + find_sources "lib/librte_eal/x86" '*.[chS]' find_sources "examples/performance-thread/common/arch/x86" '*.[chS]' find_sources "$source_dirs" '*_sse*.[chS]' find_sources "$source_dirs" '*_avx*.[chS]' @@ -124,7 +123,7 @@ x86_64_sources() ppc_64_sources() { - find_sources "lib/librte_eal/common/arch/ppc_64" '*.[chS]' + find_sources "lib/librte_eal/ppc" '*.[chS]' find_sources "lib/librte_eal/common/include/arch/ppc_64" '*.[chS]' find_sources "$source_dirs" '*altivec*.[chS]' } diff --git a/lib/librte_eal/arm/meson.build b/lib/librte_eal/arm/meson.build new file mode 100644 index 0000000000..f8f7dea9b2 --- /dev/null +++ b/lib/librte_eal/arm/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation. + +sources += files( + 'rte_cpuflags.c', + 'rte_cycles.c', + 'rte_hypervisor.c', +) diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c b/lib/librte_eal/arm/rte_cpuflags.c similarity index 100% rename from lib/librte_eal/common/arch/arm/rte_cpuflags.c rename to lib/librte_eal/arm/rte_cpuflags.c diff --git a/lib/librte_eal/common/arch/arm/rte_cycles.c b/lib/librte_eal/arm/rte_cycles.c similarity index 100% rename from lib/librte_eal/common/arch/arm/rte_cycles.c rename to lib/librte_eal/arm/rte_cycles.c diff --git a/lib/librte_eal/common/arch/arm/rte_hypervisor.c b/lib/librte_eal/arm/rte_hypervisor.c similarity index 100% rename from lib/librte_eal/common/arch/arm/rte_hypervisor.c rename to lib/librte_eal/arm/rte_hypervisor.c diff --git a/lib/librte_eal/common/arch/arm/meson.build b/lib/librte_eal/common/arch/arm/meson.build deleted file mode 100644 index 79731e1a2c..0000000000 --- a/lib/librte_eal/common/arch/arm/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation. - -eal_common_arch_sources = files('rte_cpuflags.c', - 'rte_cycles.c', 'rte_hypervisor.c') diff --git a/lib/librte_eal/common/arch/ppc b/lib/librte_eal/common/arch/ppc deleted file mode 120000 index 2db6a0c918..0000000000 --- a/lib/librte_eal/common/arch/ppc +++ /dev/null @@ -1 +0,0 @@ -ppc_64 \ No newline at end of file diff --git a/lib/librte_eal/common/arch/x86/meson.build b/lib/librte_eal/common/arch/x86/meson.build deleted file mode 100644 index 14bf204c6f..0000000000 --- a/lib/librte_eal/common/arch/x86/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation - -eal_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c', - 'rte_cycles.c', 'rte_hypervisor.c') diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build index 2b97715a20..e666618f7f 100644 --- a/lib/librte_eal/common/meson.build +++ b/lib/librte_eal/common/meson.build @@ -41,13 +41,6 @@ common_sources = files( 'rte_service.c' ) -# get architecture specific sources and objs -eal_common_arch_sources = [] -eal_common_arch_objs = [] -subdir(join_paths('arch', arch_subdir)) -common_sources += eal_common_arch_sources -common_objs += eal_common_arch_objs - common_headers = files( 'include/rte_alarm.h', 'include/rte_branch_prediction.h', diff --git a/lib/librte_eal/freebsd/eal/Makefile b/lib/librte_eal/freebsd/eal/Makefile index b160b57906..e3023f24fa 100644 --- a/lib/librte_eal/freebsd/eal/Makefile +++ b/lib/librte_eal/freebsd/eal/Makefile @@ -7,7 +7,7 @@ LIB = librte_eal.a ARCH_DIR ?= $(RTE_ARCH) VPATH += $(RTE_SDK)/lib/librte_eal/common -VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR) +VPATH += $(RTE_SDK)/lib/librte_eal/$(ARCH_DIR) CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -I$(SRCDIR)/include diff --git a/lib/librte_eal/linux/eal/Makefile b/lib/librte_eal/linux/eal/Makefile index e70cf104a4..177b7c45da 100644 --- a/lib/librte_eal/linux/eal/Makefile +++ b/lib/librte_eal/linux/eal/Makefile @@ -8,7 +8,7 @@ LIB = librte_eal.a ARCH_DIR ?= $(RTE_ARCH) EXPORT_MAP := ../../rte_eal_version.map -VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR) +VPATH += $(RTE_SDK)/lib/librte_eal/$(ARCH_DIR) VPATH += $(RTE_SDK)/lib/librte_eal/common diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index 1730d603fc..16a4f9825e 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -12,6 +12,8 @@ subdir('common') # defines common_sources, common_objs, etc. dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1) subdir(exec_env + '/eal') +subdir(arch_subdir) + allow_experimental_apis = true deps += 'kvargs' if dpdk_conf.has('RTE_USE_LIBBSD') @@ -23,7 +25,7 @@ endif if cc.has_header('getopt.h') cflags += ['-DHAVE_GETOPT_H', '-DHAVE_GETOPT', '-DHAVE_GETOPT_LONG'] endif -sources = common_sources + env_sources +sources += common_sources + env_sources objs = common_objs + env_objs headers = common_headers + env_headers includes = eal_inc diff --git a/lib/librte_eal/common/arch/ppc_64/meson.build b/lib/librte_eal/ppc/meson.build similarity index 51% rename from lib/librte_eal/common/arch/ppc_64/meson.build rename to lib/librte_eal/ppc/meson.build index 40b3dc533a..695b171516 100644 --- a/lib/librte_eal/common/arch/ppc_64/meson.build +++ b/lib/librte_eal/ppc/meson.build @@ -1,5 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Luca Boccassi -eal_common_arch_sources = files('rte_cpuflags.c', - 'rte_cycles.c', 'rte_hypervisor.c') +sources += files( + 'rte_cpuflags.c', + 'rte_cycles.c', + 'rte_hypervisor.c', +) diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c b/lib/librte_eal/ppc/rte_cpuflags.c similarity index 100% rename from lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c rename to lib/librte_eal/ppc/rte_cpuflags.c diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cycles.c b/lib/librte_eal/ppc/rte_cycles.c similarity index 100% rename from lib/librte_eal/common/arch/ppc_64/rte_cycles.c rename to lib/librte_eal/ppc/rte_cycles.c diff --git a/lib/librte_eal/common/arch/ppc_64/rte_hypervisor.c b/lib/librte_eal/ppc/rte_hypervisor.c similarity index 100% rename from lib/librte_eal/common/arch/ppc_64/rte_hypervisor.c rename to lib/librte_eal/ppc/rte_hypervisor.c diff --git a/lib/librte_eal/x86/meson.build b/lib/librte_eal/x86/meson.build new file mode 100644 index 0000000000..252699eebd --- /dev/null +++ b/lib/librte_eal/x86/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation + +sources += files( + 'rte_cpuflags.c', + 'rte_cycles.c', + 'rte_hypervisor.c', + 'rte_spinlock.c', +) diff --git a/lib/librte_eal/common/arch/x86/rte_cpuflags.c b/lib/librte_eal/x86/rte_cpuflags.c similarity index 100% rename from lib/librte_eal/common/arch/x86/rte_cpuflags.c rename to lib/librte_eal/x86/rte_cpuflags.c diff --git a/lib/librte_eal/common/arch/x86/rte_cpuid.h b/lib/librte_eal/x86/rte_cpuid.h similarity index 100% rename from lib/librte_eal/common/arch/x86/rte_cpuid.h rename to lib/librte_eal/x86/rte_cpuid.h diff --git a/lib/librte_eal/common/arch/x86/rte_cycles.c b/lib/librte_eal/x86/rte_cycles.c similarity index 100% rename from lib/librte_eal/common/arch/x86/rte_cycles.c rename to lib/librte_eal/x86/rte_cycles.c diff --git a/lib/librte_eal/common/arch/x86/rte_hypervisor.c b/lib/librte_eal/x86/rte_hypervisor.c similarity index 100% rename from lib/librte_eal/common/arch/x86/rte_hypervisor.c rename to lib/librte_eal/x86/rte_hypervisor.c diff --git a/lib/librte_eal/common/arch/x86/rte_spinlock.c b/lib/librte_eal/x86/rte_spinlock.c similarity index 100% rename from lib/librte_eal/common/arch/x86/rte_spinlock.c rename to lib/librte_eal/x86/rte_spinlock.c -- 2.20.1