On 03/18/2016 01:11 PM, Bhanuprakash Bodireddy wrote:
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 <bhanuprakash.bodire...@intel.com>
---
  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

Um, /usr/src is in no way a standard location for dpdk. "make install" in dpdk >= 2.2.0 installs the sdk environment to <prefix>/share/dpdk/<target> where <prefix> by upstream default is /usr/local. Distros are likely to use /usr as the prfix.

I'd suggest using the dpdk upstream installation layout as a starting point for automatic discovery.

        - Panu -


_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to