When using DPDK datapath, the OVS configure script requires the DPDK build directory passed on --with-dpdk. This can be avoided if the DPDK is installed in standard location i.e /usr/src.
This patch fixes the problem by searching for DPDK libraries in standard location and configures OVS sources for dpdk datapath. Signed-off-by: Bhanuprakash Bodireddy <[email protected]> --- acinclude.m4 | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 74f0494..c1036e4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -163,9 +163,41 @@ AC_DEFUN([OVS_CHECK_DPDK], [ [AC_HELP_STRING([--with-dpdk=/path/to/dpdk], [Specify the DPDK build directory])]) - if test X"$with_dpdk" != X; then - RTE_SDK=$with_dpdk + RTE_SDK="" + AC_MSG_CHECKING([whether dpdk datapath is enabled]) + case "$with_dpdk" in + yes) + AC_MSG_RESULT([$with_dpdk]) + DEFAULT_RTE_SDK="/usr/src/dpdk*" + DEFAULT_RTE_TARGET="x86_64-native-linuxapp-gcc" + dpdk_build=`find $DEFAULT_RTE_SDK -name $DEFAULT_RTE_TARGET 2>/dev/null | head -1` + if test -d "$dpdk_build"; then + AC_CHECK_FILE("$dpdk_build/lib/libdpdk.a", dpdk_lib=1, [AC_CHECK_FILE("$dpdk_build/lib/libdpdk.so", dpdk_lib=1, dpdk_lib=0)]) + if test "$dpdk_lib" = 1; then + RTE_SDK="$dpdk_build" + fi + else + AC_MSG_ERROR([Unable to find dpdk in /usr/src, if installed in a non-standard location specify the target location using '--with-dpdk' option]) + fi + ;; + no) + AC_MSG_RESULT([$with_dpdk]) + ;; + "") + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_RESULT([yes]) + AC_CHECK_FILE("$with_dpdk/lib/libdpdk.a", dpdk_lib=1, [AC_CHECK_FILE("$with_dpdk/lib/libdpdk.so", dpdk_lib=1, dpdk_lib=0)]) + if test "$dpdk_lib" = 1; then + RTE_SDK="$with_dpdk" + else + AC_MSG_ERROR([Invalid dpdk build directory $with_dpdk]) + fi + ;; + esac + if test X"$RTE_SDK" != X; then DPDK_INCLUDE=$RTE_SDK/include DPDK_LIB_DIR=$RTE_SDK/lib DPDK_LIB="-ldpdk" -- 1.7.4.1 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
