From 1264144c999ae5cd1bda04376d6d59c25bff9dc1 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 09:57:13 +0200 Subject: utilize RTE_EAL_PMD_PATH This sets RTE_EAL_PMD_PATH to /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds. On creating the pmd library packages those get a symlink from that dir. This allows DPDK applications to autoload pmd drivers and only rely on the EAL -d option for those provided in other places (e.g. custom drivers). By that one can use testpmd/l2fwd/openvswitch-dpdk and others without passing -d to EAL. Each lib gets an extra relative symlink from the RTE_EAL_PMD_PATH dir to the lib itself e.g. for librte_vhost: ./usr/lib/x86_64-linux-gnu/dpdk-pmds/ ./usr/lib/x86_64-linux-gnu/dpdk-pmds/librte_vhost.so.3 -> ../librte_vhost.so.3 Change-Id: Idf997e58cfa5060961239b3ee0c22de89e0ed1a3 Signed-off-by: Christian Ehrhardt --- debian/rules | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 064ffc3b..e4684928 100755 --- a/debian/rules +++ b/debian/rules @@ -129,6 +129,7 @@ ifeq (,$(filter dpdk_config=%,$(DEB_BUILD_OPTIONS))) -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1$(DPDK_CONFIG_BUILD_KMOD),' \ -e 's,(LIBRTE_PMD_PCAP=).*,\1y,' \ -e 's,(LIBRTE_PMD_XENVIRT=).*,\1y,' \ + -e 's,(CONFIG_RTE_EAL_PMD_PATH=).*,\1"/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds/",' \ $(DPDK_STATIC_DIR)/.config # xen not available on ppc64el ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el)) @@ -206,9 +207,16 @@ override_dh_auto_install-arch: else \ PKG=$${LN}$${VER}; \ fi; \ + LIBF="$$(basename $${lib})"; \ + LIBD="debian/$${PKG}/$(LIBDIR)"; \ echo "moving $${lib} for library $${PKG}"; \ - mkdir -p debian/$${PKG}/$(LIBDIR); \ - mv $${lib} debian/$${PKG}/$(LIBDIR); \ + mkdir -p $${LIBD}; \ + mv $${lib} $${LIBD}; \ + if [ "$${LIBF#librte_pmd_}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ + ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ + fi; \ done # pkg-config mkdir -p debian/libdpdk-dev/$(LIBDIR)/pkgconfig -- cgit 1.2.3-korg From 2aba37c960a9ff5affceed98aa30f509be47546f Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 13:09:43 +0200 Subject: document pmd autoloading Add a section to debian/dpdk-doc.README.Debian to document pmd autoloading. Change-Id: Idbdc5b8634f5030cc6c845e7320d063d32f54c9b Signed-off-by: Christian Ehrhardt --- debian/dpdk-doc.README.Debian | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/dpdk-doc.README.Debian b/debian/dpdk-doc.README.Debian index 774a08cd..0e3866a9 100644 --- a/debian/dpdk-doc.README.Debian +++ b/debian/dpdk-doc.README.Debian @@ -49,4 +49,16 @@ against dpdk-dev that file will be adjusted for you. Alternatively /usr/include/dpdk/rte_config.h has to be pre-included: CFLAGS += -I/usr/include/dpdk -irte_config.h - -- Christian Ehrhardt Thu, 04 Feb 2016 09:16:11 +0100 +librte-pmd-* and DPDK PMD autoloading: + +PMD driver autoloading. DPDK since its split into several libraries does not +have all PMD drivers available by default. One always can use EAL argument -d +to provide a path to an extra .so file. +TO ease daily usage RTE_EAL_PMD_PATH is set to +/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds/. +Each librte-pmd-* package will place a symlink in there which makes DPDK load +and register it as PMD on startup. +This can also be used to globally enable extra PMD drivers as you can link +self-provided .so files in there to be considered. + + -- Christian Ehrhardt Thu, 29 Sep 2016 13:04:47 +0200 -- cgit 1.2.3-korg From 91333d2593faebed02728bb8fb9717c808407958 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 10:01:39 +0200 Subject: changelog: utilize RTE_EAL_PMD_PATH changelog update split to ease branch maintenance Change-Id: Ifa396a72b39504b74eb7c39852266dec0423f219 Signed-off-by: Christian Ehrhardt --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index dbe36170..ad50450c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -35,6 +35,8 @@ dpdk (16.07-0~git1) UNRELEASED; urgency=medium server/client sockets. * d/control add python-elftools and hwdata dependencies to dpdk for the tool dpdk-pmdinfo. + * d/rules utilize RTE_EAL_PMD_PATH to autoload pmd drivers + - d/dpdk-doc.README.Debian document usage of RTE_EAL_PMD_PATH [ Anders Roxell ] * debian/control: add pciutils to the dpdk depends list, since lspci is used -- cgit 1.2.3-korg From 341d9ed5cf2aa5da89397e62c900e2d325b8d634 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 16:40:50 +0200 Subject: add empty RTE_EAL_PMD_PATH dir to librte_eal If EAL is initialized and the path isn't existing at all (=no PMDs at all are installed) the initialization fails with: EAL: /usr/lib/x86_64-linux-gnu/dpdk-pmds/: cannot open shared object file: No such file or directory So since we support RTE_EAL_PMD_PATH now but can never guarantee that there always will be a PMD it becomes a requirement of librte_eal to have at least an empty path. An empty path is fine and will not load anything, but avoid the initializaiton error. Change-Id: I2725169c67c190f8ed8b608fc5ae508ae66eab1c Signed-off-by: Christian Ehrhardt --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index e4684928..ccd61406 100755 --- a/debian/rules +++ b/debian/rules @@ -217,6 +217,9 @@ override_dh_auto_install-arch: echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ fi; \ + if [ "$${LIBF#librte_eal}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + fi; \ done # pkg-config mkdir -p debian/libdpdk-dev/$(LIBDIR)/pkgconfig -- cgit 1.2.3-korg From 88cd9ce012eae15091281e50190f90affe3204fa Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 18:25:34 +0200 Subject: add PMDs as recommend for dpdk runtime. Once people pull in dpdk runtime they likely want to use it. These days PMDs are usually not covered by depends (other libraries are linked if used). To avoid the issue of systems that would work if just those packages would be installed recommend them. It is no real "dependency" things can work, therefore no depends. But it is as much recommends as recommendations can go. This got a bit amplified by removing libdpdk-dev from the depends which formerly pulled all in. Change-Id: I03cc329412de9d37c4fd203d09c8e27812bc9e5b Signed-off-by: Christian Ehrhardt --- debian/control | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5807c065..348e15f5 100644 --- a/debian/control +++ b/debian/control @@ -36,7 +36,25 @@ Depends: lsb-base (>= 3.2-14), ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} -Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], dpdk-rte-kni-dkms (= ${binary:Version}) [arm64] +Recommends: dpdk-igb-uio-dkms (= ${binary:Version}) [arm64], dpdk-rte-kni-dkms (= ${binary:Version}) [arm64], + librte-pmd-af-packet1 (= ${binary:Version}), + librte-pmd-bnxt1 (= ${binary:Version}), + librte-pmd-bond1 (= ${binary:Version}), + librte-pmd-cxgbe1 (= ${binary:Version}), + librte-pmd-e1000-1 (= ${binary:Version}), + librte-pmd-ena1 (= ${binary:Version}), + librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386], + librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386], + librte-pmd-i40e1 (= ${binary:Version}) [amd64 i386], + librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386], + librte-pmd-null-crypto1 (= ${binary:Version}), + librte-pmd-null1 (= ${binary:Version}), + librte-pmd-pcap1 (= ${binary:Version}), + librte-pmd-ring2 (= ${binary:Version}), + librte-pmd-vhost1 (= ${binary:Version}), + librte-pmd-virtio1 (= ${binary:Version}), + librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386], + librte-pmd-xenvirt1 (= ${binary:Version}) [amd64 arm64 i386], Suggests: linux-image-generic, dpdk-igb-uio-dkms (= ${binary:Version}), dpdk-rte-kni-dkms (= ${binary:Version}) Description: Data Plane Development Kit (runtime) DPDK is a set of libraries for fast packet processing. Applications run -- cgit 1.2.3-korg From fe79dd192a7d47562967c72d748eb9d872633f48 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 29 Sep 2016 18:32:07 +0200 Subject: changelog: add PMDs as recommend for dpdk runtime Change-Id: I1aeb0f62e2abeb42b5e75a1058b45400a934fabb Signed-off-by: Christian Ehrhardt --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index ad50450c..b5a00513 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,8 @@ dpdk (16.07-0~git1) UNRELEASED; urgency=medium dpdk-pmdinfo. * d/rules utilize RTE_EAL_PMD_PATH to autoload pmd drivers - d/dpdk-doc.README.Debian document usage of RTE_EAL_PMD_PATH + - d/control let the runtime of dpdk recommend the pmd drivers to make them + avail for auto-proping devices. [ Anders Roxell ] * debian/control: add pciutils to the dpdk depends list, since lspci is used -- cgit 1.2.3-korg