Skip to contentSkip to conversation

split architecture specific operations

PATCH Applied David Marchand 4 participants 14 messages Oct 28, 2014 – Nov 5, 2014 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

v3 cover split architecture specific operations

The set of patches split x86 architecture specific operations from DPDK and put them to x86 arch directory.
This will make the adoption of DPDK much easier on other computer architecture. For a new architecture, just add an architecture specific directory and necessary building configuration files, then DPDK eal library can support it.

Reviewing patchset from Chao, I ended up modifying it along the way, so here is a new iteration of this patchset.

Changes since Chao v2 patchset :

- added a preliminary patch for moving rte_atomic.h (for better readability)
- fixed documentation generation
- implemented a generic header for each arch specific header (cpuflags, memcpy, prefetch were missing)
- removed C++ stuff from generic headers
- centralised all doxygen stuff in generic headers (no need to have duplicates)
- refactored rte_cycles functions
- moved vmware tsc stuff to arch rte_cycles.h headers
- finished x86 factorisation

Little summary of current state :

- all applications continue to include the eal headers as before, these headers are the arch-specific ones
- the arch specific headers always include the generic ones. The generic headers contain the doxygen documentation and code common to all architectures
- a x86 architecture has been defined which handles both 32bits and 64bits peculiarities

It builds fine for 32/64 bits (w and w/o "force intrinsics"), but I really would like a lot of eyes on this (and I would say, especially, rte_cycles, rte_memcpy and rte_cpuflags).
I still have some concerns about the use of intrinsics for architecture != x86 but I think Chao will be the best to look at this.

Signature · 79 lines
David Marchand

Chao Zhu (7):
  eal: split atomic operations to architecture specific
  eal: split byte order operations to architecture specific
  eal: split CPU cycle operation to architecture specific
  eal: split prefetch operations to architecture specific
  eal: split spinlock operations to architecture specific
  eal: split memcpy operation to architecture specific
  eal: split CPU flags operations to architecture specific

David Marchand (3):
  eal: move rte_atomic.h header
  eal: install all arch headers
  eal: factorize x86 headers

 doc/api/doxy-api.conf                              |    1 +
 lib/librte_eal/common/Makefile                     |   24 +-
 lib/librte_eal/common/eal_common_cpuflags.c        |  190 ----
 .../common/include/arch/x86/rte_atomic.h           |  216 ++++
 .../common/include/arch/x86/rte_atomic_32.h        |  222 ++++
 .../common/include/arch/x86/rte_atomic_64.h        |  191 ++++
 .../common/include/arch/x86/rte_byteorder.h        |  121 +++
 .../common/include/arch/x86/rte_byteorder_32.h     |   51 +
 .../common/include/arch/x86/rte_byteorder_64.h     |   52 +
 .../common/include/arch/x86/rte_cpuflags.h         |  310 ++++++
 .../common/include/arch/x86/rte_cycles.h           |  121 +++
 .../common/include/arch/x86/rte_memcpy.h           |  297 +++++
 .../common/include/arch/x86/rte_prefetch.h         |   62 ++
 .../common/include/arch/x86/rte_spinlock.h         |   94 ++
 lib/librte_eal/common/include/generic/rte_atomic.h |  918 ++++++++++++++++
 .../common/include/generic/rte_byteorder.h         |  189 ++++
 .../common/include/generic/rte_cpuflags.h          |  110 ++
 lib/librte_eal/common/include/generic/rte_cycles.h |  209 ++++
 lib/librte_eal/common/include/generic/rte_memcpy.h |  144 +++
 .../common/include/generic/rte_prefetch.h          |   71 ++
 .../common/include/generic/rte_spinlock.h          |  226 ++++
 .../common/include/i686/arch/rte_atomic.h          |  373 -------
 lib/librte_eal/common/include/rte_atomic.h         | 1133 --------------------
 lib/librte_eal/common/include/rte_byteorder.h      |  270 -----
 lib/librte_eal/common/include/rte_cpuflags.h       |  182 ----
 lib/librte_eal/common/include/rte_cycles.h         |  266 -----
 lib/librte_eal/common/include/rte_memcpy.h         |  376 -------
 lib/librte_eal/common/include/rte_prefetch.h       |   88 --
 lib/librte_eal/common/include/rte_spinlock.h       |  258 -----
 .../common/include/x86_64/arch/rte_atomic.h        |  335 ------
 mk/arch/i686/rte.vars.mk                           |    2 +
 mk/arch/x86_64/rte.vars.mk                         |    2 +
 32 files changed, 3624 insertions(+), 3480 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder_32.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_spinlock.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/i686/arch/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/rte_byteorder.h
 delete mode 100644 lib/librte_eal/common/include/rte_cpuflags.h
 delete mode 100644 lib/librte_eal/common/include/rte_cycles.h
 delete mode 100644 lib/librte_eal/common/include/rte_memcpy.h
 delete mode 100644 lib/librte_eal/common/include/rte_prefetch.h
 delete mode 100644 lib/librte_eal/common/include/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/x86_64/arch/rte_atomic.h

-- 
1.7.10.4

A message that is not in the archive (sent off-list or not yet received): 1414500657-23774-1-git-send-email-david.marchand-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH v3 1/10 eal: move rte_atomic.h header

This breaks compilation but is a preliminary step for headers rework.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 .../common/include/arch/i686/rte_atomic.h          |  373 ++++++++++++++++++++
 .../common/include/arch/x86_64/rte_atomic.h        |  335 ++++++++++++++++++
 .../common/include/i686/arch/rte_atomic.h          |  373 --------------------
 .../common/include/x86_64/arch/rte_atomic.h        |  335 ------------------
 5 files changed, 710 insertions(+), 710 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/i686/arch/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/x86_64/arch/rte_atomic.h
lib/librte_eal/common/Makefile +2 -2
index 7f27966..6603c61 100644
@@ -49,8 +49,8 @@ endif
 ARCH_INC := rte_atomic.h
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
-SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include/arch := \
-	$(addprefix include/$(RTE_ARCH)/arch/,$(ARCH_INC))
+SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include += \
+	$(addprefix include/arch/$(RTE_ARCH)/,$(ARCH_INC))
 
 # add libc if configured
 DEPDIRS-$(CONFIG_RTE_LIBC) += lib/libc
lib/librte_eal/common/include/arch/i686/rte_atomic.h new file +373 -0

373 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_atomic.h new file +335 -0

335 lines not on this page · raw message

lib/librte_eal/common/include/i686/arch/rte_atomic.h deleted +0 -373

373 lines not on this page · raw message

lib/librte_eal/common/include/x86_64/arch/rte_atomic.h deleted +0 -335

335 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#3 lore raw

PATCH v3 2/10 eal: split atomic operations to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch first adds architecture specific directories to eal. Then split the atomic operations to architecture specific and generic files. Architecture specific files are put into the corresponding architecture directory and common header are put into generic directory.

Update documentation generation with new generic/ directory.

---
 doc/api/doxy-api.conf                              |    1 +
 lib/librte_eal/common/Makefile                     |    7 +-
 .../common/include/arch/i686/rte_atomic.h          |  322 +++---
 .../common/include/arch/x86_64/rte_atomic.h        |  321 +++---
 lib/librte_eal/common/include/generic/rte_atomic.h |  918 ++++++++++++++++
 lib/librte_eal/common/include/rte_atomic.h         | 1133 --------------------
 6 files changed, 1269 insertions(+), 1433 deletions(-)
 create mode 100644 lib/librte_eal/common/include/generic/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/rte_atomic.h
doc/api/doxy-api.conf +1 -0
index fe3879f..27c782c 100644
@@ -31,6 +31,7 @@
 PROJECT_NAME            = DPDK
 INPUT                   = doc/api/doxy-api-index.md \
                           lib/librte_eal/common/include \
+                          lib/librte_eal/common/include/generic \
                           lib/librte_acl \
                           lib/librte_distributor \
                           lib/librte_ether \
lib/librte_eal/common/Makefile +5 -2
index 6603c61..8ab363b 100644
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-INC := rte_atomic.h rte_branch_prediction.h rte_byteorder.h rte_common.h
+INC := rte_branch_prediction.h rte_byteorder.h rte_common.h
 INC += rte_cycles.h rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_prefetch.h rte_random.h
@@ -46,11 +46,14 @@ ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
 INC += rte_warnings.h
 endif
 
-ARCH_INC := rte_atomic.h
+GENERIC_INC := rte_atomic.h
+ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include += \
 	$(addprefix include/arch/$(RTE_ARCH)/,$(ARCH_INC))
+SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include/generic := \
+	$(addprefix include/generic/,$(GENERIC_INC))
 
 # add libc if configured
 DEPDIRS-$(CONFIG_RTE_LIBC) += lib/libc
lib/librte_eal/common/include/arch/i686/rte_atomic.h +171 -151

413 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_atomic.h +174 -147

417 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_atomic.h new file +918 -0

918 lines not on this page · raw message

lib/librte_eal/common/include/rte_atomic.h deleted +0 -1133

1,133 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#4 lore raw

PATCH v3 3/10 eal: split byte order operations to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits the byte order operations from DPDK and push them to architecture specific arch directories, so that other processor architecture to support DPDK can be easily adopted.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 .../common/include/arch/i686/rte_byteorder.h       |  129 ++++++++++
 .../common/include/arch/x86_64/rte_byteorder.h     |  130 ++++++++++
 .../common/include/generic/rte_byteorder.h         |  189 ++++++++++++++
 lib/librte_eal/common/include/rte_byteorder.h      |  270 --------------------
 5 files changed, 450 insertions(+), 272 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_byteorder.h
 delete mode 100644 lib/librte_eal/common/include/rte_byteorder.h
lib/librte_eal/common/Makefile +2 -2
index 8ab363b..62a39cd 100644
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-INC := rte_branch_prediction.h rte_byteorder.h rte_common.h
+INC := rte_branch_prediction.h rte_common.h
 INC += rte_cycles.h rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_prefetch.h rte_random.h
@@ -46,7 +46,7 @@ ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
 INC += rte_warnings.h
 endif
 
-GENERIC_INC := rte_atomic.h
+GENERIC_INC := rte_atomic.h rte_byteorder.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/include/arch/i686/rte_byteorder.h new file +129 -0

129 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_byteorder.h new file +130 -0

130 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_byteorder.h new file +189 -0

189 lines not on this page · raw message

lib/librte_eal/common/include/rte_byteorder.h deleted +0 -270

270 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#5 lore raw

PATCH v3 4/10 eal: split CPU cycle operation to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits the CPU TSC read operations from DPDK and push them to architecture specific arch directories, so that other processors that don't have tsc register can implement its own functions.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 .../common/include/arch/i686/rte_cycles.h          |  121 +++++++++
 .../common/include/arch/x86_64/rte_cycles.h        |  121 +++++++++
 lib/librte_eal/common/include/generic/rte_cycles.h |  209 +++++++++++++++
 lib/librte_eal/common/include/rte_cycles.h         |  266 --------------------
 5 files changed, 453 insertions(+), 268 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cycles.h
 delete mode 100644 lib/librte_eal/common/include/rte_cycles.h
lib/librte_eal/common/Makefile +2 -2
index 62a39cd..c6aedf9 100644
@@ -32,7 +32,7 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 INC := rte_branch_prediction.h rte_common.h
-INC += rte_cycles.h rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
+INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_prefetch.h rte_random.h
 INC += rte_rwlock.h rte_spinlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
@@ -46,7 +46,7 @@ ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
 INC += rte_warnings.h
 endif
 
-GENERIC_INC := rte_atomic.h rte_byteorder.h
+GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/include/arch/i686/rte_cycles.h new file +121 -0

121 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_cycles.h new file +121 -0

121 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_cycles.h new file +209 -0

209 lines not on this page · raw message

lib/librte_eal/common/include/rte_cycles.h deleted +0 -266

266 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#6 lore raw

PATCH v3 5/10 eal: split prefetch operations to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits the prefetch operations from DPDK and push them to architecture specific arch directories, so that other processor architecture to support DPDK can implement their own functions.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 .../common/include/arch/i686/rte_prefetch.h        |   62 ++++++++++++++
 .../common/include/arch/x86_64/rte_prefetch.h      |   62 ++++++++++++++
 .../common/include/generic/rte_prefetch.h          |   71 ++++++++++++++++
 lib/librte_eal/common/include/rte_prefetch.h       |   88 --------------------
 5 files changed, 197 insertions(+), 90 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_prefetch.h
 delete mode 100644 lib/librte_eal/common/include/rte_prefetch.h
lib/librte_eal/common/Makefile +2 -2
index c6aedf9..9808c9f 100644
@@ -34,7 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
-INC += rte_pci_dev_ids.h rte_per_lcore.h rte_prefetch.h rte_random.h
+INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
 INC += rte_rwlock.h rte_spinlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
@@ -46,7 +46,7 @@ ifeq ($(CONFIG_RTE_INSECURE_FUNCTION_WARNING),y)
 INC += rte_warnings.h
 endif
 
-GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h
+GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/include/arch/i686/rte_prefetch.h new file +62 -0

62 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_prefetch.h new file +62 -0

62 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_prefetch.h new file +71 -0

71 lines not on this page · raw message

lib/librte_eal/common/include/rte_prefetch.h deleted +0 -88

88 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#7 lore raw

PATCH v3 6/10 eal: split spinlock operations to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits the spinlock operations from DPDK and push them to architecture specific arch directories, so that other processor architecture to support DPDK can be easily adopted.

---
 lib/librte_eal/common/Makefile                     |    3 +-
 .../common/include/arch/i686/rte_spinlock.h        |   94 +++++++
 .../common/include/arch/x86_64/rte_spinlock.h      |   94 +++++++
 .../common/include/generic/rte_spinlock.h          |  226 +++++++++++++++++
 lib/librte_eal/common/include/rte_spinlock.h       |  258 --------------------
 5 files changed, 416 insertions(+), 259 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_spinlock.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_spinlock.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/rte_spinlock.h
lib/librte_eal/common/Makefile +2 -1
index 9808c9f..2394443 100644
@@ -35,7 +35,7 @@ INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
-INC += rte_rwlock.h rte_spinlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
+INC += rte_rwlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
 INC += rte_hexdump.h rte_devargs.h rte_dev.h
@@ -47,6 +47,7 @@ INC += rte_warnings.h
 endif
 
 GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
+GENERIC_INC += rte_spinlock.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/include/arch/i686/rte_spinlock.h new file +94 -0

94 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_spinlock.h new file +94 -0

94 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_spinlock.h new file +226 -0

226 lines not on this page · raw message

lib/librte_eal/common/include/rte_spinlock.h deleted +0 -258

258 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#8 lore raw

PATCH v3 7/10 eal: split memcpy operation to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits the SSE based memory copy function from DPDK and push them to architecture specific arch directories. Other processor architecture can implement its own vector based memory copy functions.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 .../common/include/arch/i686/rte_memcpy.h          |  297 ++++++++++++++++
 .../common/include/arch/x86_64/rte_memcpy.h        |  297 ++++++++++++++++
 lib/librte_eal/common/include/generic/rte_memcpy.h |  144 ++++++++
 lib/librte_eal/common/include/rte_memcpy.h         |  376 --------------------
 5 files changed, 740 insertions(+), 378 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_memcpy.h
 delete mode 100644 lib/librte_eal/common/include/rte_memcpy.h
lib/librte_eal/common/Makefile +2 -2
index 2394443..f9f98dc 100644
@@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
-INC += rte_log.h rte_memcpy.h rte_memory.h rte_memzone.h rte_pci.h
+INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
 INC += rte_rwlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
@@ -47,7 +47,7 @@ INC += rte_warnings.h
 endif
 
 GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
-GENERIC_INC += rte_spinlock.h
+GENERIC_INC += rte_spinlock.h rte_memcpy.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/include/arch/i686/rte_memcpy.h new file +297 -0

297 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_memcpy.h new file +297 -0

297 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_memcpy.h new file +144 -0

144 lines not on this page · raw message

lib/librte_eal/common/include/rte_memcpy.h deleted +0 -376

376 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#9 lore raw

PATCH v3 8/10 eal: split CPU flags operations to architecture specific

In reply to a message not in the archive

From: Chao Zhu <[email protected]>

This patch splits CPU flags related operations from DPDK and push them to architecture specific arch directories, so that other processor architecture can implement its own CPU flag functions to support DPDK.

---
 lib/librte_eal/common/Makefile                     |    4 +-
 lib/librte_eal/common/eal_common_cpuflags.c        |  190 ------------
 .../common/include/arch/i686/rte_cpuflags.h        |  310 ++++++++++++++++++++
 .../common/include/arch/x86_64/rte_cpuflags.h      |  310 ++++++++++++++++++++
 .../common/include/generic/rte_cpuflags.h          |  110 +++++++
 lib/librte_eal/common/include/rte_cpuflags.h       |  182 ------------
 6 files changed, 732 insertions(+), 374 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/i686/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cpuflags.h
 delete mode 100644 lib/librte_eal/common/include/rte_cpuflags.h
lib/librte_eal/common/Makefile +2 -2
index f9f98dc..ddf8b48 100644
@@ -36,7 +36,7 @@ INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
 INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
 INC += rte_rwlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
-INC += rte_string_fns.h rte_cpuflags.h rte_version.h rte_tailq_elem.h
+INC += rte_string_fns.h rte_version.h rte_tailq_elem.h
 INC += rte_eal_memconfig.h rte_malloc_heap.h
 INC += rte_hexdump.h rte_devargs.h rte_dev.h
 INC += rte_common_vect.h
@@ -47,7 +47,7 @@ INC += rte_warnings.h
 endif
 
 GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
-GENERIC_INC += rte_spinlock.h rte_memcpy.h
+GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h
 ARCH_INC := $(GENERIC_INC)
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
lib/librte_eal/common/eal_common_cpuflags.c +0 -190

202 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_cpuflags.h new file +310 -0

310 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_cpuflags.h new file +310 -0

310 lines not on this page · raw message

lib/librte_eal/common/include/generic/rte_cpuflags.h new file +110 -0

110 lines not on this page · raw message

lib/librte_eal/common/include/rte_cpuflags.h deleted +0 -182

182 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#10 lore raw

PATCH v3 9/10 eal: install all arch headers

In reply to a message not in the archive

Architecture can have their own specific headers, just install all headers from arch directory.

---
 lib/librte_eal/common/Makefile |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
lib/librte_eal/common/Makefile +4 -2
index ddf8b48..499ba4d 100644
@@ -48,11 +48,13 @@ endif
 
 GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
 GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h
-ARCH_INC := $(GENERIC_INC)
+# defined in mk/arch/$(RTE_ARCH)/rte.vars.mk
+ARCH_DIR ?= $(RTE_ARCH)
+ARCH_INC := $(notdir $(wildcard $(RTE_SDK)/lib/librte_eal/common/include/arch/$(ARCH_DIR)/*.h))
 
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include := $(addprefix include/,$(INC))
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include += \
-	$(addprefix include/arch/$(RTE_ARCH)/,$(ARCH_INC))
+	$(addprefix include/arch/$(ARCH_DIR)/,$(ARCH_INC))
 SYMLINK-$(CONFIG_RTE_LIBRTE_EAL)-include/generic := \
 	$(addprefix include/generic/,$(GENERIC_INC))
 
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH v3 10/10 eal: factorize x86 headers

In reply to a message not in the archive

No need to keep the same code duplicated for 32 and 64bits x86.

---
 .../common/include/arch/i686/rte_atomic.h          |  393 --------------------
 .../common/include/arch/i686/rte_byteorder.h       |  129 -------
 .../common/include/arch/i686/rte_cpuflags.h        |  310 ---------------
 .../common/include/arch/i686/rte_cycles.h          |  121 ------
 .../common/include/arch/i686/rte_memcpy.h          |  297 ---------------
 .../common/include/arch/i686/rte_prefetch.h        |   62 ---
 .../common/include/arch/i686/rte_spinlock.h        |   94 -----
 .../common/include/arch/x86/rte_atomic.h           |  216 +++++++++++
 .../common/include/arch/x86/rte_atomic_32.h        |  222 +++++++++++
 .../common/include/arch/x86/rte_atomic_64.h        |  191 ++++++++++
 .../common/include/arch/x86/rte_byteorder.h        |  121 ++++++
 .../common/include/arch/x86/rte_byteorder_32.h     |   51 +++
 .../common/include/arch/x86/rte_byteorder_64.h     |   52 +++
 .../common/include/arch/x86/rte_cpuflags.h         |  310 +++++++++++++++
 .../common/include/arch/x86/rte_cycles.h           |  121 ++++++
 .../common/include/arch/x86/rte_memcpy.h           |  297 +++++++++++++++
 .../common/include/arch/x86/rte_prefetch.h         |   62 +++
 .../common/include/arch/x86/rte_spinlock.h         |   94 +++++
 .../common/include/arch/x86_64/rte_atomic.h        |  362 ------------------
 .../common/include/arch/x86_64/rte_byteorder.h     |  130 -------
 .../common/include/arch/x86_64/rte_cpuflags.h      |  310 ---------------
 .../common/include/arch/x86_64/rte_cycles.h        |  121 ------
 .../common/include/arch/x86_64/rte_memcpy.h        |  297 ---------------
 .../common/include/arch/x86_64/rte_prefetch.h      |   62 ---
 .../common/include/arch/x86_64/rte_spinlock.h      |   94 -----
 mk/arch/i686/rte.vars.mk                           |    2 +
 mk/arch/x86_64/rte.vars.mk                         |    2 +
 27 files changed, 1741 insertions(+), 2782 deletions(-)
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_byteorder.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_cpuflags.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_cycles.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_memcpy.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_prefetch.h
 delete mode 100644 lib/librte_eal/common/include/arch/i686/rte_spinlock.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder_32.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_byteorder.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_cpuflags.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_cycles.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_memcpy.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_prefetch.h
 delete mode 100644 lib/librte_eal/common/include/arch/x86_64/rte_spinlock.h
lib/librte_eal/common/include/arch/i686/rte_atomic.h deleted +0 -393
deleted file mode 100644
index 8330250..0000000
@@ -1,393 +0,0 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Inspired from FreeBSD src/sys/i386/include/atomic.h
- * Copyright (c) 1998 Doug Rabson
- * All rights reserved.
- */
-
-#ifndef _RTE_ATOMIC_I686_H_
-#define _RTE_ATOMIC_I686_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <emmintrin.h>
-#include "generic/rte_atomic.h"
-
-#if RTE_MAX_LCORE == 1
-#define MPLOCKED                        /**< No need to insert MP lock prefix. */
-#else
-#define MPLOCKED        "lock ; "       /**< Insert MP lock prefix. */
-#endif
-
-#define	rte_mb() _mm_mfence()
-
-#define	rte_wmb() _mm_sfence()
-
-#define	rte_rmb() _mm_lfence()
-
-/*------------------------- 16 bit atomic operations -------------------------*/
-
-#ifndef RTE_FORCE_INTRINSICS
-static inline int
-rte_atomic16_cmpset(volatile uint16_t *dst, uint16_t exp, uint16_t src)
-{
-	uint8_t res;
-
-	asm volatile(
-			MPLOCKED
-			"cmpxchgw %[src], %[dst];"
-			"sete %[res];"
-			: [res] "=a" (res),     /* output */
-			  [dst] "=m" (*dst)
-			: [src] "r" (src),      /* input */
-			  "a" (exp),
-			  "m" (*dst)
-			: "memory");            /* no-clobber list */
-	return res;
-}
-
-static inline int rte_atomic16_test_and_set(rte_atomic16_t *v)
-{
-	return rte_atomic16_cmpset((volatile uint16_t *)&v->cnt, 0, 1);
-}
-
-static inline void
-rte_atomic16_inc(rte_atomic16_t *v)
-{
-	asm volatile(
-			MPLOCKED
-			"incw %[cnt]"
-			: [cnt] "=m" (v->cnt)   /* output */
-			: "m" (v->cnt)          /* input */
-			);
-}
-
-static inline void
-rte_atomic16_dec(rte_atomic16_t *v)
-{
-	asm volatile(
-			MPLOCKED
-			"decw %[cnt]"
-			: [cnt] "=m" (v->cnt)   /* output */
-			: "m" (v->cnt)          /* input */
-			);
-}
-
-static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)
-{
-	uint8_t ret;
-
-	asm volatile(
-			MPLOCKED
-			"incw %[cnt] ; "
-			"sete %[ret]"
-			: [cnt] "+m" (v->cnt),  /* output */
-			  [ret] "=qm" (ret)
-			);
-	return (ret != 0);
-}
-
-static inline int rte_atomic16_dec_and_test(rte_atomic16_t *v)
-{
-	uint8_t ret;
-
-	asm volatile(MPLOCKED
-			"decw %[cnt] ; "
-			"sete %[ret]"
-			: [cnt] "+m" (v->cnt),  /* output */
-			  [ret] "=qm" (ret)
-			);
-	return (ret != 0);
-}
-
-/*------------------------- 32 bit atomic operations -------------------------*/
-
-static inline int
-rte_atomic32_cmpset(volatile uint32_t *dst, uint32_t exp, uint32_t src)
-{
-	uint8_t res;
-
-	asm volatile(
-			MPLOCKED
-			"cmpxchgl %[src], %[dst];"
-			"sete %[res];"
-			: [res] "=a" (res),     /* output */
-			  [dst] "=m" (*dst)
-			: [src] "r" (src),      /* input */
-			  "a" (exp),
-			  "m" (*dst)
-			: "memory");            /* no-clobber list */
-	return res;
-}
-
-static inline int rte_atomic32_test_and_set(rte_atomic32_t *v)
-{
-	return rte_atomic32_cmpset((volatile uint32_t *)&v->cnt, 0, 1);
-}
-
-static inline void
-rte_atomic32_inc(rte_atomic32_t *v)
-{
-	asm volatile(
-			MPLOCKED
-			"incl %[cnt]"
-			: [cnt] "=m" (v->cnt)   /* output */
-			: "m" (v->cnt)          /* input */
-			);
-}
-
-static inline void
-rte_atomic32_dec(rte_atomic32_t *v)
-{
-	asm volatile(
-			MPLOCKED
-			"decl %[cnt]"
-			: [cnt] "=m" (v->cnt)   /* output */
-			: "m" (v->cnt)          /* input */
-			);
-}
-
-static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)
-{
-	uint8_t ret;
-
-	asm volatile(
-			MPLOCKED
-			"incl %[cnt] ; "
-			"sete %[ret]"
-			: [cnt] "+m" (v->cnt),  /* output */
-			  [ret] "=qm" (ret)
-			);
-	return (ret != 0);
-}
-
-static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
-{
-	uint8_t ret;
-
-	asm volatile(MPLOCKED
-			"decl %[cnt] ; "
-			"sete %[ret]"
-			: [cnt] "+m" (v->cnt),  /* output */
-			  [ret] "=qm" (ret)
-			);
-	return (ret != 0);
-}
-
-/*------------------------- 64 bit atomic operations -------------------------*/
-
-static inline int
-rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src)
-{
-	uint8_t res;
-	union {
-		struct {
-			uint32_t l32;
-			uint32_t h32;
-		};
-		uint64_t u64;
-	} _exp, _src;
-
-	_exp.u64 = exp;
-	_src.u64 = src;
-
-#ifndef __PIC__
-    asm volatile (
-            MPLOCKED
-            "cmpxchg8b (%[dst]);"
-            "setz %[res];"
-            : [res] "=a" (res)      /* result in eax */
-            : [dst] "S" (dst),      /* esi */
-             "b" (_src.l32),       /* ebx */
-             "c" (_src.h32),       /* ecx */
-             "a" (_exp.l32),       /* eax */
-             "d" (_exp.h32)        /* edx */
-			: "memory" );           /* no-clobber list */
-#else
-	asm volatile (
-            "mov %%ebx, %%edi\n"
-			MPLOCKED
-			"cmpxchg8b (%[dst]);"
-			"setz %[res];"
-            "xchgl %%ebx, %%edi;\n"
-			: [res] "=a" (res)      /* result in eax */
-			: [dst] "S" (dst),      /* esi */
-			  "D" (_src.l32),       /* ebx */
-			  "c" (_src.h32),       /* ecx */
-			  "a" (_exp.l32),       /* eax */
-			  "d" (_exp.h32)        /* edx */
-			: "memory" );           /* no-clobber list */
-#endif
-
-	return res;
-}
-
-static inline void
-rte_atomic64_init(rte_atomic64_t *v)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, 0);
-	}
-}
-
-static inline int64_t
-rte_atomic64_read(rte_atomic64_t *v)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		/* replace the value by itself */
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, tmp);
-	}
-	return tmp;
-}
-
-static inline void
-rte_atomic64_set(rte_atomic64_t *v, int64_t new_value)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, new_value);
-	}
-}
-
-static inline void
-rte_atomic64_add(rte_atomic64_t *v, int64_t inc)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, tmp + inc);
-	}
-}
-
-static inline void
-rte_atomic64_sub(rte_atomic64_t *v, int64_t dec)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, tmp - dec);
-	}
-}
-
-static inline void
-rte_atomic64_inc(rte_atomic64_t *v)
-{
-	rte_atomic64_add(v, 1);
-}
-
-static inline void
-rte_atomic64_dec(rte_atomic64_t *v)
-{
-	rte_atomic64_sub(v, 1);
-}
-
-static inline int64_t
-rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, tmp + inc);
-	}
-
-	return tmp + inc;
-}
-
-static inline int64_t
-rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)
-{
-	int success = 0;
-	uint64_t tmp;
-
-	while (success == 0) {
-		tmp = v->cnt;
-		success = rte_atomic64_cmpset((volatile uint64_t *)&v->cnt,
-		                              tmp, tmp - dec);
-	}
-
-	return tmp - dec;
-}
-
-static inline int rte_atomic64_inc_and_test(rte_atomic64_t *v)
-{
-	return rte_atomic64_add_return(v, 1) == 0;
-}
-
-static inline int rte_atomic64_dec_and_test(rte_atomic64_t *v)
-{
-	return rte_atomic64_sub_return(v, 1) == 0;
-}
-
-static inline int rte_atomic64_test_and_set(rte_atomic64_t *v)
-{
-	return rte_atomic64_cmpset((volatile uint64_t *)&v->cnt, 0, 1);
-}
-
-static inline void rte_atomic64_clear(rte_atomic64_t *v)
-{
-	rte_atomic64_set(v, 0);
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _RTE_ATOMIC_I686_H_ */
lib/librte_eal/common/include/arch/i686/rte_byteorder.h deleted +0 -129

129 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_cpuflags.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_cycles.h deleted +0 -121

121 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_memcpy.h deleted +0 -297

297 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_prefetch.h deleted +0 -62

62 lines not on this page · raw message

lib/librte_eal/common/include/arch/i686/rte_spinlock.h deleted +0 -94

94 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_atomic.h new file +216 -0

216 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_atomic_32.h new file +222 -0

222 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_atomic_64.h new file +191 -0

191 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_byteorder.h new file +121 -0

121 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_byteorder_32.h new file +51 -0

51 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_byteorder_64.h new file +52 -0

52 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h new file +310 -0

310 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_cycles.h new file +121 -0

121 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_memcpy.h new file +297 -0

297 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_prefetch.h new file +62 -0

13 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86/rte_spinlock.h new file +94 -0

94 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_atomic.h deleted +0 -362

362 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_byteorder.h deleted +0 -130

130 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_cpuflags.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_cycles.h deleted +0 -121

121 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_memcpy.h deleted +0 -297

297 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_prefetch.h deleted +0 -62

62 lines not on this page · raw message

lib/librte_eal/common/include/arch/x86_64/rte_spinlock.h deleted +0 -94

94 lines not on this page · raw message

mk/arch/i686/rte.vars.mk +2 -0
index 8d56ca7..8ba9a23 100644

Lines of this file are not shown. View the raw message.

mk/arch/x86_64/rte.vars.mk +2 -0
index 51bd477..b986f04 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.10.4

Part of the diff is not shown here. View the raw message.

#12 lore raw
In reply to a message not in the archive

David,

I acked the set of patches.

Thanks a lot!

Best Regards!
------------------------------
Chao Zhu

From:   David Marchand <[email protected]>
To:     [email protected]
Cc Chao CH Zhu/China/IBM@IBMCN
Date:   2014/10/28 20:50
Subject:        [PATCH v3 00/10] split architecture specific operations

The set of patches split x86 architecture specific operations from DPDK and put
them to x86 arch directory.
This will make the adoption of DPDK much easier on other computer architecture.
For a new architecture, just add an architecture specific directory and necessary building configuration files, then DPDK eal library can support it.

Reviewing patchset from Chao, I ended up modifying it along the way, so here is a new iteration of this patchset.

Changes since Chao v2 patchset :

- added a preliminary patch for moving rte_atomic.h (for better readability)
- fixed documentation generation
- implemented a generic header for each arch specific header (cpuflags, memcpy,
prefetch were missing)
- removed C++ stuff from generic headers
- centralised all doxygen stuff in generic headers (no need to have duplicates)
- refactored rte_cycles functions
- moved vmware tsc stuff to arch rte_cycles.h headers
- finished x86 factorisation

Little summary of current state :

- all applications continue to include the eal headers as before, these headers
are the arch-specific ones
- the arch specific headers always include the generic ones. The generic headers
contain the doxygen documentation and code common to all architectures
- a x86 architecture has been defined which handles both 32bits and 64bits peculiarities

It builds fine for 32/64 bits (w and w/o "force intrinsics"), but I really would
like a lot of eyes on this (and I would say, especially, rte_cycles, rte_memcpy
and rte_cpuflags).
I still have some concerns about the use of intrinsics for architecture != x86
but I think Chao will be the best to look at this.

Signature · 83 lines
David Marchand

Chao Zhu (7):
  eal: split atomic operations to architecture specific
  eal: split byte order operations to architecture specific
  eal: split CPU cycle operation to architecture specific
  eal: split prefetch operations to architecture specific
  eal: split spinlock operations to architecture specific
  eal: split memcpy operation to architecture specific
  eal: split CPU flags operations to architecture specific

David Marchand (3):
  eal: move rte_atomic.h header
  eal: install all arch headers
  eal: factorize x86 headers

 doc/api/doxy-api.conf                              |    1 +
 lib/librte_eal/common/Makefile                     |   24 +-
 lib/librte_eal/common/eal_common_cpuflags.c        |  190 ----
 .../common/include/arch/x86/rte_atomic.h           |  216 ++++
 .../common/include/arch/x86/rte_atomic_32.h        |  222 ++++
 .../common/include/arch/x86/rte_atomic_64.h        |  191 ++++
 .../common/include/arch/x86/rte_byteorder.h        |  121 +++
 .../common/include/arch/x86/rte_byteorder_32.h     |   51 +
 .../common/include/arch/x86/rte_byteorder_64.h     |   52 +
 .../common/include/arch/x86/rte_cpuflags.h         |  310 ++++++
 .../common/include/arch/x86/rte_cycles.h           |  121 +++
 .../common/include/arch/x86/rte_memcpy.h           |  297 +++++
 .../common/include/arch/x86/rte_prefetch.h         |   62 ++
 .../common/include/arch/x86/rte_spinlock.h         |   94 ++
 lib/librte_eal/common/include/generic/rte_atomic.h |  918 
++++++++++++++++
 .../common/include/generic/rte_byteorder.h         |  189 ++++
 .../common/include/generic/rte_cpuflags.h          |  110 ++
 lib/librte_eal/common/include/generic/rte_cycles.h |  209 ++++
 lib/librte_eal/common/include/generic/rte_memcpy.h |  144 +++
 .../common/include/generic/rte_prefetch.h          |   71 ++
 .../common/include/generic/rte_spinlock.h          |  226 ++++
 .../common/include/i686/arch/rte_atomic.h          |  373 -------
 lib/librte_eal/common/include/rte_atomic.h         | 1133 
--------------------
 lib/librte_eal/common/include/rte_byteorder.h      |  270 -----
 lib/librte_eal/common/include/rte_cpuflags.h       |  182 ----
 lib/librte_eal/common/include/rte_cycles.h         |  266 -----
 lib/librte_eal/common/include/rte_memcpy.h         |  376 -------
 lib/librte_eal/common/include/rte_prefetch.h       |   88 --
 lib/librte_eal/common/include/rte_spinlock.h       |  258 -----
 .../common/include/x86_64/arch/rte_atomic.h        |  335 ------
 mk/arch/i686/rte.vars.mk                           |    2 +
 mk/arch/x86_64/rte.vars.mk                         |    2 +
 32 files changed, 3624 insertions(+), 3480 deletions(-)
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_32.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_atomic_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_byteorder.h
 create mode 100644 
lib/librte_eal/common/include/arch/x86/rte_byteorder_32.h
 create mode 100644 
lib/librte_eal/common/include/arch/x86/rte_byteorder_64.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/arch/x86/rte_spinlock.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_atomic.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_byteorder.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cpuflags.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_cycles.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_memcpy.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_prefetch.h
 create mode 100644 lib/librte_eal/common/include/generic/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/i686/arch/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/rte_atomic.h
 delete mode 100644 lib/librte_eal/common/include/rte_byteorder.h
 delete mode 100644 lib/librte_eal/common/include/rte_cpuflags.h
 delete mode 100644 lib/librte_eal/common/include/rte_cycles.h
 delete mode 100644 lib/librte_eal/common/include/rte_memcpy.h
 delete mode 100644 lib/librte_eal/common/include/rte_prefetch.h
 delete mode 100644 lib/librte_eal/common/include/rte_spinlock.h
 delete mode 100644 lib/librte_eal/common/include/x86_64/arch/rte_atomic.h

-- 
1.7.10.4
Acked-by
#13 lore raw
In reply to a message not in the archive
Quoted 34 lines

The set of patches split x86 architecture specific operations from DPDK and put them to x86 arch directory.
This will make the adoption of DPDK much easier on other computer architecture. For a new architecture, just add an architecture specific directory and necessary building configuration files, then DPDK eal library can support it.

Reviewing patchset from Chao, I ended up modifying it along the way, so here is a new iteration of this patchset.

Changes since Chao v2 patchset :

- added a preliminary patch for moving rte_atomic.h (for better readability)
- fixed documentation generation
- implemented a generic header for each arch specific header (cpuflags, memcpy, prefetch were missing)
- removed C++ stuff from generic headers
- centralised all doxygen stuff in generic headers (no need to have duplicates)
- refactored rte_cycles functions
- moved vmware tsc stuff to arch rte_cycles.h headers
- finished x86 factorisation

Little summary of current state :

- all applications continue to include the eal headers as before, these headers are the arch-specific ones
- the arch specific headers always include the generic ones. The generic headers contain the doxygen documentation and code common to all architectures
- a x86 architecture has been defined which handles both 32bits and 64bits peculiarities

Quoted 7 lines

It builds fine for 32/64 bits (w and w/o "force intrinsics"), but I really would like a lot of eyes on this (and I would say, especially, rte_cycles, rte_memcpy and rte_cpuflags).
I still have some concerns about the use of intrinsics for architecture != x86 but I think Chao will be the best to look at this.

A message that is not in the archive (sent off-list or not yet received): 54598DFC.6070006-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

Acked-by Applied
#15 lore raw
Quoted 33 lines
Quoted 33 lines

The set of patches split x86 architecture specific operations from DPDK and put them to x86 arch directory.
This will make the adoption of DPDK much easier on other computer architecture. For a new architecture, just add an architecture specific directory and necessary building configuration files, then DPDK eal library can support it.

Reviewing patchset from Chao, I ended up modifying it along the way, so here is a new iteration of this patchset.

Changes since Chao v2 patchset :

- added a preliminary patch for moving rte_atomic.h (for better readability)
- fixed documentation generation
- implemented a generic header for each arch specific header (cpuflags, memcpy, prefetch were missing)
- removed C++ stuff from generic headers
- centralised all doxygen stuff in generic headers (no need to have duplicates)
- refactored rte_cycles functions
- moved vmware tsc stuff to arch rte_cycles.h headers
- finished x86 factorisation

Little summary of current state :

- all applications continue to include the eal headers as before, these headers are the arch-specific ones
- the arch specific headers always include the generic ones. The generic headers contain the doxygen documentation and code common to all architectures
- a x86 architecture has been defined which handles both 32bits and 64bits peculiarities

Quoted 8 lines
Quoted 7 lines

It builds fine for 32/64 bits (w and w/o "force intrinsics"), but I really would like a lot of eyes on this (and I would say, especially, rte_cycles, rte_memcpy and rte_cpuflags).
I still have some concerns about the use of intrinsics for architecture != x86 but I think Chao will be the best to look at this.

Applied

Thanks for the big clean-up.
Now we are ready to accept new CPUs.

Signature · 1 line
Thomas