From patchwork Thu Dec 7 14:00:07 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: 120976 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8392034qgn; Thu, 7 Dec 2017 06:01:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMZqi59GAlUJpmz5oPrcVDd/vlE5Yk4aOt9iToyuvNPXKsVX2LStI99XJZcYa86i35IlHPq9 X-Received: by 10.237.56.197 with SMTP id k63mr9373788qte.308.1512655303775; Thu, 07 Dec 2017 06:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655303; cv=none; d=google.com; s=arc-20160816; b=n0ESKAlDbuIt6Lz5dn/d80v3SMo48e2SY1cL40qlJHwQU4x7MQjBoYdcuamdxicH/+ sx0vr2U5IZ3HwRUBzs+fyw71Enx8cAxI7XfnN1FyHLX9ARuWePLyUoOMP3EcyejxAX7C CIRuPGY3HHMWfZh/ngzwYFSlGWnfx50jSeuAPMsZHI1Tj5MII0+jpTUEZyiBd4SBdzdW Ampq4sY/y7tJeX6iCU6Sz3X054WUXlQAKKEcXm6d3qhcWulUDPzmnCY7mU3Etrz5/Fnr QKWOkeIEitRBHyJt2W0TLITa8LSyrU97Llmqwez5h/9nZqAD4roRMEl5tpBMpVXW9pZg hPhw== 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=nzesBCtkiGqjhlkWmkZXGqhKCQdGUOe0ZNPfap2j1RI=; b=aPQa2D+LFbdthC4cifrSKWEUO23mgNdwkJS8nqmVfAc5ROS+k/kKR3aUsZVXTyxXol BN42CfRVXtQDxeB4yoyfIoe0rODb/YM+GLtC28cIc5diMWILSnmBZUKnUIOAE90oGHzh 3cee2BF6Qdaai6BSBFqehdFcQCuH37ftYcLXWgWL6LQsqztRfWLIb8SyyWxrMbNJqAJY IIVKtZZBng7IFMFbLDgoxb/fKnC9vmxJsm4yStaxWn6+wXPOC8xHnm+FmMqW9SG0+d3x 6zh+eBGu4qX43Tq756dzGQyO31fssyxaC/bJjCiEZCWnv4qVRHKmHjGxYLSYxwXpi1j7 CYzg== 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 n86si3461qkl.82.2017.12.07.06.01.42; Thu, 07 Dec 2017 06:01:43 -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 A9CCC609A1; Thu, 7 Dec 2017 14:01:42 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 D219D6091D; Thu, 7 Dec 2017 14:00:36 +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 24E2F60927; Thu, 7 Dec 2017 14:00:23 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id E1DC56064A for ; Thu, 7 Dec 2017 14:00:15 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward106p.mail.yandex.net (Yandex) with ESMTP id E659D2D82A1C for ; Thu, 7 Dec 2017 17:00:13 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DmKMGqVJ7x-0Ds8oDm5; Thu, 07 Dec 2017 17:00:13 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0DhCGvQ9; Thu, 07 Dec 2017 17: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: Thu, 7 Dec 2017 17:00:07 +0300 Message-Id: <1512655212-29682-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ 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 Thu Dec 7 14: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: 120980 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8399031qgn; Thu, 7 Dec 2017 06:06:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMZUp1HDd2xI5YOBjqkE7YXfpfACkGbrmuXC5sjAl337MrfJld39hRYiTkgqnv13G72ePe/Q X-Received: by 10.200.25.47 with SMTP id t44mr9880478qtj.323.1512655583825; Thu, 07 Dec 2017 06:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655583; cv=none; d=google.com; s=arc-20160816; b=RSdefotKOAZUDtdmz8Pg880dsr+rrykTQg0+Nf4E0aV9q34hibb3xfx6ilcemHv010 lvDSL57mC4wU0cMrmKTMCBVWWPUs0njIetvyTT41cNLI0ulDRXhddPrqR+Tt0YMk7i49 j6TdO++qZN+3qyb8uy5wUmRTLcWDjbH7NAodnB6uZO5rUtNnsM3Y34HY5ncbuCyMNm9i izHVPsXZq2dNeImN9tEnL1NaBG4Mpdpz1y55wA/Q0iR5cI4ZYK0pkb7m/+fTsh0wRQdQ n3qxETXHyoPXEEPkOy1SuBBCpi7kLJXebHPgXN6/TnrIe7Gm8cHecJUVHpV9UwBqdn1y S0Lw== 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=R4sYuS4zQp/RUHPXJ6tYwk5lA6AeEpIZlXNkp30FL6o=; b=bH+OY9qMV3HijUM69cigMK2ywySZ0MLEUIaZk2Axg2aHMVElZ2A1hrngf1simVFayS 2qWIIBindZ6+XsUB7h7fX5m525nYxnLYqxcddlUYu9C1o94dcZiiADGBMc+JVR7abcan 6QlRFafTevwT8Xi57ofNibrMPREmlwgl+db9CLe/Ag1m+0hHfjTN/YdpUuPIuLTIIOMM cji4htomm8BsCFIUjRBvJcgR4CCvag+JjpWjhembATjmv1RRzX4hcDo52jYaxpoiez58 UVJDL8pHN558uOvwMH4WsimK2UKfqrLfbs2wX9F80pMwkqTYRI7iLvw57jXCb37SjSd6 kA5Q== 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 p15si3459126qtp.428.2017.12.07.06.06.16; Thu, 07 Dec 2017 06:06:23 -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 7EA9260969; Thu, 7 Dec 2017 14:06:16 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 CFFF960970; Thu, 7 Dec 2017 14:01:00 +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 C4E6C60903; Thu, 7 Dec 2017 14: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 4954160923 for ; Thu, 7 Dec 2017 14:00:20 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 811F46A8295C for ; Thu, 7 Dec 2017 17:00:14 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lSY7CXkgDU-0EDiSAcR; Thu, 07 Dec 2017 17:00:14 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0DhOOCme; Thu, 07 Dec 2017 17: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: Thu, 7 Dec 2017 17:00:08 +0300 Message-Id: <1512655212-29682-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ 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 Thu Dec 7 14:00:09 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: 120978 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8395468qgn; Thu, 7 Dec 2017 06:03:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMb+s//JuTsgcILZ1yoA4XoZWgQjQu7IN0WQ4AWAN8Jr2uUbWzAXX7b2HAxNCdpS28aNQF/B X-Received: by 10.237.60.129 with SMTP id d1mr10587818qtf.288.1512655438158; Thu, 07 Dec 2017 06:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655438; cv=none; d=google.com; s=arc-20160816; b=hgWZ4GI+6eZLWSZh8q+bRARZ2r2PgkP8CX4YyCQJpNFRhMwiTXG8RfigundBw6Jfow yxAGpEizkaHSX7EiosWYBr1/qqlfKqjnciHnMHRy2PdpX4zSanf/b2MvCof6zMMzjfCB ZuJkhsANzcb5seUbi/dr9aUlTeCtAFr7dU6R7W21a5J3dN9AGxz47a+KYPN+gxBT/3yI gS0bEZ+GTWND3lQiqkkkcAAEL9ECxZs+JPZoybMTRQ3rvpd9kRwFix2D7m6J6/LlfvGO g+zqc8+CDoCqIOFdEhDo7jwaupsNKpxKXwkK9O85kUGrn26SvxQCYjSX0FWSmDPnJ8Ns BfeA== 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=hpcEJK8uYPtxMDSwwI8LDdQSWWGRwseQpyGOv4KwmRs=; b=KbSYoBo08NqtPdIOB4gG3H/oH5enlz7MCu2uILwrk1ETYtHztHrxM/0MXhxjOZqMCd xr6gAy9cb1zPLPbry+Ql0WANQxcAZLGYrSYDg7X5P+P2OZufnx1VqWBKUff8Kx+AzD2l 2/DxDJPiMgIuUyjm9wv7ZbohI3F/mhut2/IoT3iWrre3XX15FNI41Qw8Df6J45wQQ2xT neK/42Ri9ZhjzLL1qMlTZ5EEEjP5wmvYn6zFUb+L2VjFoELlnZ1MQt1bbvSyfV6PuosB a8YgYUumJPs5cmN9/V5QPh8GqaHyva/sr/6VVE07sOXgNHLAEl9O4I0YG9zKi0aPJ5IG 6M2A== 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 b101si3816933qkh.448.2017.12.07.06.03.57; Thu, 07 Dec 2017 06:03:58 -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 8F005609BF; Thu, 7 Dec 2017 14:03:57 +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 674C660951; Thu, 7 Dec 2017 14:00:45 +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 5D4E96064A; Thu, 7 Dec 2017 14:00:25 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 658B460903 for ; Thu, 7 Dec 2017 14:00:16 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward106j.mail.yandex.net (Yandex) with ESMTP id F0D551802556 for ; Thu, 7 Dec 2017 17:00:14 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ynSOZQWohG-0EwSFsIj; Thu, 07 Dec 2017 17:00:14 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0EhmSeth; Thu, 07 Dec 2017 17:00:14 +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: Thu, 7 Dec 2017 17:00:09 +0300 Message-Id: <1512655212-29682-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ 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..471bbcd51 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([dpdk], + [AS_HELP_STRING([--enable-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 Thu Dec 7 14:00:10 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: 120979 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8397487qgn; Thu, 7 Dec 2017 06:05:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ3h78+8achPM0m3E5ttp3jLs5wwBXjM/2PlvDPrYIat0eZyUpe2ElMS6g5pP+t7Aqfho06 X-Received: by 10.107.183.67 with SMTP id h64mr38279341iof.46.1512655521003; Thu, 07 Dec 2017 06:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655520; cv=none; d=google.com; s=arc-20160816; b=Az5Y42hH9zAhpe+cQQ2S3wnsda107NDzPzvTZ3jZ507MWq+reo6i9qMNnTLDwlUeph bX82F5ZLIRbUyWilGeVqjAVFi9nv2TZGO2Twp1BqJ+yKoAhInshPwbVzeJyH/raE4leQ p6PmGfc51X0+DYuRgrqNP1mqSA7Vxe5MCxoB9cPLP085FybfchUeqL+f7rlPDJ1nZLnc Ea5Y/dNCwnNNhlIhVMOMUfUvq13lCT4Mbls09wKBbv6I/Uxq9CDjkRDI1FjsB4fFlw/K XU/Tn5Xmzz6nBi+hVCnK1pa+/T/9GM9hLOlLGjMZQsvlDHAH6UfQHDfsfD5EHU2xiJkv Kpyg== 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=rex+osyMc1JfKYGKcPBEVs3aWylRX3Bby1JTU0mOm68=; b=ct9q1CjBiOzsFo2OuAMaGo+JSo2ARDTF5xTqaMzipBznsKCn+bHl2RE96Rkz8q3yzJ /N+ZXo7a/EsrgcysHK0n9jtu0NUYjfSmvX8PPL5KaaUe2fwK3u17ZDq/TbcpdDBZV6ib Gd+STtM1a6oowEdHgnOYroOUYGC20MrzLuZfGAhw0aTbzbA7BEEfetr7lR3gqu37bBTq H6thrs91otBQfcF6qb0j0bs5kRwH0upE64lEz1wxXelXXVZwZNDkI9qwDLBN5ymeQ0Ea 5n0gyfK/vUX2Z6NSAcwLjw/Csoso0dcnUA6fHUbga32zRT7cRlNxV9491raQ9rgp1xSt rYhQ== 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 p72si3895792itc.68.2017.12.07.06.05.20; Thu, 07 Dec 2017 06:05:20 -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 0B9936098C; Thu, 7 Dec 2017 14:05:20 +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 9D0946095E; Thu, 7 Dec 2017 14:00:50 +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 9652F6064A; Thu, 7 Dec 2017 14:00:25 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id EC4546090A for ; Thu, 7 Dec 2017 14:00:16 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 83E081342D7D for ; Thu, 7 Dec 2017 17:00:15 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LVeAFErPjf-0Fuqa7lT; Thu, 07 Dec 2017 17:00:15 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0EhmXMZ3; Thu, 07 Dec 2017 17: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: Thu, 7 Dec 2017 17:00:10 +0300 Message-Id: <1512655212-29682-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ 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..db2a8b0f2 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, 5, 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 Thu Dec 7 14:00:11 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: 120981 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8400453qgn; Thu, 7 Dec 2017 06:07:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMaIip6Q/7ISqRxaO8PJ8sIcxXAFcuMXmtCXyG5puVUL+XOmJhmbkuvbUeMzzynrjcVSkjC3 X-Received: by 10.200.45.150 with SMTP id p22mr9253167qta.130.1512655642111; Thu, 07 Dec 2017 06:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655642; cv=none; d=google.com; s=arc-20160816; b=WL+PHTreqpsjLcG6rDMI6V7bkpno8XpvhEMdQcOz6ua6V9VKT6TC1eQhqJe65SvzpE GeTLdLuVqC9e7WxA2Sq6cMn7sRBnAq/GzEXU8fUe/BfePjFS7yxbdKqJ0nEjmIuqDGam 8LrheZG4OrT41k84nBXAi0COaHbFA5arC3r+BxD07I/uyqXbWbxUfSVTL/DxOZOZqpC/ qErr8ZqrcA3v5BrtWgwI/IgRXuSSpmi2nNCii1XSfV2BIBPh24rAP8xNQSWhmVXoSLtl hs20qmie7L1iRl5ZLWUDJGfQBCCo7Uagk0QxdHIQ5Yd1dL48JInX5OfJAeHI7KBxlBWh 6opA== 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=vNOEhjSoXfVRcZ7lcAQEpQLPRhO6dIR1Xfz4QezWYMA=; b=tOVfzFVSKho3H+2ot0aYUqhN5bhti36v+1emBnr9gNIwDsX7n+QTJ8mUz9KP+tIrHN 7JZsDgoTtqBYL9JHHD1IeUzNUht+t80vcPSyftTrzszcMscN5m7zmmGRqVJtaEOJUrzN aoVBm6cSRatBOySB0u/9skKZmfTOm4b1lWXGr2ns+LcKTiFjF2ZOI7C09SxhlDDQYJ8D aC8PukwuVlVLHff2O/cK7kFkN2Jjcm9Kh1NtEbqWrLLCJr7o4V8cPN9Vm/rq75CGNETL X9ZcGAsIv+swLyR2T9Nv8Rc9/TYad6CL4OmxtXdbsOlgNJFjCtwrBJWjC7I4NijIFKcZ P4eg== 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 q32si2934155qkq.242.2017.12.07.06.07.19; Thu, 07 Dec 2017 06:07:22 -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 E7474609C0; Thu, 7 Dec 2017 14:07:18 +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 20EED6096D; Thu, 7 Dec 2017 14:01:13 +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 D97616064A; Thu, 7 Dec 2017 14:00:28 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 3907260926 for ; Thu, 7 Dec 2017 14:00:22 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward106o.mail.yandex.net (Yandex) with ESMTP id E19077848F1 for ; Thu, 7 Dec 2017 17:00:15 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rKSxW0i85Q-0FcCCMV7; Thu, 07 Dec 2017 17:00:15 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0FhOr2gT; Thu, 07 Dec 2017 17: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: Thu, 7 Dec 2017 17:00:11 +0300 Message-Id: <1512655212-29682-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 MIME-Version: 1.0 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ 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 db2a8b0f2..585ff462a 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 Thu Dec 7 14:00:12 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: 120977 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8393972qgn; Thu, 7 Dec 2017 06:02:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMbpzQ++qWX/Tne5UM55V2JiaCL1Q7uMhBnj2F4y/45RCBmKj/eXvodpaHHpZG7roQRA0+tI X-Received: by 10.200.58.102 with SMTP id w93mr9598531qte.88.1512655376748; Thu, 07 Dec 2017 06:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512655376; cv=none; d=google.com; s=arc-20160816; b=t45AwPdLiq6RhxRyN0yWhxgOsClBJYojY6vT7QDDHHfEFm459viJBvaNFym3ax/2Zu Gyj/BkGMLb7iny52te7tm/OErL2J+WIEB0wMhE0x6pQqjPFJJB8blLbRPf+QEAf3quWR cHROHZZ7Uj+7ghKuGaV9kSkuwP3VgFRxzg6JRaBsg9R5TxRzUD4EoMI+9ycMQGqZLjvV 1uzqo43raQ91nzaEE9pLUFOpJoVQcqD0ISMEHIyOKq0l5ugQ9mpe3VCKEP1bFcKCyRTU St59A+4IAfw/W0u8Eez/LBIwsznuBECR+ahYR6fWhRp8U9JinmenIkRKhc0qzUqK2JUr omBw== 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=Hz1Lxi4DkrGcWDg2LEk19HlVW9yd6PyCDIwpjmLecf8=; b=PYdD48ixd/dhYhPzmOGexAcD2wHh1zKTbBRlRj2/2p2KdSUt5rw9GaixC8kb/GUzMn hLapjL62UYEeCaCf02aNz+uFmKgZBwE2TamS1YjIfkbseTzcv5rjw5CQ6jgYlQ4BV2ud SzKgqfUJAGBfgDu+E096Dj7addc51pS3qRK5ZhKpmiVI5U/+AW5N5Qy0Z4GkRNXOl+xm Nuks+2L4Tgy7zEAm7GsgVaGr0BfMprve/PZCD3dPGsX7Oh/KTBXNmPGRbOEsLZXxBygJ 1LW2gvCZCnqpuvBT8SSVXb0Yv5zyI2Th4ekPsbngpNpeXd566myYnBtnRujxWLwLXzp5 GVxA== 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 a17si3283331qth.153.2017.12.07.06.02.56; Thu, 07 Dec 2017 06:02:56 -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 692F36094C; Thu, 7 Dec 2017 14:02:56 +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,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 2653C60939; Thu, 7 Dec 2017 14:00:43 +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 5081C6064A; Thu, 7 Dec 2017 14:00:24 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 01D8B6091D for ; Thu, 7 Dec 2017 14:00:18 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward104o.mail.yandex.net (Yandex) with ESMTP id 6F8EF700F63 for ; Thu, 7 Dec 2017 17:00:16 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZyoX4OU3t7-0GDmrMXv; Thu, 07 Dec 2017 17:00:16 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N0uwl7gRuJ-0Fh0vDqm; Thu, 07 Dec 2017 17: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: Thu, 7 Dec 2017 17:00:12 +0300 Message-Id: <1512655212-29682-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> References: <1512655212-29682-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v3 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: 811281a22b6274b7f41b926a9cfbe09e48a366bd ** Merge commit sha: 7aed25e962c1322b020ff261d9e5ee0ab3dda1a1 **/ .travis.yml | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 976f07639..871650a56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,7 +99,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}" ] ; @@ -107,16 +108,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 @@ -174,21 +183,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 @@ -202,12 +238,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