From patchwork Sun Dec 3 01:00:00 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: 120430 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2863808qgn; Sat, 2 Dec 2017 17:00:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMaftXsdFGV4NFKDfLDgSYmkpWsR3fr8PKt3rFgJY7hJUNhzVyMrCtv+Qg3SxqcuHrFw4ysl X-Received: by 10.55.162.84 with SMTP id l81mr13574457qke.29.1512262848702; Sat, 02 Dec 2017 17:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512262848; cv=none; d=google.com; s=arc-20160816; b=VMW/q+E6zKavhQgeVjyHQgv6r1NmfYcaBhfzR4RjTchbdK6N3mgM2HFnjJB/ycMj6m PaO0sMTqztSLu0DUZ58zcxac6NQ6xnTtlzWazM5FADynYnohc9u8FryGFdZYopVt08RD PvP0roeC8sQOmj22Ew4DzDvuvQmcI0+rAoUOWbkK8rooXyHFTBBK7N1qV9NPG/JyHwhR 2JER7Xa9qYcF+8pCIrpgmhn0Wy5UqEjwDCMZjG/UCj2Mho5dj+7zCb/3a8317YIbRZx6 lO2bq0WWqeqAOiZ7Cy5UnXacOBSk2NIlRaB0wf6o+vXS/F4RTx6Rgs8oTw0nqkJ3qhNa zFQg== 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=62uAgKrK/yVWjzzJy2EJfZ6UAcfeccbHOrF+gpH47N0=; b=Pv9ySrGtsV924Z4yTng7v9bZ4d0LueLTIPU3gULlaCLsneO/xQTb/nmh0ew9gvNtJk RtCtPvuwKGkXmJyXHfpTIL4/79CMRaEnuB9IFH4eSr4ulkA36Pdo8PAjVhZYDp955xxe dil6hyMsJ6/RR09s175tOdEOZMxUoMtBbtVirUHjiMhnkJgLSqnodi6qGnOylkiL+kvl 2o4pN+QMj7po3qM/4FBFMTCab9OENa/aYjLzkrlgSoBsq3IfxxbVxM3fCrfM9L3jrCg0 BTf/+9uFaiwC4knZMqoZM3SssO+liiTCGFaijS/jFHy3Iqb059rNDWgxDRpIsbg08Fg/ DrxA== 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 2si5653622qkm.450.2017.12.02.17.00.48; Sat, 02 Dec 2017 17:00:48 -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 663A26094A; Sun, 3 Dec 2017 01:00:48 +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 5B92D6073F; Sun, 3 Dec 2017 01:00:16 +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 E6DBB6073F; Sun, 3 Dec 2017 01:00:11 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id E1ECF60690 for ; Sun, 3 Dec 2017 01:00:09 +0000 (UTC) Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward102p.mail.yandex.net (Yandex) with ESMTP id E988C430190F for ; Sun, 3 Dec 2017 04:00:07 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XXCK7krCZb-07C4psrh; Sun, 03 Dec 2017 04:00:07 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rRTmwan6So-06dmtCNK; Sun, 03 Dec 2017 04:00:06 +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: Sun, 3 Dec 2017 04:00:00 +0300 Message-Id: <1512262805-15125-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512262805-15125-1-git-send-email-odpbot@yandex.ru> References: <1512262805-15125-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v1 1/6] 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 Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 321 (lumag:dpdk-system-master) ** https://github.com/Linaro/odp/pull/321 ** Patch: https://github.com/Linaro/odp/pull/321.patch ** Base sha: 5329e5211c447b9b823149baf76112eedfeb07fb ** Merge commit sha: 527862cca98549d4fc5bd0f966d3609477b20443 **/ 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 ])