Skip to content

Commit

Permalink
netdev-dpdk: Make libnuma dependencies optional
Browse files Browse the repository at this point in the history
Prior to this patch, OVS with DPDK required the libnuma packages to
build. This patch removes this dependency, making it only a requirement
when the CONFIG_RTE_LIBRTE_VHOST_NUMA option is detected as enabled in
the DPDK build.

Signed-off-by: Ciara Loftus <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
cloftus authored and ddiproietto committed Aug 5, 2016
1 parent 8d38823 commit 435aadd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ addons:
packages:
- bc
- gcc-multilib
- libnuma-dev
- libssl-dev
- llvm-dev
- libjemalloc1
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.DPDK-ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ right PCIe slot.
CONFIG_RTE_LIBRTE_VHOST_NUMA=y, vHost User ports automatically
detect the NUMA socket of the QEMU vCPUs and will be serviced by a PMD
from the same node provided a core on this node is enabled in the
pmd-cpu-mask.
pmd-cpu-mask. libnuma packages are required for this feature.
### 3.7 Compiler Optimizations
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.DPDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The DPDK support of Open vSwitch is considered 'experimental'.

### Prerequisites

* Required: DPDK 16.07, libnuma
* Required: DPDK 16.07
* Hardware: [DPDK Supported NICs] when physical ports in use

## <a name="build"></a> 2. Building and Installation
Expand Down
14 changes: 12 additions & 2 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,17 @@ AC_DEFUN([OVS_CHECK_DPDK], [
[AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse support enabled, vhost-user disabled.])
DPDK_EXTRA_LIB="-lfuse"])
AC_SEARCH_LIBS([get_mempolicy],[numa],[],[AC_MSG_ERROR([unable to find libnuma, install the dependency package])])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[
#include <rte_config.h>
#if RTE_LIBRTE_VHOST_NUMA
#error
#endif
], [])
], [],
[AC_SEARCH_LIBS([get_mempolicy],[numa],[],[AC_MSG_ERROR([unable to find libnuma, install the dependency package])])
DPDK_EXTRA_LIB="-lnuma"])
# On some systems we have to add -ldl to link with dpdk
#
Expand All @@ -221,7 +231,7 @@ AC_DEFUN([OVS_CHECK_DPDK], [
DPDKLIB_FOUND=false
save_LIBS=$LIBS
for extras in "" "-ldl"; do
LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB -lnuma"
LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <rte_config.h>
#include <rte_eal.h>],
Expand Down
2 changes: 0 additions & 2 deletions rhel/openvswitch-fedora.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ BuildRequires: libcap-ng libcap-ng-devel
%endif
%if %{with dpdk}
BuildRequires: dpdk-devel >= 2.2.0
BuildRequires: numactl-devel
Requires: numactl-libs
Provides: %{name}-dpdk = %{version}-%{release}
%endif

Expand Down

0 comments on commit 435aadd

Please sign in to comment.