From patchwork Mon Dec 11 16:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 121422 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2974475qgn; Mon, 11 Dec 2017 08:03:45 -0800 (PST) X-Google-Smtp-Source: ACJfBos+VcBmeDMCd7NYdUoIp0fLwukUcNykVRNMRr3mnXmc5j7HWu/OymN/NnGOXlsnZnIw+xZI X-Received: by 10.200.36.134 with SMTP id s6mr1195676qts.276.1513008225640; Mon, 11 Dec 2017 08:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513008225; cv=none; d=google.com; s=arc-20160816; b=I0XwVbv1KWEOaoDffK7SY9PEMjd27koFqZ5VqP1VO2YuFWBdpp8nDcz8xavMFr74sS J6IEmmjAE4msgjfaREB1T0+xIywvyCWcgxHVsguPpohUzO0Biv8hOtmYL81937LQiKYx XOUwbDH99clA8jv+zZY4Tkt9hW9sfhvM4RPS0+KVbOp031dQG7U22v553AYa6bma1on1 qxW9QygoDqS91MpkF79if/jYinaL+D6v1+IrgQZ8EfSSnRKdQBPU44GowghoS7Uk0EFt mG8MbZAYgsXVRVS3I3Vn4YeBa2ISF+tAIk32sWrRldQBn4TbYG0SPlTHLxVupMZaWqeE /aow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=NUYFO65INc5Pu9OCr4wAAcy2r04+npqDWpV4qDxOQmU=; b=mjKDgd3KoMBlYChle4f4VSkKkvVGSXAGfbfF6bqtPFcFoT+6Y8p5EFTCJNjG1DW8Rr kwzEg/u7Q0ipYjs1pC0NSJxLIQBFyOZ7mmzPAFn993wM6v3Yva4kT/GZU5Q2SQ9EKbXh o68TUZq8Vta6MUjZEe6VetYlhnTMGCgFwf718rNeWHN8wzBJalobNzN1XYHqNxZ/WGP+ ej9S0+45egJP7pEDs7YRu8NRH6UW1uqBTvm2ZxyisOQYxv29BMSOzloZjC2GGrg4cte6 uQcvO8QUS1abOX+Q0TijdRNkzxPj21WP1dBR7lhZ+4knVw3QvbX0M9g6og359TfT7yqQ QRhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id a39si3695564qtc.268.2017.12.11.08.03.45; Mon, 11 Dec 2017 08:03:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 440A3608DC; Mon, 11 Dec 2017 16:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 636A160965; Mon, 11 Dec 2017 16:00:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8373760902; Mon, 11 Dec 2017 16:00:27 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id D53316092E for ; Mon, 11 Dec 2017 16:00:17 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 02EE94303E55 for ; Mon, 11 Dec 2017 19:00:16 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Yt90FLBlgb-0F08KRb2; Mon, 11 Dec 2017 19:00:15 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id BifhbGdIDb-0FTKgqjt; Mon, 11 Dec 2017 19:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 11 Dec 2017 19:00:03 +0300 Message-Id: <1513008012-9231-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513008012-9231-1-git-send-email-odpbot@yandex.ru> References: <1513008012-9231-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 335 Subject: [lng-odp] [PATCH API-NEXT v1 5/14] configure: separate common DPDK check to odp_dpdk.m4 X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Separate DPDK macros to top-level file so that they can be reused by other implementations (like ODP-DPDK). Signed-off-by: Dmitry Eremin-Solenikov Reviewed-and-tested-by: Matias Elo --- /** Email created from pull request 335 (muvarov:devel/api-next_master_merge) ** https://github.com/Linaro/odp/pull/335 ** Patch: https://github.com/Linaro/odp/pull/335.patch ** Base sha: 630d8422564ebf4991b468cb38a29e9483fc2ec2 ** Merge commit sha: 2de2af9eca01b713e51c66fee7a5c7e535502f85 **/ m4/odp_dpdk.m4 | 49 +++++++++++++++++++++++++++++++++++ platform/linux-generic/m4/odp_dpdk.m4 | 35 +++++-------------------- 2 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 m4/odp_dpdk.m4 diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 new file mode 100644 index 000000000..636170a7f --- /dev/null +++ b/m4/odp_dpdk.m4 @@ -0,0 +1,49 @@ +# ODP_DPDK_PMDS(DPDK_DRIVER_PATH) +# ------------------------------- +# Build a list of DPDK PMD drivers in DPDK_PMDS variable +AC_DEFUN([ODP_DPDK_PMDS], [dnl +AS_VAR_SET([DPDK_PMDS], [-Wl,--whole-archive,]) +for filename in "$1"/librte_pmd_*.a; do +cur_driver=`basename "$filename" .a | sed -e 's/^lib//'` +# rte_pmd_nfp has external dependencies which break linking +if test "$cur_driver" = "rte_pmd_nfp"; then + echo "skip linking rte_pmd_nfp" +else + AS_VAR_APPEND([DPDK_PMDS], [-l$cur_driver,]) +fi +done +AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) +AC_SUBST([DPDK_PMDS]) +]) + +# ODP_DPDK_CHECK(CPPFLAGS, LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +# ----------------------------------------------------------------------- +# Check for DPDK availability +AC_DEFUN([ODP_DPDK_CHECK], [dnl +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_LDFLAGS=$LDFLAGS +OLD_LIBS=$LIBS +OLD_CPPFLAGS=$CPPFLAGS +LDFLAGS="$2 $LDFLAGS" +CPPFLAGS="$1 $CPPFLAGS" + +dpdk_check_ok=yes + +AC_CHECK_HEADERS([rte_config.h], [], + [dpdk_check_ok=no]) + +AC_CHECK_LIB([dpdk], [rte_eal_init], [], + [dpdk_check_ok=no], [-ldl -lpthread -lnuma]) +AS_IF([test "x$dpdk_check_ok" != "xno"], + [m4_default([$3], [:])], + [m4_default([$4], [:])]) + +########################################################################## +# Restore old saved variables +########################################################################## +LDFLAGS=$OLD_LDFLAGS +LIBS=$OLD_LIBS +CPPFLAGS=$OLD_CPPFLAGS +]) diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index 1e8fa2de9..ba0fdc935 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -3,9 +3,10 @@ ########################################################################## pktio_dpdk_support=no AC_ARG_WITH([dpdk-path], -AS_HELP_STRING([--with-dpdk-path=DIR path to dpdk build directory]), +[AS_HELP_STRING([--with-dpdk-path=DIR], [path to dpdk build directory])], [DPDK_PATH="$withval" DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include" + DPDK_LDFLAGS="-L$DPDK_PATH/lib" pktio_dpdk_support=yes],[]) ########################################################################## @@ -13,17 +14,11 @@ AS_HELP_STRING([--with-dpdk-path=DIR path to dpdk build directory]), ########################################################################## zero_copy=0 AC_ARG_ENABLE([dpdk-zero-copy], - [ --enable-dpdk-zero-copy enable experimental zero-copy DPDK pktio mode], + [AS_HELP_STRING([--enable-dpdk-zero-copy], [enable experimental zero-copy DPDK pktio mode])], [if test x$enableval = xyes; then zero_copy=1 fi]) -########################################################################## -# Save and set temporary compilation flags -########################################################################## -OLD_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$DPDK_CPPFLAGS $CPPFLAGS" - ########################################################################## # Check for DPDK availability # @@ -32,37 +27,21 @@ CPPFLAGS="$DPDK_CPPFLAGS $CPPFLAGS" ########################################################################## if test x$pktio_dpdk_support = xyes then - AC_CHECK_HEADERS([rte_config.h], [], - [AC_MSG_FAILURE(["can't find DPDK header"])]) + ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [], + [AC_MSG_FAILURE([can't find DPDK])]) - AS_VAR_SET([DPDK_PMDS], [-Wl,--whole-archive,]) - for filename in "$DPDK_PATH"/lib/librte_pmd_*.a; do - cur_driver=`basename "$filename" .a | sed -e 's/^lib//'` - # rte_pmd_nfp has external dependencies which break linking - if test "$cur_driver" = "rte_pmd_nfp"; then - echo "skip linking rte_pmd_nfp" - else - AS_VAR_APPEND([DPDK_PMDS], [-l$cur_driver,]) - fi - done - AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) + ODP_DPDK_PMDS([$DPDK_PATH/lib]) AC_DEFINE([ODP_PKTIO_DPDK], [1], [Define to 1 to enable DPDK packet I/O support]) AC_DEFINE_UNQUOTED([ODP_DPDK_ZERO_COPY], [$zero_copy], [Define to 1 to enable DPDK zero copy support]) - DPDK_LIBS="-L$DPDK_PATH/lib -ldpdk -lpthread -ldl -lpcap -lm -lnuma" + DPDK_LIBS="$DPDK_LDFLAGS -ldpdk -lpthread -ldl -lpcap -lm -lnuma" AC_SUBST([DPDK_CPPFLAGS]) AC_SUBST([DPDK_LIBS]) - AC_SUBST([DPDK_PMDS]) else pktio_dpdk_support=no fi -########################################################################## -# Restore old saved variables -########################################################################## -CPPFLAGS=$OLD_CPPFLAGS - AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ])