From f5030c82d270c4a921077a805a3057308ad7c167194c545b1616c4c7cb33b8a1 Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Tue, 9 Aug 2016 10:58:13 +0000 Subject: [PATCH] Accepting request 417972 from home:ndas:branches:network MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add _constraints file to force build dpdk with sse3 enabled x86 machine. - Enable compilation for ppc64le with the help of Rüdiger(ro@suse.de). - Enable example package for aarch64 using Rüdiger(ro@suse.de) changes. - Do not enable PMD_RING on ppc64le (missing rte_eth_from_rings). - Disable examples that need LPM which is disabled on non-x86. [+0036-examples-fix-build-dependencies.patch, +0037-examples-ethtool-fix-build.patch] OBS-URL: https://build.opensuse.org/request/show/417972 OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=13 --- 0036-examples-fix-build-dependencies.patch | 52 ++++++++++++++++++++++ 0037-examples-ethtool-fix-build.patch | 32 +++++++++++++ _constraints | 18 ++++++++ dpdk.changes | 12 +++++ dpdk.spec | 37 ++++++++++----- 5 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 0036-examples-fix-build-dependencies.patch create mode 100644 0037-examples-ethtool-fix-build.patch create mode 100644 _constraints diff --git a/0036-examples-fix-build-dependencies.patch b/0036-examples-fix-build-dependencies.patch new file mode 100644 index 0000000..005376e --- /dev/null +++ b/0036-examples-fix-build-dependencies.patch @@ -0,0 +1,52 @@ +From 1f1d7f76edc37acc879746ef3822dae54cbfe2a3 Mon Sep 17 00:00:00 2001 +From: Thomas Monjalon +Date: Fri, 5 Feb 2016 15:43:56 +0100 +Subject: [PATCH] examples: fix build dependencies + +When building for ARM some examples were failing to compile because +of some dependencies disabled. +Declaring these dependencies prevent from trying to compile some +not supported examples. + +Signed-off-by: Thomas Monjalon +--- + examples/Makefile | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/examples/Makefile b/examples/Makefile +index 1cb4785..1665df1 100644 +--- a/examples/Makefile ++++ b/examples/Makefile +@@ -46,21 +46,25 @@ endif + DIRS-y += ethtool + DIRS-y += exception_path + DIRS-y += helloworld +-DIRS-y += ip_pipeline +-DIRS-y += ip_reassembly ++DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += ip_pipeline ++ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) ++DIRS-$(CONFIG_RTE_IP_FRAG) += ip_reassembly + DIRS-$(CONFIG_RTE_IP_FRAG) += ip_fragmentation ++endif + DIRS-y += ipv4_multicast + DIRS-$(CONFIG_RTE_LIBRTE_KNI) += kni + DIRS-y += l2fwd + DIRS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += l2fwd-ivshmem + DIRS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += l2fwd-jobstats + DIRS-y += l2fwd-keepalive +-DIRS-y += l3fwd ++DIRS-$(CONFIG_RTE_LIBRTE_LPM) += l3fwd + DIRS-$(CONFIG_RTE_LIBRTE_ACL) += l3fwd-acl ++ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) + DIRS-$(CONFIG_RTE_LIBRTE_POWER) += l3fwd-power + DIRS-y += l3fwd-vf ++endif + DIRS-y += link_status_interrupt +-DIRS-y += load_balancer ++DIRS-$(CONFIG_RTE_LIBRTE_LPM) += load_balancer + DIRS-y += multi_process + DIRS-y += netmap_compat/bridge + DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += packet_ordering +-- +2.6.6 + diff --git a/0037-examples-ethtool-fix-build.patch b/0037-examples-ethtool-fix-build.patch new file mode 100644 index 0000000..70098af --- /dev/null +++ b/0037-examples-ethtool-fix-build.patch @@ -0,0 +1,32 @@ +From 71e6e8c51906102ba1f7da0a75f29f9c26b651f0 Mon Sep 17 00:00:00 2001 +From: Thomas Monjalon +Date: Fri, 5 Feb 2016 15:38:02 +0100 +Subject: [PATCH] examples/ethtool: fix build + +When building for ARM, the spinlock structure was not found. +It appears to be a mismatch with rwlock which is not used in this file. + +Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application") + +Signed-off-by: Thomas Monjalon +Acked-by: Remy Horton +--- + examples/ethtool/ethtool-app/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c +index e21abcd..2c655d8 100644 +--- a/examples/ethtool/ethtool-app/main.c ++++ b/examples/ethtool/ethtool-app/main.c +@@ -36,7 +36,7 @@ + #include + + #include +-#include ++#include + #include + #include + #include +-- +2.6.6 + diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..55c0b02 --- /dev/null +++ b/_constraints @@ -0,0 +1,18 @@ + + + + + i586 + x86_64 + + + + mmx + sse + sse2 + sse3 + + + + + diff --git a/dpdk.changes b/dpdk.changes index 595028d..ec0717a 100644 --- a/dpdk.changes +++ b/dpdk.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Jul 28 16:39:07 CEST 2016 - ndas@suse.de + +- Add _constraints file to force build dpdk with sse3 enabled x86 machine. +- Enable compilation for ppc64le with the help of Rüdiger(ro@suse.de). +- Enable example package for aarch64 using Rüdiger(ro@suse.de) changes. +- Do not enable PMD_RING on ppc64le (missing rte_eth_from_rings). +- Disable examples that need LPM which is disabled on non-x86. + + [+0036-examples-fix-build-dependencies.patch, + +0037-examples-ethtool-fix-build.patch] + ------------------------------------------------------------------- Mon Jul 11 18:20:57 CEST 2016 - ndas@suse.de diff --git a/dpdk.spec b/dpdk.spec index 78bd84d..2e6a89b 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -16,6 +16,8 @@ # +%define machine native +%define machine2 default %ifarch x86_64 %define machine native %define target x86_64-%{machine}-linuxapp-gcc @@ -25,16 +27,16 @@ %define target i686-%{machine}-linuxapp-gcc %endif %ifarch aarch64 -%define machine armv8a -%define target arm64-%{machine}-linuxapp-gcc +%define machine2 armv8a +%define target arm64-%{machine2}-linuxapp-gcc %endif -# Examples seems to contain lots of Intel specific code -# so disabling examples package for aarch64 till we find -# time to fix them all. - TODO -%ifnarch aarch64 -# Add option to build without examples + +%ifarch ppc64le +%define machine2 power8 +%define target ppc_64-%{machine2}-linuxapp-gcc +%endif + %bcond_without examples -%endif %bcond_without shared # Add option to build without tools %bcond_without tools @@ -110,6 +112,10 @@ Patch33: 0033-virtio-fix-descriptors-pointing-to-the-same-buffer.patch Patch34: 0034-virtio-fix-restart.patch #PATCH-FIX-OPENSUSE 0035-PAGE_SIZE-constant-is-not-defined-on-ARM-since-multi Patch35: 0035-PAGE_SIZE-constant-is-not-defined-on-ARM-since-multi.patch +#PATCH-FIX-UPSTREAM 0036-examples-fix-build-dependencies +Patch36: 0036-examples-fix-build-dependencies.patch +#PATCH-FIX-UPSTREAM 0037-examples-ethtool-fix-build +Patch37: 0037-examples-ethtool-fix-build.patch # # Patches for build fixes @@ -138,7 +144,7 @@ BuildRequires: fdupes BuildRequires: libnuma-devel BuildRequires: libpcap-devel BuildRequires: zlib-devel -ExclusiveArch: aarch64 x86_64 %ix86 +ExclusiveArch: aarch64 x86_64 %ix86 ppc64le %description The Data Plane Development Kit is a set of libraries and drivers for @@ -228,6 +234,8 @@ as L2 and L3 forwarding. %patch33 -p1 %patch34 -p1 %patch35 -p1 +%patch36 -p1 +%patch37 -p1 # Build fixes %patch99 -p1 -z .rtetoolchain @@ -265,7 +273,7 @@ export EXTRA_CFLAGS="%{optflags} -Wformat -fPIC -Wno-error=array-bounds" make V=1 O=%{target} T=%{target} %{?_smp_mflags} config -setconf CONFIG_RTE_MACHINE '"%{machine}"' +setconf CONFIG_RTE_MACHINE '"%{machine2}"' # Disable experimental features setconf CONFIG_RTE_NEXT_ABI n setconf CONFIG_RTE_LIBRTE_CRYPTODEV n @@ -287,6 +295,13 @@ setconf CONFIG_RTE_KNI_PREEMPT_DEFAULT n setconf CONFIG_RTE_BUILD_SHARED_LIB y %endif +%ifarch aarch64 ppc64le +setconf CONFIG_RTE_LIBRTE_DISTRIBUTOR n +%endif +%ifarch ppc64le +setconf CONFIG_RTE_LIBRTE_PMD_RING n +%endif + make V=1 O=%{target} %{?_smp_mflags} make V=1 O=%{target} %{?_smp_mflags} doc-api-html @@ -340,7 +355,7 @@ endif EOF # Fixup target machine mismatch -sed -i -e 's:-%{machine}-:-default-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk* +sed -i -e 's:-%{machine}-:-%{machine2}-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk* # Upstream has an option to build a combined library but it's bloatware which # wont work at all when library versions start moving, replace it with a