From patchwork Sun Dec 3 01:00:01 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: 120432 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2864975qgn; Sat, 2 Dec 2017 17:02:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMY3I55emNlRZ35xod1QcmMMO9c94uBvjoaCj49wcHgqm9cJJEo/OABL5sorw55u6bDAfwcV X-Received: by 10.200.37.203 with SMTP id f11mr16188105qtf.230.1512262927047; Sat, 02 Dec 2017 17:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512262927; cv=none; d=google.com; s=arc-20160816; b=QKyfTTqMI678BpvY+jfoqVfUh1F5K5PU4Q8epGooW2Q6Yuu0hcLIj8Yk3cQlmd/r6j +Le/k2tVwwSFnOSSXDZiplUKWMghKs+kLtc/ol7FR35qhpaBQkuUTdJ9XZx/+xFn5X3n EmOzpnSlU0hOOnGJVVe3EnDWuMovWqv6obniecT8G8wWtNQS92sOl0Qu0JRCJ1j5GmC9 z80a6zNVIOMhGhgnrEWeVnDRgq1lD/ouPPYNm/PkmBLNTr1BlKGWZC5ucjao+rjtiafV PQju8RpQzL0YC8LyqMOydXobrSMD5MPF+KE7UAFFOrwMilVaWPlg6mgwDiYBCgs1NPEJ 9X+g== 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=aUoss//EdVjKofQkeAOZI740biDX7f4XmXVKONnz3/c=; b=QMuvYkDsg0+qfp8RsfLQpuwXv5D8B7RMXCM9WKld+r07BCChaYJS2ILmrOEaNCStDn eFImHevCnMru/HPuD5cVYF5Jo6+aomqJDZ0xKtqRD486ckEdP+JeNmu7ao4ShdQ1ZGUi YEcj3nWDrcHvkqHWDbCmfiw40Az1wa0Gjv/OKOAz5jhRkeJV6Jlb2FDCCBesG2IZbI/5 fiP9Ha6OmNaEJCZHz6pq7NKN2WFRMbJvbuGTqz3uyrKID4LA8OEeJjlY2WXV0lCU0VKo w29MOP8t9Zy8SIpPH8MB5WdmmHy6Bgc1C6eGTdGsgRIHzHDdWl6Tf30uBvZumsHWJZkO ef7A== 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 v15si10115906qtc.47.2017.12.02.17.02.06; Sat, 02 Dec 2017 17:02:07 -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 C00F5609EF; Sun, 3 Dec 2017 01:02:06 +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 1AE07609C0; Sun, 3 Dec 2017 01:00:24 +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 F1DA960724; Sun, 3 Dec 2017 01:00:13 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 5B02260692 for ; Sun, 3 Dec 2017 01:00:10 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward101j.mail.yandex.net (Yandex) with ESMTP id A8D3C1242479 for ; Sun, 3 Dec 2017 04:00:08 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TT9QChEy9h-08kiKCAx; Sun, 03 Dec 2017 04:00:08 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rRTmwan6So-07dKmKGE; Sun, 03 Dec 2017 04:00:08 +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:01 +0300 Message-Id: <1512262805-15125-3-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 2/6] linux-gen: add support for using system-wide DPDK 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 | 20 +++++++++++++++++--- platform/linux-generic/m4/odp_dpdk.m4 | 21 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 636170a7f..03ad80c71 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -34,10 +34,24 @@ 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]) +DPDK_LIBS="" +LIBS="$LIBS -ldpdk" +AS_IF([test "x$DPDK_LIBS" = "x"], + [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])], + [DPDK_LIBS="$2 -ldpdk"])]) +LIBS="$LIBS -ldl -lpthread" +AS_IF([test "x$DPDK_LIBS" = "x"], + [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])], + [DPDK_LIBS="$2 -ldpdk -lm -ldl -lpthread"])]) +LIBS="$LIBS -lnuma" +AS_IF([test "x$DPDK_LIBS" = "x"], + [AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])], + [DPDK_LIBS="$2 -ldpdk -lm -ldl -lpthread -lnuma"])]) +AS_IF([test "x$DPDK_LIBS" = "x"], + [dpdk_check_ok=no]) AS_IF([test "x$dpdk_check_ok" != "xno"], - [m4_default([$3], [:])], + [AC_SUBST([DPDK_LIBS]) + m4_default([$3], [:])], [m4_default([$4], [:])]) ########################################################################## diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index ba0fdc935..c0d468c2a 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -5,9 +5,21 @@ pktio_dpdk_support=no AC_ARG_WITH([dpdk-path], [AS_HELP_STRING([--with-dpdk-path=DIR], [path to dpdk build directory])], [DPDK_PATH="$withval" + pktio_dpdk_support=yes],[]) + +if test "x$DPDK_PATH" = "xsystem" ; then + DPDK_CPPFLAGS="-msse4.2 -isystem/usr/include/dpdk" + DPDK_LDFLAGS="" + DPDK_PMD_PATH="`$CC --print-file-name=librte_pmd_null.a`" + DPDK_PMD_PATH="`dirname "$DPDK_PMD_PATH"`" + if test "x$DPDK_PMD_PATH" = "x" ; then + AC_MSG_FAILURE([Could not locate system DPDK PMD directory]) + fi +else DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include" DPDK_LDFLAGS="-L$DPDK_PATH/lib" - pktio_dpdk_support=yes],[]) + DPDK_PMD_PATH="$DPDK_PATH/lib" +fi ########################################################################## # Enable zero-copy DPDK pktio @@ -30,14 +42,17 @@ then ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [], [AC_MSG_FAILURE([can't find DPDK])]) - ODP_DPDK_PMDS([$DPDK_PATH/lib]) + ODP_DPDK_PMDS([$DPDK_PMD_PATH]) 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="$DPDK_LDFLAGS -ldpdk -lpthread -ldl -lpcap -lm -lnuma" + if test -r "$DPDK_PMD_PATH/librte_pmd_pcap.a" && + ! test -r "$DPDK_PMD_PATH/librte_pmd_pcap.so" ; then + DPDK_LIBS="$DPDK_LIBS -lpcap" + fi AC_SUBST([DPDK_CPPFLAGS]) AC_SUBST([DPDK_LIBS]) else