From patchwork Wed Jan 24 03:00:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125619 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp140678ljf; Tue, 23 Jan 2018 19:04:50 -0800 (PST) X-Google-Smtp-Source: AH8x22714AJklTs+Nokb1ZcbShRoRLGwGDVrys3cHkIxiL6cI2JzQjhQgV4Vfm1d9XIl739Algbi X-Received: by 10.55.72.204 with SMTP id v195mr6611776qka.295.1516763090033; Tue, 23 Jan 2018 19:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516763090; cv=none; d=google.com; s=arc-20160816; b=qEfRz9Gnq7Z3LbMRc1KjAd4g3oE/6XD4T0kZu0eQj52lnRWxo15g1KBxx6zyXs/OP0 k+jcBpeh5Wpjhozhf1dI/bTbitbV6Y50/E0v+6AgV7AfKQ8BEvQC1xLXjsXwCX51/xpR fjauesmMxhwdhQoukD/u1HuCRoyRC3z8++C+wkhP4KJMLgRhLWCYyIr5CrWRaArIlGSs /hSYe1k5wyQJU0v/03iNfl2g22o9e9dtJTRaEBNN64SJAmcblg1UCH04wsF2okHlfL8W RztEn8VRFM0TjxGzH050n5OxWmKzGi7n/Rnalcwn6fC41PnVPXtxQBiU6N7xNBkfMJ6G zH2Q== 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=lQms0vXMGP9ivrdjEspFE7FrZMLVdMnUY9IjJSqxU+E=; b=0LXjXYFJVpgEk2/x6TZaFkLBXDgtvQc+lnKryilJc2s/bgwL3DCIzSdoFOBPQwJiTW GrwWfe+T3wfgGboDTs6g/ksHfp+XbiYFG9OZmDOIMoiPDs7ey8Y14IFgat32+dHd75gN 0QFt32PLpi4u3j1QndX6CRgd2BQPBFSNY9r1IBnawe0gsIMtQgUxBkDvbj1eo3F5TXH0 AD/3plCeNlOpB944CQvxhDT6MOyb4pW3yUaxPtDdNDIHAw66H7BBgwE9Jpyhr/4wmNNv mbWEUBObq2/01EQNAPuzqdMj4VBimbDu6Yh0r2cRjNRrzmT+nDK1Om5gPTFuWNoXPsPN BblA== 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 o15si687401qko.273.2018.01.23.19.04.49; Tue, 23 Jan 2018 19:04:50 -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 AB6BD619C6; Wed, 24 Jan 2018 03:04:49 +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_H2 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 4024F616F9; Wed, 24 Jan 2018 03:02:02 +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 C1B86617EF; Wed, 24 Jan 2018 03:01:54 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 2E38761702 for ; Wed, 24 Jan 2018 03:00:19 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward105p.mail.yandex.net (Yandex) with ESMTP id D6E6F4081C56 for ; Wed, 24 Jan 2018 06:00:17 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 73u7MtSBLM-0HS4h5vp; Wed, 24 Jan 2018 06:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mUFfJKeeR5-0H3CVp67; Wed, 24 Jan 2018 06:00:17 +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: Wed, 24 Jan 2018 06:00:14 +0300 Message-Id: <1516762814-30313-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516762814-30313-1-git-send-email-odpbot@yandex.ru> References: <1516762814-30313-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 416 Subject: [lng-odp] [PATCH v4 5/5] travis: test ODP with shared 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 Add testcase compiling and running ODP with shared DPDK lib Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 416 (lumag:trav-dpdk-shared) ** https://github.com/Linaro/odp/pull/416 ** Patch: https://github.com/Linaro/odp/pull/416.patch ** Base sha: b122176ee59494dd957f0f5ff41d4b55a1477e13 ** Merge commit sha: b3627670bafa53ad9e0b7833b8864144ce6d7621 **/ .travis.yml | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce1fd27e1..7dd7522da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,7 @@ env: # for individual commit validation. But you you want to track tests history # you need generated new one at https://codecov.io specific for your repo. - CODECOV_TOKEN=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e + - DPDK_VERS="17.08" matrix: - CONF="" - CONF="--disable-abi-compat" @@ -56,6 +57,7 @@ env: - CONF="--enable-schedule-scalable" - CONF="--enable-dpdk-zero-copy" - CONF="--disable-static-applications" + - DPDK_SHARED="y" CONF="--disable-static-applications" - CROSS_ARCH="arm64" - CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" - CROSS_ARCH="powerpc" @@ -159,7 +161,6 @@ install: - gem install asciidoctor # DPDK pktio. Note that cache must be purged if dpdk version changes. - - DPDK_VERS="17.08" - | CACHED_DPDK_VERS=`fgrep Version dpdk/pkg/dpdk.spec | cut -d " " -f 2` if [ "${CACHED_DPDK_VERS}" != "${DPDK_VERS}" ]; then @@ -168,43 +169,53 @@ install: - | case "$CROSS_ARCH" in "arm64") - TARGET="arm64-armv8a-linuxapp-gcc" + DPDK_TARGET="arm64-armv8a-linuxapp-gcc" ;; "armhf") - TARGET="arm-armv7a-linuxapp-gcc" + DPDK_TARGET="arm-armv7a-linuxapp-gcc" ;; "i386") - TARGET="i686-native-linuxapp-gcc" + DPDK_TARGET="i686-native-linuxapp-gcc" ;; "") - TARGET="x86_64-native-linuxapp-gcc" + DPDK_TARGET="x86_64-native-linuxapp-gcc" DPDK_MACHINE=snb ;; esac - | - if [ -n "$TARGET" ] ; then - if [ ! -f "dpdk/${TARGET}/lib/libdpdk.a" ] ; then + if [ -n "$DPDK_TARGET" ] ; then + if [ -n "$DPDK_SHARED" ] ; then + TARGET="$DPDK_TARGET"-shared + LIBDPDKEXT=so + export LD_LIBRARY_PATH="`pwd`/${TARGET}:$LD_LIBRARY_PATH" + echo $LD_LIBRARY_PATH + else + TARGET="$DPDK_TARGET" + LIBDPDKEXT=a + fi + if [ ! -f "dpdk/${TARGET}/lib/libdpdk.$LIBDPDKEXT" ]; 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} + make config T=${DPDK_TARGET} O=${TARGET} pushd ${TARGET} sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config - cat .config |grep RTE_MACHINE if test -n "${DPDK_MACHINE}" ; then sed -ri 's,(CONFIG_RTE_MACHINE=).*,\1"'${DPDK_MACHINE}'",' .config fi + if test -n "${DPDK_SHARED}" ; then + sed -ri 's,(CONFIG_RTE_BUILD_SHARED_LIB=).*,\1y,' .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 $DPDK_CFLAGS" CROSS="$DPDK_CROSS" -j $(nproc) + make build T=${DPDK_TARGET} O=${TARGET} EXTRA_CFLAGS="-fPIC $DPDK_CFLAGS" CROSS="$DPDK_CROSS" -j $(nproc) rm -r ./doc ./${TARGET}/app ./${TARGET}/build popd fi @@ -243,11 +254,17 @@ script: - pushd $HOME - echo "Dynamic link.." - ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux` - - echo "Static link.." - - ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_static `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux --static` -static - if [ -z "$CROSS_ARCH" ] ; then - LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic ; - ./odp_hello_inst_static ; + LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic ; + fi + - | + # it is not possible to do static linking if we only have shared DPDK library. Compiler complains about missing -ldpdk + if [ -z "$TARGET" -o -z "$DPDK_SHARED" ] ; then + echo "Static link.." + ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_static `PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux --static` -static || exit 1 + if [ -z "$CROSS_ARCH" ] ; then + ./odp_hello_inst_static; + fi fi - popd - ccache -s