DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, Jan Viktorin <viktorin@rehivetech.com>,
	Gavin Hu <gavin.hu@arm.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	David Christensen <drc@linux.vnet.ibm.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: [dpdk-dev] [PATCH v2 3/8] eal: move arch-specific C files
Date: Fri, 27 Mar 2020 02:15:35 +0100	[thread overview]
Message-ID: <20200327011540.954014-4-thomas@monjalon.net> (raw)
In-Reply-To: <20200327011540.954014-1-thomas@monjalon.net>

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 <thomas@monjalon.net>
---
 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 d30bb6e9dd..a1f1a22833 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -261,7 +261,7 @@ F: app/test/test_rand_perf.c
 ARM v7
 M: Jan Viktorin <viktorin@rehivetech.com>
 M: Gavin Hu <gavin.hu@arm.com>
-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 <drc@linux.vnet.ibm.com>
-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 <bruce.richardson@intel.com>
 M: Konstantin Ananyev <konstantin.ananyev@intel.com>
-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 <bluca@debian.org>
 
-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.25.1


  parent reply	other threads:[~2020-03-27  1:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20  0:12 [dpdk-dev] [PATCH] eal: reorganize directories layout Thomas Monjalon
2020-03-20  9:34 ` Bruce Richardson
2020-03-20 11:46   ` Thomas Monjalon
2020-03-27  1:15 ` [dpdk-dev] [PATCH v2 0/8] " Thomas Monjalon
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 1/8] eal: remove useless makefiles Thomas Monjalon
2020-03-27 12:05     ` Bruce Richardson
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 2/8] build: rename ppc sub-directories Thomas Monjalon
2020-03-27 17:49     ` David Christensen
2020-03-27  1:15   ` Thomas Monjalon [this message]
2020-03-27 17:46     ` [dpdk-dev] [PATCH v2 3/8] eal: move arch-specific C files David Christensen
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 4/8] eal: move arch-specific header files Thomas Monjalon
2020-03-27  2:39     ` Gavin Hu
2020-03-27 17:47     ` David Christensen
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 5/8] eal: simplify meson build of common directory Thomas Monjalon
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 6/8] eal: move common header files Thomas Monjalon
2020-03-30 13:25     ` David Marchand
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 7/8] eal: move OS-specific sub-directories Thomas Monjalon
2020-03-27  1:15   ` [dpdk-dev] [PATCH v2 8/8] eal: clean make and meson files Thomas Monjalon
2020-03-27 14:47   ` [dpdk-dev] [PATCH v2 0/8] eal: reorganize directories layout Stephen Hemminger
2020-03-27 15:12     ` Thomas Monjalon
2020-03-30 14:22   ` David Marchand
2020-03-31 11:13     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200327011540.954014-4-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=gavin.hu@arm.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=viktorin@rehivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).