From patchwork Wed Aug 20 17:11:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 35710 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7245D20560 for ; Wed, 20 Aug 2014 17:12:01 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf61271938pde.2 for ; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=FxYgiWKT2BunmeCYfCiXhoXIBDA/l7KT8k+GFGgxOCE=; b=XLPMhg7VAJ+yDqbd1ID/gwDvsZG5MCj2HsK6aSBECaOm9sVtBq/IUa+jfdk5Xq0d/H YKnCYRYw0jcqA59IyMdDSzeS6Cbhw3aSxWadDOI+NW1J5STrGLexCG85WR98qc9V11Ee xY9tMa6E64CCmgRxUeCJpt/TA7NbPsIiiEchwbARwrhyYlnIkZd37O1rNTphhn6wj+Q9 PaFAfpljqS6ED37ghKb3OPR57i3NYeK24SQfpoHAbIUoxZY+tOFz81s+TuJWfGgy2F1d NaEULOMwI4unIa9SM3y2UnaSLTOPO/6jN89bP6Z5BC9Fp5oOyTBNXEgu4fI4sR5+QYDv nZag== X-Gm-Message-State: ALoCoQmQ1D3wUod2jvoaicum5HXYVT/e7rVFwEn09KQIKT7fmLSr3ggASFdF4nVqopYdwCYB3rNW X-Received: by 10.70.41.230 with SMTP id i6mr9712220pdl.2.1408554713467; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.112 with SMTP id 103ls380584qga.9.gmail; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) X-Received: by 10.52.253.39 with SMTP id zx7mr1436931vdc.2.1408554713284; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id n20si11074890vcq.104.2014.08.20.10.11.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Aug 2014 10:11:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so9299348vcb.24 for ; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr7663197vcq.50.1408554713120; Wed, 20 Aug 2014 10:11:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp69760vcb; Wed, 20 Aug 2014 10:11:52 -0700 (PDT) X-Received: by 10.236.7.109 with SMTP id 73mr2608842yho.148.1408554712533; Wed, 20 Aug 2014 10:11:52 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id e9si34829418qae.54.2014.08.20.10.11.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Aug 2014 10:11:52 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XK9QM-0002n2-F2; Wed, 20 Aug 2014 17:11:50 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XK9QE-0002mV-PQ for lng-odp@lists.linaro.org; Wed, 20 Aug 2014 17:11:42 +0000 Received: by mail-la0-f49.google.com with SMTP id hz20so7589073lab.36 for ; Wed, 20 Aug 2014 10:11:35 -0700 (PDT) X-Received: by 10.152.115.228 with SMTP id jr4mr44288206lab.43.1408554695151; Wed, 20 Aug 2014 10:11:35 -0700 (PDT) Received: from sestofb10.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id dv6sm2008002lbc.32.2014.08.20.10.11.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Aug 2014 10:11:34 -0700 (PDT) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Wed, 20 Aug 2014 19:11:16 +0200 Message-Id: <1408554678-55317-3-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408554678-55317-1-git-send-email-ciprian.barbu@linaro.org> References: <1408554678-55317-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [APPS PATCH 2/4] Config options for building with ODP X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ciprian.barbu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Ciprian Barbu --- Makefile.am | 1 + acinclude.m4 | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + lib/automake.mk | 6 +++++ 4 files changed, 88 insertions(+) diff --git a/Makefile.am b/Makefile.am index eb58101..8ac933d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ EXTRA_DIST = \ INSTALL.KVM \ INSTALL.Libvirt \ INSTALL.NetBSD \ + INSTALL.ODP \ INSTALL.RHEL \ INSTALL.SSL \ INSTALL.XenServer \ diff --git a/acinclude.m4 b/acinclude.m4 index 7e036e5..a389b84 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -218,6 +218,86 @@ AC_DEFUN([OVS_CHECK_DPDK], [ AM_CONDITIONAL([DPDK_NETDEV], test -n "$RTE_SDK") ]) +dnl OVS_CHECK_ODP +dnl +dnl Configure ODP source tree +AC_DEFUN([OVS_CHECK_ODP], [ + AC_MSG_CHECKING([for ODP]) + + AC_ARG_WITH([odp], + [AC_HELP_STRING([--with-odp=[@<:@DIR | yes | no@:>@]], + [Specify the ODP build directory or system default])], + [ + case "$withval" in + "" | n | no) + with_odp="" + ;; + y | ye | yes) + ODP=yes + ;; + *) + ODP=$withval + if test -f "${ODP}/include/odp.h" ; then + ODP_INCLUDE=$ODP/include + ODP_PLATFORM_INCLUDE=$ODP/platform/linux-generic/include + ODP_PLATFORM_INCLUDE_API=$ODP/platform/linux-generic/include/api + else + AC_MSG_ERROR([cannot find ODP headers]) + fi + + if test -f "${ODP}/lib/libodp.a" ; then + ODP_LIB_DIR="${ODP}/lib" + elif test -f "${ODP}/lib/.libs/libodp.a" ; then + ODP_LIB_DIR="${ODP}/lib/.libs" + else + AC_MSG_ERROR([cannot find ODP lib]) + fi + + AC_SUBST([ODP_INCLUDE]) + AC_SUBST([ODP_PLATFORM_INCLUDE]) + AC_SUBST([ODP_PLATFORM_INCLUDE_API]) + AC_SUBST([ODP_LIB_DIR]) + CFLAGS="$CFLAGS -I$ODP_INCLUDE -I$ODP_PLATFORM_INCLUDE -I$ODP_PLATFORM_INCLUDE_API" + LDFLAGS="$LDFLAGS -L$ODP_LIB_DIR" + ;; + esac + ] + ) + + if test X"$with_odp" != X; then + # On some systems we have to add -ldl to link with ODP + # + # This code, at first, tries to link without -ldl (""), + # then adds it and tries again. + # Before each attempt the search cache must be unset, + # otherwise autoconf will stick with the old result + + found=false + save_LIBS=$LIBS + for extras in "" "-ldl"; do + LIBS="-lodp $extras $save_LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], + [odp_init_global();])], + [found=true]) + if $found; then + break + fi + done + if $found; then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([cannot link with ODP]) + fi + + AC_DEFINE([ODP_NETDEV], [1], [System uses the ODP module.]) + else + ODP= + fi + + AM_CONDITIONAL([ODP_NETDEV], test -n "$ODP") +]) + dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH]) dnl dnl Greps FILE for REGEX. If it matches, runs IF-MATCH, otherwise IF-NO-MATCH. diff --git a/configure.ac b/configure.ac index 971c7b3..bdcd610 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,7 @@ AC_ARG_VAR(KARCH, [Kernel Architecture String]) AC_SUBST(KARCH) OVS_CHECK_LINUX OVS_CHECK_DPDK +OVS_CHECK_ODP AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(datapath/Makefile) diff --git a/lib/automake.mk b/lib/automake.mk index d46613f..a264b97 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -324,6 +324,12 @@ lib_libopenvswitch_la_SOURCES += \ lib/netdev-dpdk.h endif +if ODP_NETDEV +lib_libopenvswitch_la_SOURCES += \ + lib/netdev-odp.c \ + lib/netdev-odp.h +endif + if WIN32 lib_libopenvswitch_la_SOURCES += \ lib/netlink-notifier.c \