From patchwork Mon Dec 4 15: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: 120562 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4538999qgn; Mon, 4 Dec 2017 07:02:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMb25J9FS/o3nE/3Li2OuuuQGCvnF187kfKnRNq/Jehh3NGs4Joa5r7MyjHfKGbLD8K6/w3K X-Received: by 10.200.43.175 with SMTP id m44mr22193045qtm.92.1512399748445; Mon, 04 Dec 2017 07:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399748; cv=none; d=google.com; s=arc-20160816; b=Z15ULMrOgc3V7MBI71jK0M86m77uu7lqggbagDj528fSf6/5iLuUbhLV4UKLuKZORx LK0Y5ktYBE0dhP8KBfeWJaz5ZUolsLBQL+W6Cv/cNMBLLcYOx56vSqIqGh1tPjWfrGzD AUidqmmNpSCnrxBKMGRLBwhbgWqwsROqJoHRpHPVVsLxMTR6JdyQUDXX1fD0BBd4WIPO Spoj7bb73Rf3iM2ZX7SH+7DdHo7xtmIbAoe39nAFkrczhHDGXU2PK9j4Vk0YiyKTUM/R ElUWaMiIfmWJs9TFKr1fz4aZK2LoJnDPL95929GES9mTO4FnjLgkOV8XsqVLbucfpc8O b2lg== 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=0kTraMEscq8zgIQIcMA6OBA/LeZbt7CoT9KDGQcgGbo=; b=Ae0NqLq4J4nXYPfsDXOwZIt5aYr5gjwtMRkSe0EY7r1xfwzA4GpTA2wSGRAYOkjWCN bfqbt+V5PI8+AkkgBNWPd4JV/ixcMshIF4BpSEITRkoHN2MtqnxJfo8eB75q+EQEMzbp H5Kyo3Hp3yJYjg6RxrZedtgCT+IrqqdEmR4uRtlLai5WFoSog4P5QTfieciuQ3jRyRmw iPfS06uekzUfKWld+YO0PG82MXvbEOKz7VMDNWRLR5HmDQZ7LPHLwV3iLbZZVnjSM3Sw CBQYLpLJezzSYA0Xn4OUDyKd0eu05gd0fhJZOyg04IzSCGWEC5q+nc4bj5MLmIZa+omH 8rFg== 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 g67si10093663qkh.192.2017.12.04.07.02.14; Mon, 04 Dec 2017 07:02:28 -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 19A1E605D7; Mon, 4 Dec 2017 15:02:14 +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=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 B2F06605D7; Mon, 4 Dec 2017 15:00:33 +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 001D160686; Mon, 4 Dec 2017 15:00:16 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 4791560595 for ; Mon, 4 Dec 2017 15:00:12 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward100j.mail.yandex.net (Yandex) with ESMTP id C7F665D84E81 for ; Mon, 4 Dec 2017 18:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vjKzjbhSi7-0AGC4Mur; Mon, 04 Dec 2017 18:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-09EOnYZw; Mon, 04 Dec 2017 18:00:09 +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, 4 Dec 2017 18:00:03 +0300 Message-Id: <1512399608-12981-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v2 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 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 --- /** 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ 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 ]) From patchwork Mon Dec 4 15:00:04 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: 120561 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4537381qgn; Mon, 4 Dec 2017 07:01:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMb7v7JCCzO5gfY4eA0GymHwyNoTPItk70Mamnu8VSdj/kA2mMrjbd+BVAWpzgTtpBqZu6tU X-Received: by 10.200.50.39 with SMTP id x36mr13731063qta.255.1512399684891; Mon, 04 Dec 2017 07:01:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399684; cv=none; d=google.com; s=arc-20160816; b=otbGcibCZNZWxsg8bxQpNzsZCwDoCOpsb2u7mUObvPJlbqPyrQfZkc6jWuVzn8QFgK z9xKYuoUdPR5P0Dhun6J96PgfB7HH/XXQ9Q6oHi4/RJIZGWUAD+xc96dtLFOkw0jzVGF km9e/A1FmeH1PQGmHZwsSsccz9EgL3MqVm59lZysTCls+CyjuN3DM92bcDWMkta39ADs z5g5YUybhxmXZcLrBUt8+k7EK001HG3PZe/SfDVA9ZlEHmW+OoU2zgLwIm5qJxX5d2H4 pKqiakuVKXiUPIcspfvg0GkNjYaQ61PD5ui1qpgPad4gu7jQGZtaYmV78Mx5GNMSza6l Nfpg== 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=PpMykhtagHfS0ELul01YEgjbTUSC62fp+h5a378wFvo=; b=JAbnllNzQ6mUP2hCmB4Z40SBA733+zh9QeqmOv7/6wTZWl9iypcz2HyOfEcfy1xI6Q gWKv8yhGdnLLvRXwZdVTlO8OWK/8fr0LIcLQ7eFbwx3v7tnYV77ZopMfGjuAQnIJdqkb DWd7/C2q7mHZGZ9z67SR9+cmMe8l2p+jCH9OLl066BzCCmnwMs46EeDcEQ38fbxyDmIK 1viODkPH0IoQnYFPOSJEUVzIlS+mC/PRFPgB06ZKca8b4r8h0ORYuyT2dW3SRpbI2SQt 9RWZKFtWNIGIta3VBL/OsH2iEVbJOh8QM0B3o0WbtI76ZKtuMnEmDy30UdHPqKwMKEN0 mh5w== 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 f67si1373737qka.349.2017.12.04.07.01.23; Mon, 04 Dec 2017 07:01:24 -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 A172B60655; Mon, 4 Dec 2017 15:01:23 +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=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 78AAA6066C; Mon, 4 Dec 2017 15:00:27 +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 E3CD96066C; Mon, 4 Dec 2017 15:00:14 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 10E0760655 for ; Mon, 4 Dec 2017 15:00:13 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 739792D81F07 for ; Mon, 4 Dec 2017 18:00:11 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nv9fYeJu98-0BGqFAVY; Mon, 04 Dec 2017 18:00:11 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-0AEq51V8; Mon, 04 Dec 2017 18:00:10 +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, 4 Dec 2017 18:00:04 +0300 Message-Id: <1512399608-12981-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v2 2/6] linux-gen: apply -msse4.2 only in x86 case 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 Flag -msse4.2 should be used only for i?86/x86_64 targets, it does not make sense for any other target. 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ platform/linux-generic/Makefile.am | 6 ++++++ platform/linux-generic/m4/odp_dpdk.m4 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 9cb501cf3..bbe6a21c2 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -14,6 +14,12 @@ AM_CPPFLAGS += $(OPENSSL_CPPFLAGS) AM_CPPFLAGS += $(DPDK_CPPFLAGS) AM_CPPFLAGS += $(NETMAP_CPPFLAGS) +if PKTIO_DPDK +if ARCH_IS_X86 +AM_CFLAGS += -msse4.2 +endif +endif + odpincludedir= $(includedir)/odp odpinclude_HEADERS = \ include/odp/visibility_begin.h \ diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index ba0fdc935..91f76e2de 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -5,7 +5,7 @@ pktio_dpdk_support=no AC_ARG_WITH([dpdk-path], [AS_HELP_STRING([--with-dpdk-path=DIR], [path to dpdk build directory])], [DPDK_PATH="$withval" - DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include" + DPDK_CPPFLAGS="-isystem $DPDK_PATH/include" DPDK_LDFLAGS="-L$DPDK_PATH/lib" pktio_dpdk_support=yes],[]) From patchwork Mon Dec 4 15:00:05 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: 120566 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4543279qgn; Mon, 4 Dec 2017 07:05:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMbDsoljCR1jcs/wU41jCE7S/i7/Y0/644ST1Vg0uzFYXsVlvUUJitmpRLWH2wmKeKwX603Z X-Received: by 10.237.41.37 with SMTP id s34mr22905868qtd.154.1512399925513; Mon, 04 Dec 2017 07:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399925; cv=none; d=google.com; s=arc-20160816; b=gdfW27R8/Mxs1t9CPCh3TkWI9F8hhnSxc7OY7R1iwV8T+3ldOAKqEdJUPutavDx8xi TPOEqKXNz6RdKjWiWe68pOdcXx+zN814NDlK1Al2lD0xwB26bN6TRGs9BU28f/7iLPIs wL1giKkWtJok17V9U8P+Mw/e+GFatxusbjkrtX7BXm+hq2pw9wj7gtjKEq+gfGbo8Cdv Hbw54T/W8cKn90VvEXQAjEyOdRUt2HXvIpkzj//GLx6+b2m/plkpF8J96qiQ5CuN2E3r sbYRdwsPOYMVUjvgbHusT37nOv9E1ZuBNnkYghIcj6OoeS9BQ1aOusHa5RTjuYaDRuj0 bZVQ== 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=XTXA77FfWm+7OhJ0M9k1Wnge/oq6+moTBo97OwQQ/Dw=; b=RgJ3kHIx4njj7RHwhD1KGtWEsqxruVftJ1h/qIIt3GvJnWzW0r5n9oSxqqZn295oQq ZtaVGWXcCCvUn1R8wqxU6kKP732ZZII0KNLCkanEjHu6hLQMfYuLbSj/IkC315xfgp9O gPFHZen8DUmPTrKErYDmm2+Wt9P0ETi+GyDVLXnwTMUZ/cf3ZxkVKfoDpMk7eMFV7zfP smy9ZTRY40VRp/8f7Ce9k7XHfOIWI5Nrj9tdD0+ByK0EMB4S+RIVLKpb2+SqJeb2oO2d 7aTBAQP4S7cSpuXOQAEeONufLSMtHjEArSKEfNwlmy8ei009Drm5fyIOsMQqLSqBe0Oa ROlQ== 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 b65si12976347qkc.391.2017.12.04.07.05.10; Mon, 04 Dec 2017 07:05:25 -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 9278860810; Mon, 4 Dec 2017 15:05:10 +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=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 AD4426094A; Mon, 4 Dec 2017 15:00:49 +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 193CF608AA; Mon, 4 Dec 2017 15:00:25 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id BD45060655 for ; Mon, 4 Dec 2017 15:00:18 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 2DCEA6A83134 for ; Mon, 4 Dec 2017 18:00:12 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xFYlRj5vEK-0C8qYKMx; Mon, 04 Dec 2017 18:00:12 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-0BEqUdQP; Mon, 04 Dec 2017 18:00:11 +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, 4 Dec 2017 18:00:05 +0300 Message-Id: <1512399608-12981-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v2 3/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 Support using distro-installed DPDK for Pkt I/O. Distributions (like Ubuntu, Debian, etc) start providing DPDK packages. It is wise to enable users to use distro-provided DPDK version rather than requiring to always compile it from sources. 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ m4/odp_dpdk.m4 | 43 ++++++++++++++++++++++++++++------- platform/linux-generic/m4/odp_dpdk.m4 | 28 +++++++++++++++++++---- 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 636170a7f..05e60cc06 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -16,6 +16,31 @@ AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) AC_SUBST([DPDK_PMDS]) ]) +# _ODP_DPDK_CHECK_LIB(LDFLAGS, [LIBS], [EXTRA_LIBS]) +# ---------------------------------- +# Check if one can use -ldpdk with provided set of libs +AC_DEFUN([_ODP_DPDK_CHECK_LIB], [dnl +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_LDFLAGS=$LDFLAGS +OLD_LIBS=$LIBS +LDFLAGS="$1 $LDFLAGS" +LIBS="$LIBS -ldpdk $2" + +AC_MSG_CHECKING([for rte_eal_init in -ldpdk $2]) +AC_LINK_IFELSE([AC_LANG_CALL([], [rte_eal_init])], + [AC_MSG_RESULT([yes]) + DPDK_LIBS="$1 -ldpdk $3 $2"], + [AC_MSG_RESULT([no])]) + +########################################################################## +# Restore old saved variables +########################################################################## +LDFLAGS=$OLD_LDFLAGS +LIBS=$OLD_LIBS +]) + # ODP_DPDK_CHECK(CPPFLAGS, LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) # ----------------------------------------------------------------------- # Check for DPDK availability @@ -23,10 +48,7 @@ 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 @@ -34,16 +56,21 @@ 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="" +_ODP_DPDK_CHECK_LIB([$2]) +AS_IF([test "x$DPDK_LIBS" = "x"], + [_ODP_DPDK_CHECK_LIB([$2], [-ldl -lpthread], [-lm])]) +AS_IF([test "x$DPDK_LIBS" = "x"], + [_ODP_DPDK_CHECK_LIB([$2], [-ldl -lpthread -lnuma], [-lm])]) +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], [:])]) ########################################################################## # 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 91f76e2de..2beea365c 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -2,12 +2,27 @@ # Enable DPDK support ########################################################################## pktio_dpdk_support=no + +AC_ARG_ENABLE([pktio-dpdk], + [AS_HELP_STRING([--enable-pktio-dpdk], [enable DPDK support for Packet I/O])], + [pktio_dpdk_support=$enableval + DPDK_PATH=system]) + AC_ARG_WITH([dpdk-path], [AS_HELP_STRING([--with-dpdk-path=DIR], [path to dpdk build directory])], [DPDK_PATH="$withval" - DPDK_CPPFLAGS="-isystem $DPDK_PATH/include" - DPDK_LDFLAGS="-L$DPDK_PATH/lib" - pktio_dpdk_support=yes],[]) + pktio_dpdk_support=yes],[]) + +AS_IF([test "x$DPDK_PATH" = "xsystem"], + [DPDK_CPPFLAGS="-isystem/usr/include/dpdk" + DPDK_LDFLAGS="" + DPDK_PMD_PATH="`$CC --print-file-name=librte_pmd_null.a`" + DPDK_PMD_PATH="`dirname "$DPDK_PMD_PATH"`" + AS_IF([test "x$DPDK_PMD_PATH" = "x"], + [AC_MSG_FAILURE([Could not locate system DPDK PMD directory])])], + [DPDK_CPPFLAGS="-isystem $DPDK_PATH/include" + DPDK_LDFLAGS="-L$DPDK_PATH/lib" + DPDK_PMD_PATH="$DPDK_PATH/lib"]) ########################################################################## # Enable zero-copy DPDK pktio @@ -30,14 +45,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 From patchwork Mon Dec 4 15:00:06 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: 120567 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4543368qgn; Mon, 4 Dec 2017 07:05:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMYdBs5DyzQ9rYEcZxF3IP02EUC7YONFbQd/27cZJ9BoG3+cJDB64B50RgHJ5RhKfTOQg4aZ X-Received: by 10.237.60.206 with SMTP id e14mr21866001qtf.157.1512399928741; Mon, 04 Dec 2017 07:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399928; cv=none; d=google.com; s=arc-20160816; b=Xq2pU0qYxaTEdfYOXdjh1OmeQrox/tMdwXwq28f1rQhtWN2TqPJWfcqH0iXtZrB5gv YzWRov9iPc6wPaSO51959KeWvm2teXEWMgWbOV9jlh9QBg+m+IUlxhp5gRW+7X2LHAyR t2DktW+FdB6dBAU+jpFM6vPSQwwPfGWEkSXcKIAoNYwWxA6w2DUkvqRWSBF7z8zaIrAj BmV5avVKlTr8IG6Bot64aKAMqu3ZyfPxD0vHhRF4fP0eC+lFdIe8W+SpBI+a3earYbrM vxdsijAOWIiBBYGtbfpWc/kiC0zR+RSCffdKJMljASlZbRFNk0/0JTV3uINlq2BpUjv5 9L8A== 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=ozT6rDi4NRlWXUmyLGqR77FKUkGxMoQZE4OvcpOLWXM=; b=lfPx2aNFk0wQDD3lvgLPsYc2nJPvW3QZrQ+qCT5ZExAFYpeXhY7p9QKFsfHlmi2ttA Q+gyZrZMaMWAGQSkivrWo8vfnBdz/6dtyBm0Tk37NwIzI1AgBGZtt7F6lxNJu7L4JNFV 9lkdKTfPhKhFhDuHNl1ybpWChzg98vF9HJQMs6PW+s7Xt5kAOrtxba3roJhtgf37pcR7 BUzoAHwgy1vx2Uta6DvD/QtfruYfbl3sKNfttiotSoTnCl7tKL+AUQyfSloyH3xlWatt DPvXWcxDrBcgGtWRrk+ixd0jsi5upx7hIg6uWu4qsU5QyJZaA2LU4VXqhROhgs8nUo5s qRAA== 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 j50si5896714qta.224.2017.12.04.07.05.28; Mon, 04 Dec 2017 07:05:28 -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 71875608DE; Mon, 4 Dec 2017 15:05:28 +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=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 11AC960957; Mon, 4 Dec 2017 15:00:53 +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 CF09B608DD; Mon, 4 Dec 2017 15:00:28 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 8D0C560595 for ; Mon, 4 Dec 2017 15:00:18 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward101p.mail.yandex.net (Yandex) with ESMTP id D91BC6A83D36 for ; Mon, 4 Dec 2017 18:00:12 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vqKRPbTozt-0CZGd3SK; Mon, 04 Dec 2017 18:00:12 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-0CEOCsdF; Mon, 04 Dec 2017 18:00:12 +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, 4 Dec 2017 18:00:06 +0300 Message-Id: <1512399608-12981-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v2 4/6] linux-gen: pktio: support using DPDK lt 17.08 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 Debian unstable ships with DPDK 16.11. Add support for building with this version. 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ platform/linux-generic/pktio/dpdk.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 07671e62f..fa73cb93d 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -29,14 +29,27 @@ #include #include +#if __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wimplicit-fallthrough=0" +#endif #include +#if __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif #include #include #include #include +#include #include #include #include +#include + +#if RTE_VERSION < RTE_VERSION_NUM(17, 8, 0, 0) +#define rte_log_set_global_level rte_set_log_level +#endif #if ODP_DPDK_ZERO_COPY ODP_STATIC_ASSERT(CONFIG_PACKET_HEADROOM == RTE_PKTMBUF_HEADROOM, @@ -54,6 +67,7 @@ static int disable_pktio; /** !0 this pktio disabled, 0 enabled */ /* Has dpdk_pktio_init() been called */ static odp_bool_t dpdk_initialized; +#ifndef RTE_BUILD_SHARED_LIB #define MEMPOOL_OPS(hdl) \ extern void mp_hdlr_init_##hdl(void) @@ -77,6 +91,7 @@ void refer_constructors(void) mp_hdlr_init_ops_sp_mc(); mp_hdlr_init_ops_stack(); } +#endif /** * Calculate valid cache size for DPDK packet pool @@ -928,6 +943,11 @@ static int dpdk_close(pktio_entry_t *pktio_entry) rte_pktmbuf_free(pkt_dpdk->rx_cache[i].s.pkt[idx++]); } +#if RTE_VERSION < RTE_VERSION_NUM(17, 8, 0, 0) + if (pktio_entry->s.state != PKTIO_STATE_OPENED) + rte_eth_dev_close(pkt_dpdk->port_id); +#endif + return 0; } @@ -1064,14 +1084,16 @@ static void dpdk_mempool_free(struct rte_mempool *mp, void *arg ODP_UNUSED) static int dpdk_pktio_term(void) { - uint8_t port_id; - if (!dpdk_initialized) return 0; +#if RTE_VERSION >= RTE_VERSION_NUM(17, 8, 0, 0) + uint8_t port_id; + RTE_ETH_FOREACH_DEV(port_id) { rte_eth_dev_close(port_id); } +#endif if (!ODP_DPDK_ZERO_COPY) rte_mempool_walk(dpdk_mempool_free, NULL); From patchwork Mon Dec 4 15:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120565 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4542035qgn; Mon, 4 Dec 2017 07:04:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMYTndBHRSSxBY9exi7cK5gMTar4BXrb9354RA2UoANAC3gN46vAj/nQIQFZELhtlz+gikd0 X-Received: by 10.200.43.24 with SMTP id 24mr20298731qtu.153.1512399873530; Mon, 04 Dec 2017 07:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399873; cv=none; d=google.com; s=arc-20160816; b=TZxq+TRz9egXyBRocQqxVJKohzRpz2XjBtJx3k6xr2ZXfO51NZzGlqG2hBFqz81gKB KDoFEsQ7RK3IDoiqokhUlJ/K3YW11HzGF2RVF1XUucbXBk9aEwmXLOCUie9cN+UBFk4f bLV2qBVLgmRxyCd6JUVHFaZX5MFomL9asjmxa5f3lmzOQFjpij58BU87FUHtehWu66NO ZA7ogASse8YurgSsX3y68J3iDwUl1oMcVdtlWG0uMMMvBV8B4zvu715zXYIc8xFrwOwf O9NufD62f3fkSH97Kg0rNcVtP3rPuu6Mj2hzjeTO+cmctneaSvwzi61Pn3P5wfgAllqG /1yg== 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 :content-transfer-encoding:mime-version:github-pr-num:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=KdLARivhtdY237bOEhnC8eEdnK8DHV9Clv85RCohOxg=; b=l2TjDlW6Zft7BaOk8bXdo/O1SQ8Bx2ff9ue9vWP4EwEKbGl0/wkhtOGMhNrXfvrazy 0M/EkfW/PZ5xXJsHChd9eKshDF+yYBbx7sTH1SKAJHZa//CHfGcRGlJm7GPJcxUwLIs8 gJXBwF9ipYJwE9Cltn/ZvV8ALZN0p/sW4ED5vaAcMDPhmv81uCDVLgFEvgQTbRGm7YG0 D4iXwqgqcDp26DTPlk7CokmN6KIHQxVXGqJ/XrAC74IgS3j2OHJuYlKuabEtNcfQngis C3VFTy0HkLQ9pIim/zDVw1EXAyd+F+YuE+kJ90LFx3vRJMVqmRJLPFlB3ou6aJxO0D+H Mc5A== 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 123si705993qki.191.2017.12.04.07.04.21; Mon, 04 Dec 2017 07:04:33 -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 9763F60732; Mon, 4 Dec 2017 15:04:21 +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=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 5C7A960923; Mon, 4 Dec 2017 15:00:47 +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 B8008608BA; Mon, 4 Dec 2017 15:00:21 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 3DCC2604A1 for ; Mon, 4 Dec 2017 15:00:15 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 8C71A784F75 for ; Mon, 4 Dec 2017 18:00:13 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EkPs51YiBa-0DwG9gSs; Mon, 04 Dec 2017 18:00:13 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-0CE8m0hA; Mon, 04 Dec 2017 18:00:12 +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, 4 Dec 2017 18:00:07 +0300 Message-Id: <1512399608-12981-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 MIME-Version: 1.0 Subject: [lng-odp] [PATCH v2 5/6] linux-gen: dpdk: cast addresses to uintptr_t rather than uint64_t 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 This is to remove the following error: pktio/dpdk.c: In function ‘mbuf_data_off’: pktio/dpdk.c:126:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (uint64_t)pkt_hdr->buf_hdr.seg[0].data - ^ pktio/dpdk.c:127:4: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] (uint64_t)mbuf->buf_addr; 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ platform/linux-generic/pktio/dpdk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index fa73cb93d..705a7968c 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -123,8 +123,8 @@ static unsigned cache_size(uint32_t num) static inline uint16_t mbuf_data_off(struct rte_mbuf *mbuf, odp_packet_hdr_t *pkt_hdr) { - return (uint64_t)pkt_hdr->buf_hdr.seg[0].data - - (uint64_t)mbuf->buf_addr; + return (uintptr_t)pkt_hdr->buf_hdr.seg[0].data - + (uintptr_t)mbuf->buf_addr; } /** From patchwork Mon Dec 4 15:00:08 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: 120563 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4540376qgn; Mon, 4 Dec 2017 07:03:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMaon25Wueh5Bde4aazUyVpTLQxneNPCr5vc3/ztzwn1cfEJC0JUkg0+YpeYHywsHVm++1gx X-Received: by 10.37.200.135 with SMTP id y129mr9376069ybf.246.1512399804936; Mon, 04 Dec 2017 07:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512399804; cv=none; d=google.com; s=arc-20160816; b=BTZzx5K4VSe9qwBEttBIU76nr84EGt+/2ZcYq513jC19Vksu8vKe9qvbdl+ndQylod tOLql7gplBbxi1BB6E6oIqMorWJs5gZT2vRzgyg2hGkEja7+BvatHhckHHLYU1s8TJPs dd02YxX2huMEzHv2NQkf6wsIzOVLA3vSlm1rioqlVUiWXyLPjNiz9GYRkaHX+rScN01l w6xduOw3QzhvffcjQPqXqHuIMg7/e5/9xHM3ahZak0FhFkF8VQgTRgKkkjiDzw1akL2m +iHVimrTvBxxBoyQuBMKUdbQIHcsCFxQmV8s67CnAiAkIxdSlb1ck1pTa72FBRH5LL65 UfVA== 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=EbPoPf0cH3A4gNnd0Jp1eBJNfZvfw7z9mNpLlwa0xxA=; b=I3Y9RGkh+59YuTpW0+7kcZlbQd6xo3bYrJlfQ/5DQ08871D2Ad9yR8TmWTP4eDQRqa tpYzFr4YAQKcLd0/SGCBIrJ+bImFgeW4L6PMmEO3kRXhOQ0NLRiVPf1+e7nR+8/4pMrL PrZmsUsc8IaOWKigsW9ZWIPUMIEJpW+7pd6H44Isp519P5A6YsWK5tbA4L8RNO+rrVLv yJiAWYfC1KAS9daJlHwXyU7Uzobe1KyXu0lxagPDvDcvyuBWhvRbxYCPiyxE4rLGGSCA GILFXljbClybiZ6Ln5U2rSl/HXVgJO2Mpq4FabDA5GPRRfc+Yhj921XPGFklP/obqVGT dfQg== 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 n86si839872qkl.82.2017.12.04.07.03.23; Mon, 04 Dec 2017 07:03:24 -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 A7368608E0; Mon, 4 Dec 2017 15:03:23 +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=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED, URIBL_DBL_ABUSE_SPAM 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 0FD186091E; Mon, 4 Dec 2017 15:00:38 +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 32D006066C; Mon, 4 Dec 2017 15:00:18 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id E015560655 for ; Mon, 4 Dec 2017 15:00:15 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 58FCE181130 for ; Mon, 4 Dec 2017 18:00:14 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tPS7hp37UI-0ENa8soj; Mon, 04 Dec 2017 18:00:14 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Hseuacluka-0DEOHXrX; Mon, 04 Dec 2017 18:00:13 +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, 4 Dec 2017 18:00:08 +0300 Message-Id: <1512399608-12981-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> References: <1512399608-12981-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v2 6/6] travis: also use DPDK when doing cross-compile tests 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 Compile and use DPDK when doing cross-compilation tests. This enables us to test that pktio/dpdk.c works on non-x86 targets. 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: 280c62aa5d2ea89ff05e376a74d7c6bbd29f002f **/ .travis.yml | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5c1b6417..dab868129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,7 +98,8 @@ before_install: else sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install g++-"$CROSS_GNU_TYPE" ; fi ; - sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install libc6-dev:"$CROSS_ARCH" libssl-dev:"$CROSS_ARCH" zlib1g-dev:"$CROSS_ARCH" libconfig-dev:"$CROSS_ARCH" libstdc++-4.8-dev:"$CROSS_ARCH"; + sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install libc6-dev:"$CROSS_ARCH" libssl-dev:"$CROSS_ARCH" zlib1g-dev:"$CROSS_ARCH" libconfig-dev:"$CROSS_ARCH" libstdc++-4.8-dev:"$CROSS_ARCH" libpcap0.8-dev:"$CROSS_ARCH" ; + [ "$CROSS_ARCH" = "armhf" ] || sudo -E apt-get -y --no-install-suggests --no-install-recommends --force-yes install libnuma-dev:"$CROSS_ARCH"; export PKG_CONFIG_PATH=/usr/lib/${CROSS_MULTIARCH}/pkgconfig:/usr/${CROSS_MULTIARCH}/lib/pkgconfig ; fi - if [ "${CC#clang}" != "${CC}" ] ; @@ -106,16 +107,24 @@ before_install: if [ -n "$CROSS_ARCH" ] ; then export CC="${CC} --target=$CROSS_GNU_TYPE" ; + if [ "$CROSS_ARCH" = "i386" ] ; + then + DPDK_CFLAGS="-m32" ; + else + DPDK_CROSS="$CROSS_GNU_TYPE-" ; + fi fi ; export CXX="${CC/clang/clang++}"; elif [ "$CROSS_ARCH" = "i386" ] ; then export CC="gcc -m32" ; export CXX="g++ -m32" ; + DPDK_CFLAGS="-m32" ; elif [ -n "$CROSS_ARCH" ] ; then export CC="$CROSS_GNU_TYPE"-gcc ; export CXX="$CROSS_GNU_TYPE"-g++ ; + DPDK_CROSS="$CROSS_GNU_TYPE-" ; fi - if test ! -L /usr/lib/ccache/${CC%% *} ; then sudo ln -s -t /usr/lib/ccache/ `which ${CC%% *}` ; fi - ccache -s @@ -173,21 +182,48 @@ install: if [ "${CACHED_DPDK_VERS}" != "${DPDK_VERS}" ]; then rm -rf dpdk fi - - TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"} - | - if [ -z "$CROSS_ARCH" -a ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then + case "$CROSS_ARCH" in + "arm64") + TARGET="arm64-armv8a-linuxapp-gcc" + ;; + "armhf") + TARGET="arm-armv7a-linuxapp-gcc" + ;; + "i386") + TARGET="i686-native-linuxapp-gcc" + ;; + "") + TARGET="x86_64-native-linuxapp-gcc" + DPDK_MACHINE=snb + ;; + esac + - | + if [ -n "$TARGET" -a ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v${DPDK_VERS} http://dpdk.org/git/dpdk dpdk pushd dpdk git log --oneline --decorate + echo $CC + # AArch64 && ARMv7 fixup + sed -i -e 's/40900/40800/g' lib/librte_eal/common/include/arch/arm/rte_vect.h + sed -i -e 's/!(/!(defined(__arm__) \&\& defined(__clang__) || /g' lib/librte_eal/common/include/arch/arm/rte_byteorder.h + sed -i -e 's/__GNUC__/defined(__arm__) \&\& defined(__clang__) || __GNUC__/' lib/librte_eal/common/include/generic/rte_byteorder.h make config T=${TARGET} O=${TARGET} pushd ${TARGET} sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config cat .config |grep RTE_MACHINE - sed -ri 's,(CONFIG_RTE_MACHINE=).*,\1"snb",' .config + if test -n "${DPDK_MACHINE}" ; then + sed -ri 's,(CONFIG_RTE_MACHINE=).*,\1"'${DPDK_MACHINE}'",' .config + fi + if test -n "$CROSS_ARCH" ; then + sed -ri -e 's,(CONFIG_RTE_EAL_IGB_UIO=).*,\1n,' .config + sed -ri -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1n,' .config + fi popd - make install T=${TARGET} EXTRA_CFLAGS="-fPIC" + make install T=${TARGET} EXTRA_CFLAGS="-fPIC $DPDK_CFLAGS" CROSS="$DPDK_CROSS" rm -r ./doc ./${TARGET}/app ./${TARGET}/build popd + EXTRA_CONF="$EXTRA_CONF --with-dpdk-path=`pwd`/dpdk/${TARGET}" fi # Netmap pktio @@ -201,12 +237,10 @@ install: popd fi sudo insmod ./netmap/LINUX/netmap.ko + EXTRA_CONF="$EXTRA_CONF --with-netmap-path=`pwd`/netmap" fi script: - - if [ -z "$CROSS_ARCH" ] ; then - EXTRA_CONF="--with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap" ; - fi - ./bootstrap - ./configure --prefix=$HOME/odp-install --enable-user-guides