diff --git a/.dpdk.metadata b/.dpdk.metadata index 60e03cd..900a60a 100644 --- a/.dpdk.metadata +++ b/.dpdk.metadata @@ -1 +1,2 @@ -6bf5e65e2431d50e802df73f0b878faf357c3b8f SOURCES/dpdk-2.0.0.tar.gz +71162be485b35da45d2a303f9e0462814e2a77c1 SOURCES/dpdk-2.2.0.tar.gz +3d9751fa798416ebd8a3fd0faeb7830b29c62c11 SOURCES/driverctl-0.59.tar.gz diff --git a/.gitignore b/.gitignore index 306edc4..7382d5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/dpdk-2.0.0.tar.gz +SOURCES/dpdk-2.2.0.tar.gz +SOURCES/driverctl-0.59.tar.gz diff --git a/SOURCES/dpdk-2.2-buildopts.patch b/SOURCES/dpdk-2.2-buildopts.patch new file mode 100644 index 0000000..2fa2796 --- /dev/null +++ b/SOURCES/dpdk-2.2-buildopts.patch @@ -0,0 +1,12 @@ +diff -up dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile.buildopts dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile +--- dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile.buildopts 2015-08-11 23:36:41.000000000 +0300 ++++ dpdk-2.1.0-2898.gitf1e779ec/examples/ip_pipeline/Makefile 2015-08-12 12:46:00.212761965 +0300 +@@ -70,7 +70,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += pi + SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += pipeline_routing.c + + CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/pipeline +-CFLAGS += -O3 ++CFLAGS += -O3 -mavx2 + CFLAGS += $(WERROR_FLAGS) -Wno-error=unused-function -Wno-error=unused-variable + + include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/SOURCES/dpdk-2.2-dtneeded.patch b/SOURCES/dpdk-2.2-dtneeded.patch new file mode 100644 index 0000000..28b2a12 --- /dev/null +++ b/SOURCES/dpdk-2.2-dtneeded.patch @@ -0,0 +1,152 @@ +commit f85ab16a916be178a4cb61575f414c43fc98313d +Author: Panu Matilainen +Date: Tue Dec 8 13:42:26 2015 +0200 + + mk: fix external shared library dependencies of libraries + + Similar to commit 5f9115e58cc6f304ff4ade694cf5823d32887d1a etc, but + for libraries. Clean up librte_vhost CFLAGS/LDFLAGS/LDLIBS confusion + while at it. + + Requiring applications to know about library internal details like + dependencies to external helper libraries is a limitation of + static linkage, shared libraries should always know their own + dependencies for sane operation. + + Linking with the combined library (whether shared or not) still + requires knowing the internal dependencies, and intra-dpdk + dependencies are also not currently recorded. + + Signed-off-by: Panu Matilainen + +diff --git a/app/test/Makefile b/app/test/Makefile +index ec33e1a..abb0545 100644 +--- a/app/test/Makefile ++++ b/app/test/Makefile +@@ -182,6 +182,8 @@ endif + endif + endif + ++LDLIBS += -lm ++ + include $(RTE_SDK)/mk/rte.app.mk + + endif +diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile +index 65b293f..b7b6016 100644 +--- a/lib/librte_eal/bsdapp/eal/Makefile ++++ b/lib/librte_eal/bsdapp/eal/Makefile +@@ -42,6 +42,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_ring + CFLAGS += -I$(RTE_SDK)/lib/librte_mempool + CFLAGS += $(WERROR_FLAGS) -O3 + ++LDLIBS += -lpthread ++LDLIBS += -ldl ++ + EXPORT_MAP := rte_eal_version.map + + LIBABIVER := 2 +diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile +index 26eced5..0efb9e4 100644 +--- a/lib/librte_eal/linuxapp/eal/Makefile ++++ b/lib/librte_eal/linuxapp/eal/Makefile +@@ -47,6 +47,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_mempool + CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem + CFLAGS += $(WERROR_FLAGS) -O3 + ++LDLIBS += -lpthread ++LDLIBS += -ldl ++ + # specific to linuxapp exec-env + SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c + SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_hugepage_info.c +diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile +index b1cb285..4d631f6 100644 +--- a/lib/librte_sched/Makefile ++++ b/lib/librte_sched/Makefile +@@ -41,6 +41,9 @@ CFLAGS += $(WERROR_FLAGS) + + CFLAGS_rte_red.o := -D_GNU_SOURCE + ++LDLIBS += -lm ++LDLIBS += -lrt ++ + EXPORT_MAP := rte_sched_version.map + + LIBABIVER := 1 +diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile +index 6681f22..4aecc69 100644 +--- a/lib/librte_vhost/Makefile ++++ b/lib/librte_vhost/Makefile +@@ -42,12 +42,12 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 + ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y) + CFLAGS += -I vhost_user + else +-CFLAGS += -I vhost_cuse -lfuse +-LDFLAGS += -lfuse ++CFLAGS += -I vhost_cuse ++LDLIBS += -lfuse + endif + + ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) +-LDFLAGS += -lnuma ++LDLIBS += -lnuma + endif + + # all source are stored in SRCS-y +diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk +index 5fd7d85..d51bd17 100644 +--- a/mk/exec-env/linuxapp/rte.vars.mk ++++ b/mk/exec-env/linuxapp/rte.vars.mk +@@ -48,7 +48,7 @@ endif + # Workaround lack of DT_NEEDED entry + EXECENV_LDFLAGS = --no-as-needed + +-EXECENV_LDLIBS = -lrt -lm ++EXECENV_LDLIBS = + EXECENV_ASFLAGS = + + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +diff --git a/mk/rte.app.mk b/mk/rte.app.mk +index 8ecab41..4ecaa6c 100644 +--- a/mk/rte.app.mk ++++ b/mk/rte.app.mk +@@ -81,23 +81,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm + _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power + _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl + _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter +- + _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched +-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm +-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt +- + _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost + + endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS + +-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) +-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma +-endif +- +-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) +-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse +-endif +- + # The static libraries do not know their dependencies. + # The combined library fails also to store this information. + # So linking with static or combined library requires explicit dependencies. +@@ -111,6 +99,14 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore + _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lgxio + # QAT PMD has a dependency on libcrypto (from openssl) for calculating HMAC precomputes + _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lcrypto ++_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm ++_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt ++ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) ++_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma ++endif ++ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) ++_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse ++endif + endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS + + _LDLIBS-y += --start-group diff --git a/SOURCES/dpdk-2.2-warningflags.patch b/SOURCES/dpdk-2.2-warningflags.patch new file mode 100644 index 0000000..787c65b --- /dev/null +++ b/SOURCES/dpdk-2.2-warningflags.patch @@ -0,0 +1,24 @@ +diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile +index 033ee4a..3917b0c 100644 +--- a/drivers/net/i40e/Makefile ++++ b/drivers/net/i40e/Makefile +@@ -55,7 +55,6 @@ CFLAGS_BASE_DRIVER += -Wno-sign-compare + CFLAGS_BASE_DRIVER += -Wno-unused-value + CFLAGS_BASE_DRIVER += -Wno-unused-parameter + CFLAGS_BASE_DRIVER += -Wno-strict-aliasing +-CFLAGS_BASE_DRIVER += -Wno-format + CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers + CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast + CFLAGS_BASE_DRIVER += -Wno-format-nonliteral +@@ -65,11 +64,9 @@ CFLAGS_BASE_DRIVER = -Wno-sign-compare + CFLAGS_BASE_DRIVER += -Wno-unused-value + CFLAGS_BASE_DRIVER += -Wno-unused-parameter + CFLAGS_BASE_DRIVER += -Wno-strict-aliasing +-CFLAGS_BASE_DRIVER += -Wno-format + CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers + CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast + CFLAGS_BASE_DRIVER += -Wno-format-nonliteral +-CFLAGS_BASE_DRIVER += -Wno-format-security + CFLAGS_BASE_DRIVER += -Wno-unused-variable + + ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) diff --git a/SOURCES/dpdk-dev-vfio-eventfd-should-be-non-block-and-not-inherited.patch b/SOURCES/dpdk-dev-vfio-eventfd-should-be-non-block-and-not-inherited.patch deleted file mode 100644 index e0fbb1a..0000000 --- a/SOURCES/dpdk-dev-vfio-eventfd-should-be-non-block-and-not-inherited.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c -index aea1fb1..426953a 100644 ---- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c -+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c -@@ -294,7 +294,7 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd) - } - - /* set up an eventfd for interrupts */ -- fd = eventfd(0, 0); -+ fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - if (fd < 0) { - RTE_LOG(ERR, EAL, " cannot set up eventfd, " - "error %i (%s)\n", errno, strerror(errno)); diff --git a/SOURCES/dpdk-dev-vhost-flush-used--idx-update-before-reading-avail--flags.patch b/SOURCES/dpdk-dev-vhost-flush-used--idx-update-before-reading-avail--flags.patch deleted file mode 100644 index 0b33702..0000000 --- a/SOURCES/dpdk-dev-vhost-flush-used--idx-update-before-reading-avail--flags.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c -index 510ffe8..6afba35 100644 ---- a/lib/librte_vhost/vhost_rxtx.c -+++ b/lib/librte_vhost/vhost_rxtx.c -@@ -178,6 +178,9 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, - *(volatile uint16_t *)&vq->used->idx += count; - vq->last_used_idx = res_end_idx; - -+ /* flush used->idx update before we read avail->flags. */ -+ rte_mb(); -+ - /* Kick the guest if necessary. */ - if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) - eventfd_write((int)vq->callfd, 1); diff --git a/SOURCES/dpdk-dtneeded.patch b/SOURCES/dpdk-dtneeded.patch deleted file mode 100644 index eca27be..0000000 --- a/SOURCES/dpdk-dtneeded.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff -up dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile.dtneeded dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile ---- dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 -+++ dpdk-2.0.0/lib/librte_eal/linuxapp/eal/Makefile 2015-04-17 15:23:38.267984467 +0300 -@@ -53,6 +53,8 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_af - CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_xenvirt - CFLAGS += $(WERROR_FLAGS) -O3 - -+LDLIBS += -ldl -lpthread -+ - # specific to linuxapp exec-env - SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c - SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_hugepage_info.c -diff -up dpdk-2.0.0/lib/librte_pmd_pcap/Makefile.dtneeded dpdk-2.0.0/lib/librte_pmd_pcap/Makefile ---- dpdk-2.0.0/lib/librte_pmd_pcap/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 -+++ dpdk-2.0.0/lib/librte_pmd_pcap/Makefile 2015-04-17 15:23:38.267984467 +0300 -@@ -37,6 +37,8 @@ include $(RTE_SDK)/mk/rte.vars.mk - # - LIB = librte_pmd_pcap.a - -+LDLIBS += -lpcap -+ - CFLAGS += -O3 - CFLAGS += $(WERROR_FLAGS) - -diff -up dpdk-2.0.0/lib/librte_vhost/Makefile.dtneeded dpdk-2.0.0/lib/librte_vhost/Makefile ---- dpdk-2.0.0/lib/librte_vhost/Makefile.dtneeded 2015-04-03 17:13:45.000000000 +0300 -+++ dpdk-2.0.0/lib/librte_vhost/Makefile 2015-04-17 15:24:37.593834737 +0300 -@@ -44,6 +44,7 @@ CFLAGS += -I vhost_user - else - CFLAGS += -I vhost_cuse -lfuse - LDFLAGS += -lfuse -+LDLIBS += -lfuse - endif - - # all source are stored in SRCS-y -diff -up dpdk-2.0.0/mk/rte.lib.mk.dtneeded dpdk-2.0.0/mk/rte.lib.mk ---- dpdk-2.0.0/mk/rte.lib.mk.dtneeded 2015-04-03 17:13:45.000000000 +0300 -+++ dpdk-2.0.0/mk/rte.lib.mk 2015-04-17 15:23:38.267984467 +0300 -@@ -79,7 +79,7 @@ O_TO_A_DO = @set -e; \ - $(O_TO_A) && \ - echo $(O_TO_A_CMD) > $(call exe2cmd,$(@)) - --O_TO_S = $(LD) $(_CPU_LDFLAGS) -shared $(OBJS-y) -Wl,-soname,$(LIB) -o $(LIB) -+O_TO_S = $(LD) $(_CPU_LDFLAGS) -shared $(LDLIBS) $(OBJS-y) -Wl,-soname,$(LIB) -o $(LIB) - O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight - O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") - O_TO_S_DO = @set -e; \ diff --git a/SOURCES/dpdk-i40e-wformat.patch b/SOURCES/dpdk-i40e-wformat.patch deleted file mode 100644 index 7f719ce..0000000 --- a/SOURCES/dpdk-i40e-wformat.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up dpdk-1.8.0/lib/librte_pmd_i40e/Makefile.i40e-wformat dpdk-1.8.0/lib/librte_pmd_i40e/Makefile ---- dpdk-1.8.0/lib/librte_pmd_i40e/Makefile.i40e-wformat 2015-01-29 13:50:02.378411649 +0200 -+++ dpdk-1.8.0/lib/librte_pmd_i40e/Makefile 2015-01-29 13:50:11.117389706 +0200 -@@ -50,7 +50,6 @@ CFLAGS_BASE_DRIVER += -Wno-sign-compare - CFLAGS_BASE_DRIVER += -Wno-unused-value - CFLAGS_BASE_DRIVER += -Wno-unused-parameter - CFLAGS_BASE_DRIVER += -Wno-strict-aliasing --CFLAGS_BASE_DRIVER += -Wno-format - CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers - CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast - CFLAGS_BASE_DRIVER += -Wno-format-nonliteral -@@ -59,11 +58,9 @@ CFLAGS_BASE_DRIVER = -Wno-sign-compare - CFLAGS_BASE_DRIVER += -Wno-unused-value - CFLAGS_BASE_DRIVER += -Wno-unused-parameter - CFLAGS_BASE_DRIVER += -Wno-strict-aliasing --CFLAGS_BASE_DRIVER += -Wno-format - CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers - CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast - CFLAGS_BASE_DRIVER += -Wno-format-nonliteral --CFLAGS_BASE_DRIVER += -Wno-format-security - - ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) - CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable diff --git a/SPECS/dpdk.spec b/SPECS/dpdk.spec index 2887541..6bd5a3d 100644 --- a/SPECS/dpdk.spec +++ b/SPECS/dpdk.spec @@ -4,16 +4,19 @@ %bcond_with examples # Add option to build without tools %bcond_without tools -# Add option to build with IVSHMEM support (breaks ABI and whatnot, watchout) -%bcond_with ivshmem +# Add option to build without driverctl +%bcond_without driverctl # Dont edit Version: and Release: directly, only these: -%define ver 2.0.0 -%define rel 8 +%define ver 2.2.0 +# NOTE: due to driverctl having its own version, only reset release +# to 1 when *both* dpdk and driverctl are updated. +%define rel 2 # Define when building git snapshots #define snapver 2086.git263333bb %define srcver %{ver}%{?snapver:-%{snapver}} +%define dctlver 0.59 Name: dpdk Version: %{ver} @@ -24,10 +27,9 @@ Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{srcver}.tar.gz # Only needed for creating snapshot tarballs, not used in build itself Source100: dpdk-snapshot.sh -Patch2: dpdk-i40e-wformat.patch -Patch4: dpdk-dtneeded.patch -Patch5: dpdk-dev-vhost-flush-used--idx-update-before-reading-avail--flags.patch -Patch6: dpdk-dev-vfio-eventfd-should-be-non-block-and-not-inherited.patch +Patch1: dpdk-2.2-warningflags.patch +Patch2: dpdk-2.2-dtneeded.patch +Patch3: dpdk-2.2-buildopts.patch Summary: Set of libraries and drivers for fast packet processing @@ -45,10 +47,14 @@ License: BSD and LGPLv2 and GPLv2 ExclusiveArch: x86_64 %define machine native - %define target x86_64-%{machine}-linuxapp-gcc -BuildRequires: kernel-headers, libpcap-devel +%define sdkdir %{_datadir}/%{name} +%define docdir %{_docdir}/%{name} +%define incdir %{_includedir}/%{name} +%define pmddir %{_libdir}/%{name}-pmds + +BuildRequires: kernel-headers, libpcap-devel, zlib-devel, numactl-devel BuildRequires: doxygen, python-sphinx %description @@ -76,7 +82,6 @@ API programming documentation for the Data Plane Development Kit. %if %{with tools} %package tools Summary: Tools for setting up Data Plane Development Kit environment -Requires: %{name} = %{version}-%{release} Requires: kmod pciutils findutils iproute %description tools @@ -93,21 +98,35 @@ Example applications utilizing the Data Plane Development Kit, such as L2 and L3 forwarding. %endif -%define sdkdir %{_libdir}/%{name}-%{version}-sdk -%define docdir %{_docdir}/%{name}-%{version} +%if %{with driverctl} +%package -n driverctl +Version: %{dctlver} +Summary: Driver control utility +Requires(post,postun): systemd +Requires: coreutils kmod +# for udev macros +BuildRequires: systemd +BuildArch: noarch +Source10: driverctl-%{dctlver}.tar.gz + +%description -n driverctl +%{summary} + +# restore original version, sub-package specific versions are problematic... +%undefine version +%endif %prep -%setup -q -n %{name}-%{srcver} -%patch2 -p1 -z .i40e-wformat -%patch4 -p1 -z .dtneeded -%patch5 -p1 -z .vhost-flush -%patch6 -p1 -z .vfio-eventfd +%setup -q -n %{name}-%{srcver} %{?with_driverctl:-a 10} +%patch1 -p1 -z .warningflags +%patch2 -p1 -z .dtneeded +%patch3 -p1 -z .buildopts %build function setconf() { cf=%{target}/.config - if grep -q $1 $cf; then + if grep -q ^$1= $cf; then sed -i "s:^$1=.*$:$1=$2:g" $cf else echo $1=$2 >> $cf @@ -118,27 +137,21 @@ unset RTE_SDK RTE_INCLUDE RTE_TARGET # Avoid appending second -Wall to everything, it breaks hand-picked # disablers like per-file -Wno-strict-aliasing -export EXTRA_CFLAGS="`echo %{optflags} | sed -e 's:-Wall::g'` -fPIC -Wno-error=array-bounds" - +export EXTRA_CFLAGS="`echo %{optflags} | sed -e 's:-Wall::g'` -fPIC" make V=1 O=%{target} T=%{target} %{?_smp_mflags} config # DPDK defaults to optimizing for the builder host we need generic binaries -setconf CONFIG_RTE_MACHINE default +setconf CONFIG_RTE_MACHINE '"default"' +setconf CONFIG_RTE_SCHED_VECTOR n -# Enable pcap and vhost build, the added deps are ok for us +# Enable automatic driver loading from this path +setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"' + +# Enable bnx2x, pcap and vhost build, the added deps are ok for us +setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y setconf CONFIG_RTE_LIBRTE_PMD_PCAP y -setconf CONFIG_RTE_LIBRTE_VHOST y - -# If IVSHMEM enabled... -%if %{with ivshmem} - setconf CONFIG_RTE_LIBRTE_IVSHMEM y - setconf CONFIG_RTE_LIBRTE_IVSHMEM_DEBUG n - setconf CONFIG_RTE_LIBRTE_IVSHMEM_MAX_PCI_DEVS 4 - setconf CONFIG_RTE_LIBRTE_IVSHMEM_MAX_ENTRIES 128 - setconf CONFIG_RTE_LIBRTE_IVSHMEM_MAX_METADATA_FILES 32 - setconf CONFIG_RTE_EAL_SINGLE_FILE_SEGMENTS y -%endif +setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y %if %{with shared} setconf CONFIG_RTE_BUILD_SHARED_LIB y @@ -147,6 +160,12 @@ setconf CONFIG_RTE_BUILD_SHARED_LIB y # Disable kernel modules setconf CONFIG_RTE_EAL_IGB_UIO n setconf CONFIG_RTE_LIBRTE_KNI n +setconf CONFIG_RTE_KNI_KMOD n + +# Disable experimental and ABI-breaking code +setconf CONFIG_RTE_NEXT_ABI n +setconf CONFIG_RTE_LIBRTE_CRYPTODEV n +setconf CONFIG_RTE_LIBRTE_MBUF_OFFLOAD n make V=1 O=%{target} %{?_smp_mflags} @@ -158,37 +177,25 @@ make V=1 O=%{target}/examples T=%{target} %{?_smp_mflags} examples %endif %install +# In case dpdk-devel is installed +unset RTE_SDK RTE_INCLUDE RTE_TARGET -# DPDK's "make install" seems a bit broken -- do things manually... - -mkdir -p %{buildroot}%{_bindir} -cp -a %{target}/app/testpmd %{buildroot}%{_bindir}/testpmd -mkdir -p %{buildroot}%{_includedir}/%{name}-%{version} -cp -Lr %{target}/include/* %{buildroot}%{_includedir}/%{name}-%{version} -mkdir -p %{buildroot}%{_libdir} -cp -a %{target}/lib/* %{buildroot}%{_libdir} -mkdir -p %{buildroot}%{docdir} -cp -a %{target}/doc/* %{buildroot}%{docdir} +%make_install O=%{target} prefix=%{_usr} libdir=%{_libdir} +# Create a driver directory with symlinks to all pmds +mkdir -p %{buildroot}/%{pmddir} %if %{with shared} -libext=so -%else -libext=a +for f in %{buildroot}/%{_libdir}/*_pmd_*.so.*; do + bn=$(basename ${f}) + ln -s ../${bn} %{buildroot}%{pmddir}/${bn} +done %endif -# DPDK apps expect a particular (and somewhat peculiar) directory layout -# for building, arrange for that -mkdir -p %{buildroot}%{sdkdir}/lib -mkdir -p %{buildroot}%{sdkdir}/%{target} -cp -a %{target}/.config %{buildroot}%{sdkdir}/%{target} -ln -s ../../../include/%{name}-%{version} %{buildroot}%{sdkdir}/%{target}/include -cp -a mk/ %{buildroot}%{sdkdir} -mkdir -p %{buildroot}%{sdkdir}/scripts -cp -a scripts/*.sh %{buildroot}%{sdkdir}/scripts - -%if %{with tools} -cp -p tools/*.py %{buildroot}%{_bindir} +%if ! %{with tools} +rm -rf %{buildroot}%{sdkdir}/tools +rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind %endif +rm -f %{buildroot}%{sdkdir}/tools/setup.sh %if %{with examples} find %{target}/examples/ -name "*.map" | xargs rm -f @@ -196,21 +203,17 @@ for f in %{target}/examples/*/%{target}/app/*; do bn=`basename ${f}` cp -p ${f} %{buildroot}%{_bindir}/dpdk_${bn} done +%else +rm -rf %{buildroot}%{sdkdir}/examples %endif -# Create library symlinks for the "sdk" -for f in %{buildroot}/%{_libdir}/*.${libext}; do - l=`basename ${f}` - ln -s ../../${l} %{buildroot}/%{sdkdir}/lib/${l} -done - # Setup RTE_SDK environment as expected by apps etc mkdir -p %{buildroot}/%{_sysconfdir}/profile.d cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh if [ -z "\${RTE_SDK}" ]; then export RTE_SDK="%{sdkdir}" export RTE_TARGET="%{target}" - export RTE_INCLUDE="%{_includedir}/%{name}-%{version}" + export RTE_INCLUDE="%{incdir}" fi EOF @@ -218,19 +221,24 @@ cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.csh if ( ! \$RTE_SDK ) then setenv RTE_SDK "%{sdkdir}" setenv RTE_TARGET "%{target}" - setenv RTE_INCLUDE "%{_includedir}/%{name}-%{version}" + setenv RTE_INCLUDE "%{incdir}" endif EOF -# Fixup irregular modes in headers -find %{buildroot}%{_includedir}/%{name}-%{version} -type f | xargs chmod 0644 +# Fixup target machine mismatch +sed -i -e 's:-%{machine}-:-default-: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 # linker script which avoids these issues. Linking against the script during # build resolves into links to the actual used libraries which is just fine # for us, so this combined library is a build-time only construct now. -comblib=libintel_dpdk.${libext} +%if %{with shared} +libext=so +%else +libext=a +%endif +comblib=libdpdk.${libext} echo "GROUP (" > ${comblib} find %{buildroot}/%{_libdir}/ -maxdepth 1 -name "*.${libext}" |\ @@ -238,12 +246,21 @@ find %{buildroot}/%{_libdir}/ -maxdepth 1 -name "*.${libext}" |\ echo ")" >> ${comblib} install -m 644 ${comblib} %{buildroot}/%{_libdir}/${comblib} +%if %{with driverctl} +cd driverctl-%{dctlver} +make install DESTDIR=%{buildroot} +cd - +%endif + %files # BSD +%doc README MAINTAINERS %{_bindir}/testpmd +%{_bindir}/dpdk_proc_info +%dir %{pmddir} %if %{with shared} %{_libdir}/*.so.* -%{_libdir}/*_pmd_*.so +%{pmddir}/*.so.* %endif %files doc @@ -252,28 +269,92 @@ install -m 644 ${comblib} %{buildroot}/%{_libdir}/${comblib} %files devel #BSD -%{_includedir}/* -%{sdkdir} +%{incdir}/ +%{sdkdir}/ +%if %{with tools} +%exclude %{sdkdir}/tools/ +%endif +%if %{with examples} +%exclude %{sdkdir}/examples/ +%endif %{_sysconfdir}/profile.d/dpdk-sdk-*.* %if %{with shared} %{_libdir}/*.so -%exclude %{_libdir}/*_pmd_*.so %else %{_libdir}/*.a %endif - %if %{with examples} %files examples +%exclude %{_bindir}/dpdk_proc_info %{_bindir}/dpdk_* -%exclude %{_bindir}/*.py +%doc %{sdkdir}/examples/ %endif %if %{with tools} %files tools -%{_bindir}/*.py +%{sdkdir}/tools/ +%{_sbindir}/dpdk_nic_bind +%endif + +%if %{with driverctl} +%post -n driverctl +%udev_rules_update + +%postun -n driverctl +%udev_rules_update + +%files -n driverctl +%{_sbindir}/driverctl +/usr/lib/udev/rules.d/*.rules +/usr/lib/udev/vfio_name +%dir %{_sysconfdir}/driverctl.d +%{_sysconfdir}/bash-completion.d/driverctl-bash-completion.sh +%{_mandir}/man8/driverctl.8* %endif %changelog +* Wed Jan 27 2016 Panu Matilainen - 2.2.0-2 +- Use a different quoting method to avoid messing up vim syntax highlighting +- A string is expected as CONFIG_RTE_MACHINE value, quote it too +- Enable librte_vhost NUMA-awareness + +* Tue Jan 12 2016 Panu Matilainen - 2.2.0-1 +- Update DPDK to 2.2.0 final +- Add README and MAINTAINERS docs +- Adopt new upstream standard installation layout, including + dpdk_nic_bind.py renamed to dpdk_nic_bind +- Move the unversioned pmd symlinks from libdir -devel +- Establish a driver directory for automatic driver loading +- Disable CONFIG_RTE_SCHED_VECTOR, it conflicts with CONFIG_RTE_MACHINE default +- Disable experimental cryptodev library +- More complete dtneeded patch +- Make option matching stricter in spec setconf +- Update driverctl to 0.59 + +* Wed Dec 09 2015 Panu Matilainen - 2.1.0-5 +- Fix artifacts from driverctl having different version +- Update driverctl to 0.58 + +* Fri Nov 13 2015 Panu Matilainen - 2.1.0-4 +- Add driverctl sub-package + +* Fri Oct 23 2015 Panu Matilainen - 2.1.0-3 +- Enable bnx2x pmd, which buildrequires zlib-devel + +* Mon Sep 28 2015 Panu Matilainen - 2.1.0-2 +- Make lib and include available both ways in the SDK paths + +* Thu Sep 24 2015 Panu Matilainen - 2.1.0-1 +- Update to dpdk 2.1.0 final + - Disable ABI_NEXT + - Rebase patches as necessary + - Fix build of ip_pipeline example + - Drop no longer needed -Wno-error=array-bounds + - Rename libintel_dpdk to libdpdk + +* Tue Aug 11 2015 Panu Matilainen - 2.0.0-9 +- Drop main package dependency from dpdk-tools + * Wed May 20 2015 Panu Matilainen - 2.0.0-8 - Drop eventfd-link patch, its only needed for vhost-cuse