Skip to contentSkip to conversation

update dpdk-next-build to 17.11-rc1

PATCH In review Bruce Richardson 2 participants 11 messages Oct 17, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover update dpdk-next-build to 17.11-rc1

With the large number of changes in 17.11-rc1, the dpdk-next-build patches would no longer apply and compile cleanly on top of the main tree. To allow next-build to be rebased on top of master, the changes listed below needed to be made to the code.

NOTE: appart from the last patch which may be kept separate as it's not a compilation fix, these patches will be merged into existing commits in next-build so as to ensure a clear history on top of master.

Bruce Richardson (7):
build: add rte_bitmap.h to eal
build: remove rte_bitmap.h from rte_sched lib
build: add gso library
eal: add additional memcpy and cycles C files to build
efd: add new avx2 standalone file to build app/test-pmd: add dependency on new gso library eal/x86: compile memcpy for dynamic dispatch

 app/test-pmd/meson.build                   |  2 +-
 lib/librte_eal/common/arch/x86/meson.build | 28 +++++++++++++++++++++++-
 lib/librte_eal/common/include/meson.build  |  1 +
 lib/librte_eal/linuxapp/eal/meson.build    |  1 +
 lib/librte_efd/meson.build                 | 19 ++++++++++++++++
 lib/librte_gso/meson.build                 | 35 ++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build               |  2 +-
 lib/meson.build                            |  2 +-
 8 files changed, 86 insertions(+), 4 deletions(-)
 create mode 100644 lib/librte_gso/meson.build
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/7 build: add rte_bitmap.h to eal

---
 lib/librte_eal/common/include/meson.build | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/common/include/meson.build +1 -0
index bb9751065..2c5dcd4ee 100644
@@ -35,6 +35,7 @@ common_headers = [
 	'rte_alarm.h',
 	'rte_branch_prediction.h',
 	'rte_bus.h',
+	'rte_bitmap.h',
 	'rte_common.h',
 	'rte_debug.h',
 	'rte_devargs.h',
Signature · 1 line
2.13.6
#2 lore raw

PATCH 2/7 build: remove rte_bitmap.h from rte_sched lib

In reply to Bruce Richardson
---
 lib/librte_sched/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_sched/meson.build +1 -1
index c4badb211..ea36a8522 100644
@@ -31,6 +31,6 @@
 
 sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c',
 		'rte_reciprocal.c')
-headers = files('rte_sched.h', 'rte_bitmap.h', 'rte_sched_common.h',
+headers = files('rte_sched.h', 'rte_sched_common.h',
 		'rte_red.h', 'rte_approx.h', 'rte_reciprocal.h')
 deps += ['mbuf', 'meter']
Signature · 1 line
2.13.6
#3 lore raw

PATCH 3/7 build: add gso library

In reply to Bruce Richardson
---
 lib/librte_gso/meson.build | 35 +++++++++++++++++++++++++++++++++++
 lib/meson.build            |  2 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_gso/meson.build
lib/librte_gso/meson.build new file +35 -0
new file mode 100644
index 000000000..f052215ff
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+sources = files('gso_common.c', 'gso_tcp4.c',
+ 		'gso_tunnel_tcp4.c', 'rte_gso.c')
+headers = files('rte_gso.h')
+deps += ['ethdev']
lib/meson.build +1 -1
index 5244fe4a5..f04cb2791 100644
@@ -44,7 +44,7 @@ libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
 	'hash',    # efd depends on this
 	'kvargs',  # cryptodev depends on this
 	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
-	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'distributor', 'efd', 'eventdev', 'gro', 'gso', 'ip_frag', 'jobstats',
 	'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
 	'reorder', 'sched', 'timer', 'vhost',
 	# add pkt framework libs which use other libs from above
Signature · 1 line
2.13.6
#4 lore raw

PATCH 4/7 eal/x86: add additional memcpy and cycles C files to build

In reply to Bruce Richardson
---
 lib/librte_eal/common/arch/x86/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_eal/common/arch/x86/meson.build +2 -1
index c007e57c9..f8815acbc 100644
@@ -29,4 +29,5 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-eal_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c')
+eal_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c',
+	'rte_cycles.c', 'rte_memcpy.c', 'rte_memcpy_sse.c')
Signature · 1 line
2.13.6
#5 lore raw

PATCH 5/7 efd: add new avx2 standalone file to build

In reply to Bruce Richardson
---
 lib/librte_efd/meson.build | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
lib/librte_efd/meson.build +19 -0
index 73c004e70..01e7a22db 100644
@@ -32,3 +32,22 @@
 sources = files('rte_efd.c')
 headers = files('rte_efd.h')
 deps += ['ring', 'hash']
+
+if arch_subdir == 'x86'
+	# compile AVX2 version if either:
+	# a. we have AVX supported in minimum instruction set baseline
+	# b. it's not minimum instruction set, but supported by compiler
+	#
+	# in former case, just add avx2 C file to files list
+	# in latter case, compile c file to static lib, using correct compiler
+	# flags, and then have the .o file from static lib linked into main lib.
+	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+		sources += files('rte_efd_x86.c')
+	elif cc.has_argument('-mavx2')
+		avx2_tmplib = static_library('avx2_efd_tmp',
+				'rte_efd_x86.c',
+				dependencies: rte_eal,
+				c_args: '-mavx2')
+		objs += avx2_tmplib.extract_objects('rte_efd_x86.c')
+	endif
+endif
Signature · 1 line
2.13.6
#6 lore raw

PATCH 6/7 app/test-pmd: add dependency on new gso library

In reply to Bruce Richardson
---
 app/test-pmd/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/meson.build +1 -1
index 202adf2b2..46e28b4ac 100644
@@ -44,7 +44,7 @@ sources = files('cmdline.c',
 	'testpmd.c',
 	'txonly.c')
 
-deps = ['ethdev', 'gro', 'cmdline', 'metrics']
+deps = ['ethdev', 'gro', 'gso', 'cmdline', 'metrics']
 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
 	deps += 'pdump'
 endif
Signature · 1 line
2.13.6
#7 lore raw

PATCH 7/7 eal/x86: compile memcpy for dynamic dispatch

In reply to Bruce Richardson

The rte_memcpy instruction can be compiled for SSE, AVX2 or AVX512F instruction sets. If the baseline instruciton set level used for the compile is not AVX512, then the function to be used when rte_memcpy is called should be selected at runtime, which means the different implementations should be compiled for the different instruction set levels, irrespective of the baseline level.

---
 lib/librte_eal/common/arch/x86/meson.build | 25 +++++++++++++++++++++++++
 lib/librte_eal/linuxapp/eal/meson.build    |  1 +
 2 files changed, 26 insertions(+)
lib/librte_eal/common/arch/x86/meson.build +25 -0
index f8815acbc..0e2e7c401 100644
@@ -31,3 +31,28 @@
 
 eal_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c',
 	'rte_cycles.c', 'rte_memcpy.c', 'rte_memcpy_sse.c')
+eal_common_arch_objs = []
+
+if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512F')
+	eal_common_arch_sources += files('rte_memcpy_avx512f.c',
+			'rte_memcpy_avx2.c')
+else # no avx512f instruction set guaranteed
+	# check if compiler supports
+	if cc.has_argument('-mavx512f')
+		avx512_tmplib = static_library('memcpy_avx512_tmp',
+				'rte_memcpy_avx512f.c',
+				c_args: '-mavx512f')
+		eal_common_arch_objs += avx512_tmplib.extract_objects(
+				'rte_memcpy_avx512f.c')
+	endif
+	# check for mandatory AVX2 support
+	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+		eal_common_arch_sources += files('rte_memcpy_avx2.c')
+	elif cc.has_argument('-mavx2')
+		avx2_tmplib = static_library('memcpy_avx2_tmp',
+				'rte_memcpy_avx2.c',
+				c_args: '-mavx2')
+		eal_common_arch_objs += avx2_tmplib.extract_objects(
+				'rte_memcpy_avx2.c')
+	endif
+endif
lib/librte_eal/linuxapp/eal/meson.build +1 -0
index 46ae57649..c0ceacd61 100644
@@ -62,6 +62,7 @@ endif
 
 version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
+			objects: eal_common_arch_objs,
 			dependencies: dependency('threads'),
 			include_directories : eal_inc,
 			version: lib_version,
Signature · 1 line
2.13.6
Reviewed-by on the v1 series
#8 lore raw
In reply to Bruce Richardson
Quoted 29 lines · Bruce Richardson

With the large number of changes in 17.11-rc1, the dpdk-next-build patches would no longer apply and compile cleanly on top of the main tree. To allow next-build to be rebased on top of master, the changes listed below needed to be made to the code.

NOTE: appart from the last patch which may be kept separate as it's not a compilation fix, these patches will be merged into existing commits in next-build so as to ensure a clear history on top of master.

Bruce Richardson (7):
  build: add rte_bitmap.h to eal
  build: remove rte_bitmap.h from rte_sched lib
  build: add gso library
  eal: add additional memcpy and cycles C files to build
  efd: add new avx2 standalone file to build app/test-pmd: add dependency on new gso library eal/x86: compile memcpy for dynamic dispatch

 app/test-pmd/meson.build                   |  2 +- lib/librte_eal/common/arch/x86/meson.build | 28
+++++++++++++++++++++++-
 lib/librte_eal/common/include/meson.build  |  1 + lib/librte_eal/linuxapp/eal/meson.build    |  1 + lib/librte_efd/meson.build                 | 19 ++++++++++++++++ lib/librte_gso/meson.build                 | 35
++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build               |  2 +- lib/meson.build                            |  2 +-

Quoted 2 lines
 8 files changed, 86 insertions(+), 4 deletions(-)

 create mode 100644 lib/librte_gso/meson.build

LGTM, thanks!

Signature · 2 lines
Kind regards,
Luca Boccassi
#9 lore raw
Quoted 33 lines · Luca Boccassi
Quoted 29 lines · Bruce Richardson

With the large number of changes in 17.11-rc1, the dpdk-next-build patches would no longer apply and compile cleanly on top of the main tree. To allow next-build to be rebased on top of master, the changes listed below needed to be made to the code.

NOTE: appart from the last patch which may be kept separate as it's not a compilation fix, these patches will be merged into existing commits in next-build so as to ensure a clear history on top of master.

Bruce Richardson (7):
  build: add rte_bitmap.h to eal
  build: remove rte_bitmap.h from rte_sched lib
  build: add gso library
  eal: add additional memcpy and cycles C files to build
  efd: add new avx2 standalone file to build app/test-pmd: add dependency on new gso library eal/x86: compile memcpy for dynamic dispatch

 app/test-pmd/meson.build                   |  2 +- lib/librte_eal/common/arch/x86/meson.build | 28
+++++++++++++++++++++++-
 lib/librte_eal/common/include/meson.build  |  1 + lib/librte_eal/linuxapp/eal/meson.build    |  1 + lib/librte_efd/meson.build                 | 19 ++++++++++++++++ lib/librte_gso/meson.build                 | 35
++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build               |  2 +- lib/meson.build                            |  2 +-

Quoted 2 lines
 8 files changed, 86 insertions(+), 4 deletions(-)

 create mode 100644 lib/librte_gso/meson.build

Quoted 7 lines

LGTM, thanks!

Signature · 2 lines
Kind regards,
Luca Boccassi

Patches merged to relevant commits in dpdk-next-build

/Bruce

#10 lore raw
Quoted 36 lines · Bruce Richardson
Quoted 35 lines · Luca Boccassi
Quoted 29 lines · Bruce Richardson

With the large number of changes in 17.11-rc1, the dpdk-next-build patches would no longer apply and compile cleanly on top of the main tree. To allow next-build to be rebased on top of master, the changes listed below needed to be made to the code.

NOTE: appart from the last patch which may be kept separate as it's not a compilation fix, these patches will be merged into existing commits in next-build so as to ensure a clear history on top of master.

Bruce Richardson (7):
  build: add rte_bitmap.h to eal
  build: remove rte_bitmap.h from rte_sched lib
  build: add gso library
  eal: add additional memcpy and cycles C files to build
  efd: add new avx2 standalone file to build app/test-pmd: add dependency on new gso library eal/x86: compile memcpy for dynamic dispatch

 app/test-pmd/meson.build                   |  2 +- lib/librte_eal/common/arch/x86/meson.build | 28
+++++++++++++++++++++++-
 lib/librte_eal/common/include/meson.build  |  1 + lib/librte_eal/linuxapp/eal/meson.build    |  1 + lib/librte_efd/meson.build                 | 19 ++++++++++++++++ lib/librte_gso/meson.build                 | 35
++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build               |  2 +- lib/meson.build                            |  2 +-

Quoted 2 lines
 8 files changed, 86 insertions(+), 4 deletions(-)

 create mode 100644 lib/librte_gso/meson.build

Quoted 7 lines
Quoted 5 lines

LGTM, thanks!

Signature · 2 lines
Kind regards,
Luca Boccassi

Patches merged to relevant commits in dpdk-next-build

... along with a version number update in the top-level meson.build file

Quoted 2 lines

/Bruce