From patchwork Fri Dec 8 10:00:13 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: 121138 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp453209qgn; Fri, 8 Dec 2017 02:01:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMa7cjZa1Fv5Okr0Q6yPeWKwhJYqCflkf4KR4iQwBSn08zIlLpzMoUtpmJyDOc25V52sgA7j X-Received: by 10.55.16.80 with SMTP id a77mr34565861qkh.250.1512727308490; Fri, 08 Dec 2017 02:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727308; cv=none; d=google.com; s=arc-20160816; b=nq4uwCvgOyTwpbjJTxQEo4sYEGX1LqrcXXYuHSVIlXu+E1jcowGex7MswFECc8EcWS YR208kcAuJm7T65OkBQPcrdxX2CzBpMLYmy6ght1w18Ck8lKC8S0F0EYzJ6IqxdWCOuj lHHtVRzwiGr6cIRAXzrJ330p7CLDAW8XStcGdLV8h+oXgVaCxvRLIdPq6jmTD2bUiVpr cO52fRFroIXNZrbge0pHhyXTtAZi11AAD+/ynfkNfpcryMxW5TkSYwoyM01zxCOM56Sv BaTETboGwPNzaHbsPoyKEPSX8pYMXn/S+rlvXi8r/A0FcEfEwkY1RVr0FQccz8zJOdMt jcFA== 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=unn1iQTwsL5/3BIRK9heT6YzjjFOGZnl5N3N1bR0GyY=; b=So3DAhplZeqLPy1rJqN4qlzMeOo4o+lWutS3YgsqQwe/MIXf0obop+BWFM49aJDzCK ZmThFRSFWLZEcdcNGN1fV6kDBCySf79kODnfv1AmCwJdu5qbXmIPma+MJQeO8S7Umq8k PrgwYp2I6DFnklx0SMrXn7l6IWXTRBFMi5HevDZzJu3XCihpDBvMuodOd7zbjJU86e3f Upy7+XlW4u5OD8nwIOIX+qL+47RS/I7v/YWgHpQnM7KxT97gMj1gCO8snAIa9qCH1PRo jo9rULf+F/PKSOhyoCtvQxLiQYg17fZB8At8a5tlxxkrP5CFrkcFKPHW/L0I6UO5XN7w xN6w== 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 m55si2912235qtm.74.2017.12.08.02.01.48; Fri, 08 Dec 2017 02:01:48 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2542D609E1; Fri, 8 Dec 2017 10:01:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 3EA5060948; Fri, 8 Dec 2017 10:00:56 +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 933A060509; Fri, 8 Dec 2017 10:00:50 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 4C09960948 for ; Fri, 8 Dec 2017 10:00:22 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward104o.mail.yandex.net (Yandex) with ESMTP id A95CE703672 for ; Fri, 8 Dec 2017 13:00:20 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UAkUQm52Wl-0KgGjekD; Fri, 08 Dec 2017 13:00:20 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0KdGxYo4; Fri, 08 Dec 2017 13:00:20 +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: Fri, 8 Dec 2017 13:00:13 +0300 Message-Id: <1512727218-7712-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ 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 Fri Dec 8 10:00:14 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: 121139 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp454176qgn; Fri, 8 Dec 2017 02:02:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMYzj9uQLYAicGPtbA9kvv0N9NCvoS2RscwrI77nXo50/Kpp1QYDiuUEBBA/IL7IqeFU4W/8 X-Received: by 10.200.50.176 with SMTP id z45mr14296320qta.167.1512727354061; Fri, 08 Dec 2017 02:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727354; cv=none; d=google.com; s=arc-20160816; b=YDvk4XhRTymjfppgMvIrEy5/EDaB4709CZhsMrG8TisyprPXK+ZPP4rkGih5dbZBA7 auUTadGyXyuvI6pHPygeOncV9w/1RHkMflMexRbwaQ5+TEXRthmDk5q8cuq2C77M3T4M ncBj9QZMdFsQXQ4IQNThlaVNlJYxnIyExWEHgHpoe7nQ0FbKryXWApIn13KilKJvoElg 6oRijkef7VnwWc5lfwutDiBQu3IMLBHvLS/t9sCz4R822VzWN41eYhsFuxz/psPMSPGr NStnKO2v1F9QaKFoXo7jBrYu51p8Darjp7KQNOhnL1+soT3AVv8J2F4Os+1eaT/hgMDN GIOg== 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=YsHxD9zBeHn+bqUIsPBwXynROVMmfJoEDKlRhqN1OTo=; b=D6qjpfCFkc8oIoZIXAjzjHFPzNMny36v5s9irpPGwdssb+pFAkYp98pBr3YXzvECp6 Zn5or/HhCWQC8mTD0QaUaVPtS4cUFKrEz63zk6kMx6uxLm/eUvU2rg15hN7aTvqGO1Oo 3qeyx4Qy2q702Z+Ctzjy6dvg1EoNVyifDnaYkKmQbRp3zLu9+GRslV2R5LtZWm6pGh4r gdQYaE0mN3uEnJiylGrCuFhVIDYdI47xto9g0HPzSPQAs5NGxhAvJheXjwVIGekgLhEt zCrynhFDkTYUwOxZD+kuVVZ0zax4bnjyE1a6CVn6JXe6Bu4iOdAGJCeDci/UPGGR2hgU ADWA== 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 c124si1025786qkd.318.2017.12.08.02.02.33; Fri, 08 Dec 2017 02:02:34 -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 AD6F7609E3; Fri, 8 Dec 2017 10:02:33 +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 8FC926095B; Fri, 8 Dec 2017 10:01:01 +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 E279760953; Fri, 8 Dec 2017 10:00:52 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 9F8FA60959 for ; Fri, 8 Dec 2017 10:00:22 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 270DD183BD4 for ; Fri, 8 Dec 2017 13:00:21 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bbeNKihTmn-0Lt05Pds; Fri, 08 Dec 2017 13:00:21 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0Kd4AqcN; Fri, 08 Dec 2017 13:00:20 +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: Fri, 8 Dec 2017 13:00:14 +0300 Message-Id: <1512727218-7712-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ 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 Fri Dec 8 10:00:15 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: 121143 Delivered-To: patch@linaro.org Received: by 10.80.152.193 with SMTP id j59csp378177edb; Fri, 8 Dec 2017 02:06:55 -0800 (PST) X-Google-Smtp-Source: AGs4zMa6Fe9OhbXaQ4OvTnLaC1+4VvCH29MVUdRkHQGpZ5FIivu2KRRhx1OFEssBFPwuhR3NnS3c X-Received: by 10.55.100.141 with SMTP id y135mr32468360qkb.242.1512727478840; Fri, 08 Dec 2017 02:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727478; cv=none; d=google.com; s=arc-20160816; b=CnO9GqG2f5b45oSWBO3WvGmoIS/TjZRHNJacQRKFNP8cJLqaIOZrS94tzID+jgcU1U IDU49v0c/BETZ76ji8aZnESYEi7iaDmMIWyICEkLi8zWOx/ANff4qMn5snIAvLjCbsHE BZXr4MDCbgfABJayVxQ7+9JWDER1tVHwTeQcCRcHOtVtj/X9pl/pGg3OB18F3cQS2Ihe mBXzXXzhf6emQxnwEw+mvewIUq9SZ7hCM+UsMXAu7bgr98W7aRMH/avF6DsQLm1HzwAN 840HgQmNPyPDVNy5RIgL2WC4S1y+g93K4zczLd/XCEqpQjlt0LygPY7SwjB9r13pZB2c QcfQ== 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=0+AEMkXqtYUcBs3TfPHrOv783dk8nvpmzpdBrysrToI=; b=Ed+mLDIg6q5TdiI1mulLCOunOcDkeGIoN6VIZ71yvHZEY20/61q1ufpW4lQSb88idb +wghJM2OCHxQfStuiMJ0BvPxE2Kc3HWBybXmFM1p2I0R8uiOCu2lmPlaG81ePVefj7ZL FvASxx0b8Judxe6S8zQsIXXp6+8xCvC5UEmQZw5CEX/njqHdse8cym3w1EJlJnVMQeY7 sJAYxFtkR8+Ebr9sWbI7uYaSSbiwxa7h+PTy1rwVUL2tBtZw6l66h3zJbE6EQeK+z8PY yUxNrvYInNIKI1kL35OAYbjuGXA+9OCkNcSKeN1WAyAAXE2Pe1ncuQpKuv4E5fOJr28G tvLw== 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 z127si5989qkd.476.2017.12.08.02.04.38; Fri, 08 Dec 2017 02:04:38 -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 3169B609F2; Fri, 8 Dec 2017 10:04:38 +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 78C8960977; Fri, 8 Dec 2017 10:01: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 BDE3F609E1; Fri, 8 Dec 2017 10:01:37 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 6FD136097C for ; Fri, 8 Dec 2017 10:00:23 +0000 (UTC) Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 95956510236B for ; Fri, 8 Dec 2017 13:00:21 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YaCGqlf5bQ-0L7OuQkJ; Fri, 08 Dec 2017 13:00:21 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0LdGKfpF; Fri, 08 Dec 2017 13:00:21 +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: Fri, 8 Dec 2017 13:00:15 +0300 Message-Id: <1512727218-7712-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ 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 Fri Dec 8 10:00:16 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: 121140 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp456214qgn; Fri, 8 Dec 2017 02:04:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMb9heaXrcOlvG1Rs9hpjoG7dYu2ZTqBgP2l+R+bxKb5J9wl5EbjfdUqQ7Y1H04Ys6LHyarL X-Received: by 10.200.23.18 with SMTP id w18mr13313653qtj.47.1512727469958; Fri, 08 Dec 2017 02:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727469; cv=none; d=google.com; s=arc-20160816; b=SYW+bQsE0OJn4UC2LDtqqCjCCFx3U6Awzd+LnExuELvD8aPBswAsiSvPsIyyv/R9eH /y4oWn55SXPlESn7cXwd1yLoNM+7UcVBFMvop1mWbl3MWvi3Wce8aXY8YcGdyjJ99Pmt xKAJEhCRg3mLBjpIQ25kGEEk0xkmJfcaorGfZLXlnnXOQiKThz0F+jWq0MBR5Qzsq2rF +Kv7ubsWXn5dGDEgLXaeVuTwFVPtSZnbhSi0dqBFcZMl0kWsLNdWfy3E9n0kElw0cbbJ VhEB9QAaZlNcRDAqdSd+HpBaHXZUDA86AAdNKSy+UybtowbgQZVcynECZnil4rs0X34h WctQ== 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=aS/RZUy2JRyUKgL8rNlpB32Q4uPEXJQ5R+CUfi3r7pc=; b=EN7Ns+KMbnWpXQ8Agjz3okEpuxZuRSKjR0VeD+RRKxYxKt1V0c2pyXRdb6KcUVUnKQ fGp0JMN+kX3emJakE6ZN3l2R3ARuQC3VwFYkm47qVd/hzkdisp5QxS/sGYmR3bWQN+aj UG8W6bqCxr/IIteajCGpo3pTu0fiS3Atki+8P5KJa5lTWbYpVKgZ3frt1uFaJJYyTllI HxI3glwdNDoZGUi2gwxslxowumTvMzwdvSBr1nn12LlQ5KprleFCGnWq3sLhlRKA82dW 50YPc0i5JnK7PScXU5eGQyrX9sPo+tpO2Lem5t/JtPklke5F5hNOChy6j8JF8iRycjkx w7kA== 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 d21si5487701qkg.484.2017.12.08.02.04.29; Fri, 08 Dec 2017 02:04:29 -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 A0551609F2; Fri, 8 Dec 2017 10:04:29 +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 3D1B6609DA; Fri, 8 Dec 2017 10:01: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 7D962609D8; Fri, 8 Dec 2017 10:01:33 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 32D3A6098B for ; Fri, 8 Dec 2017 10:00:24 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 35B2F4303805 for ; Fri, 8 Dec 2017 13:00:22 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YmZQzkn2Sv-0MrWXQOb; Fri, 08 Dec 2017 13:00:22 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0LdSNq12; Fri, 08 Dec 2017 13:00:21 +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: Fri, 8 Dec 2017 13:00:16 +0300 Message-Id: <1512727218-7712-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ 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 Fri Dec 8 10:00:17 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: 121141 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp456883qgn; Fri, 8 Dec 2017 02:05:12 -0800 (PST) X-Google-Smtp-Source: ACJfBosxsBq7NnGa8z61pvx1lNY+XHmZmGiI4aJHwlASsSFA5vH8foD4dfjCscNT6JdyTEpBSoXN X-Received: by 10.237.57.233 with SMTP id m96mr3323923qte.192.1512727512123; Fri, 08 Dec 2017 02:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727512; cv=none; d=google.com; s=arc-20160816; b=JIa/yDiBhFlb4tMG+yJTAMQ9hgnTvPl8j9CzL73d7MW21tq8+NF2dnE7m3IwOee8Pf wonJWoVtSbpFtSx3+du3c0A4KtkVBDfXimo0VaS0Rs+MtzKFLrrSWvIc4l6wdwu1yZvZ I9LY7lW54am0ZXCGc/dwxXEuaqH8ZTsS/j44SFhbvdkxJmBfApX25HFp4tEA/BQFKt7C ayIAE1q7qEwLTXQ5Bc8ntngb1zxtAQ61Ch7v1vc28HJ7fdO2YbueZM/FpS3Bl6CPu/KJ S5VRhQk5bLvlTGNwqe7vcP6Whlzo77kw56+AnOn8zPxjHbXnHMxONCmM2OeBejUJ7i3Q i0Sw== 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=9iginKoyw1y+YhI0XKInE2OWAJbBcLg1Zh0ExEWHgVg=; b=Ojo6r0vDQ8Lrq8BwBioG9VVUainqt4uUFyqmvNjpe/Hp0wAT1TSWUpxaSzBxnhLmPx pl33LwLqHwKJPke3POEooI1m9WxKDz/uzN4Tf+mg3EtZaZDV0Xykcl0W/HLHfmT/7tnf cMibnI8uYegDhCbHwWtgjRFv+95K4HkcjfCYodrmgt7vCa/Velgpjy1JaMU/jJszB65m dP8cf0ZQ8Bw58IWzeplhaWHWacMaX5kyX1nmTdoEAL3NAQWvNoRHLTxGGmYuh/fcCpMG rwQaWz61wYsDj9zxDhxkb+6jPvOUZmgwe9Ny2ejNWzYWRkuOUtUEBbzxJGyaHsUWmZ4m yMeQ== 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 u7si5539257qki.461.2017.12.08.02.05.11; Fri, 08 Dec 2017 02:05:12 -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 B019D60A01; Fri, 8 Dec 2017 10:05:11 +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 CDBBD6099C; Fri, 8 Dec 2017 10:01:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8D7656099E; Fri, 8 Dec 2017 10:01:39 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 4BDE26094A for ; Fri, 8 Dec 2017 10:00:27 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward105o.mail.yandex.net (Yandex) with ESMTP id AC91444439E6 for ; Fri, 8 Dec 2017 13:00:22 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id o6ydriy42y-0Mle4nbq; Fri, 08 Dec 2017 13:00:22 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0MdqpBPm; Fri, 08 Dec 2017 13:00:22 +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: Fri, 8 Dec 2017 13:00:17 +0300 Message-Id: <1512727218-7712-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 MIME-Version: 1.0 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ 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 Fri Dec 8 10:00:18 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: 121142 Delivered-To: patch@linaro.org Received: by 10.80.152.193 with SMTP id j59csp377704edb; Fri, 8 Dec 2017 02:06:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMZR8MdgXdVIc8/dEAE136MM0oEVLoxTa2hM0btqs2NU3iqTuQzcoXoneEzLTc2vbvFz/Fz6 X-Received: by 10.200.26.171 with SMTP id x40mr13339365qtj.43.1512727585986; Fri, 08 Dec 2017 02:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512727585; cv=none; d=google.com; s=arc-20160816; b=haCmQIgkA064QNsvfCJjzFdvrx+6JT0Ad62bM/9YR4dZR+e51yJiqQOdGydgAWokoZ lv3HM1zQJpWYTnDadkESkWjeirxGZEmd/63YTSHEq4N1B7l2cCfr86WXHbDPKuo6gsZ9 8i+OupwLxUooFvyi3LmEi9m5iFWKA/zQsqr38fxHaSwGABWg8ZS8YoJ+sY2NkJ+uuhQr GtN0RsRkJA6WizpMblgDdoWHy/AsGUhAvu+C6y04BvdOkOAkGYlnLqIKlYmFVUoSDc/N QWDfjyouecLndwnjROsQsJJ2yKTCRQom+kB5Ikl2gz6MhMu9/qd/kPovqiLBt3++bXMe tZ8A== 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=DMtNADo0uMvgXL6jklhQfCs6IS1I1uUs26t2p1TRDQU=; b=LDGVf+2fzErM/KV1FDdZp64XPZJJaUeZKWwongXbtF1NB8kKSfsZ1/oqRBqYA1kX1d MLTDPhxSS42hMUCGjAJPiCBIChlXTAxmDAU8zzHDkK/Jg2X5bDeLOhi9X+w1hO/FEBOH PQUw/tA8uPVHqwPThFiOWcpyrEUgxVTDct5wrfoYZMO2uiz3C0QyDL2xY9JVuWxnozyE 0RqA2Tf91RMCFopFjDX2/Si0IqHKArMyLNkWdFiXRCq/sIxaivMyK7NzJ047TPY1lJiE B4q9sPcetEhZbUDKSEzpQ9hs4qx+8FW4ihY760vOY1ZEt8CxSxeWEai93ZtCTenTCXTI oKgA== 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 v37si2600901qtj.8.2017.12.08.02.06.25; Fri, 08 Dec 2017 02:06: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 A54AD609BE; Fri, 8 Dec 2017 10:06:25 +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 0F8EA609D0; Fri, 8 Dec 2017 10:01: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 C997B60977; Fri, 8 Dec 2017 10:01:41 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 67C136098C for ; Fri, 8 Dec 2017 10:00:24 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 546AB13440C3 for ; Fri, 8 Dec 2017 13:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xVwM4Rq2J4-0NjumOef; Fri, 08 Dec 2017 13:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p6iuZvqqGi-0MdqRF4I; Fri, 08 Dec 2017 13:00:22 +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: Fri, 8 Dec 2017 13:00:18 +0300 Message-Id: <1512727218-7712-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> References: <1512727218-7712-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 321 Subject: [lng-odp] [PATCH v4 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: c15a810b7a47f2e07200f83aa534163ca06e2b16 ** Merge commit sha: 540836da19aed3d8c900429f089415c51b77529f **/ .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