From patchwork Wed Apr 27 15:00:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 66798 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2239031qge; Wed, 27 Apr 2016 08:00:42 -0700 (PDT) X-Received: by 10.107.15.15 with SMTP id x15mr11344901ioi.139.1461769242317; Wed, 27 Apr 2016 08:00:42 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id rh7si30149889igc.68.2016.04.27.08.00.41; Wed, 27 Apr 2016 08:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 101EA61103; Wed, 27 Apr 2016 15:00:41 +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, 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 A5D13610BC; Wed, 27 Apr 2016 15:00:35 +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 16FFA610FF; Wed, 27 Apr 2016 15:00:33 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by lists.linaro.org (Postfix) with ESMTPS id E98A4610AA for ; Wed, 27 Apr 2016 15:00:30 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id c126so60047400lfb.2 for ; Wed, 27 Apr 2016 08:00:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kS86S6+6ooz7D0L3S5w+LlVBrtzPaL1czfkgbogB/hY=; b=TawX4rlhGQhXM/sgy00C61fEmIpmOHf9BxMNx6Q3G+NR/udOLvICMGiB0GvM3TRjmk qEjKL1nCefi0hToT4lbqs62CPHmUQpMfoW6Sla9WQZRIXRdMDJ8ilgpP2OHFS/ddrDmS ZN+EAa5wF75x/q3RtW/9sCwOjPECL2s0z4iJpkVwKJr8Yz9RVl1LHiCXIoQEeHzvUmHj eQaGWjeJDdQiUeu5X1l0nLYE1m9w9+RTYOpBTR1tGfYPqxniTvUP87m7I/Vm9tgKeJyS aPeIH1GSVsuYd4WKpuOIaI/hpGJBwcpgjbFNq8DLekWuNmWSsscQ9qcZ7lpKv5Umabi2 jexw== X-Gm-Message-State: AOPr4FXRnoTzz1RZ0pevXjOIT7viaR+aTU0e4yNzG7tYbsrBzHH6txrgP7AfMaY0hbhui7pUdZ4= X-Received: by 10.25.20.155 with SMTP id 27mr3129073lfu.90.1461769229539; Wed, 27 Apr 2016 08:00:29 -0700 (PDT) Received: from localhost.localdomain (ppp91-77-173-31.pppoe.mtu-net.ru. [91.77.173.31]) by smtp.gmail.com with ESMTPSA id 74sm841513lfz.14.2016.04.27.08.00.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Apr 2016 08:00:28 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 27 Apr 2016 18:00:12 +0300 Message-Id: <1461769212-19222-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: patch Subject: [lng-odp] [PATCHv2] add dpdk pktio testing 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Maxim Uvarov --- v2: rename option to ENABLE_DPDK_PKTIO and fail if hugepages already mounted. apply-and-build.sh | 2 ++ helper/platform/generic | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/apply-and-build.sh b/apply-and-build.sh index 3fc9f2b..c3c7973 100755 --- a/apply-and-build.sh +++ b/apply-and-build.sh @@ -8,6 +8,7 @@ source ${ROOT_DIR}/helper/toolchain source ${ROOT_DIR}/helper/openssl source ${ROOT_DIR}/helper/cunit +export PLATFORM=${PLATFORM:-linux-generic} export GIT_BRANCH="${GIT_BRANCH:-master}" export PATCH_DIR=${PATCH_DIR:-"$HOME/incoming"} export CLEANUP="${CLEANUP:-1}" @@ -15,6 +16,7 @@ export CHECKPATCH="${CHECKPATCH:-1}" export CHECKFORMAT="${CHECKFORMAT:-1}" export DRYRUN="${DRYRUN:-0}" export ENABLE_NETMAP_PKTIO="${ENABLE_NETMAP_PKTIO:-0}" +export ENABLE_DPDK_PKTIO="${ENABLE_DPDK_PKTIO:-0}" export ENABLE_DPDK="${ENABLE_DPDK:-0}" export NUM_CPUS=${NUM_CPUS:-"$(getconf _NPROCESSORS_ONLN)"} export FILE_EXT=${FILE_EXT:-"mbox patch"} diff --git a/helper/platform/generic b/helper/platform/generic index 9a3d399..8e96a6c 100644 --- a/helper/platform/generic +++ b/helper/platform/generic @@ -1,6 +1,14 @@ [ -n "$GENERIC_PLATFORM_HELPER" ] && return || readonly GENERIC_PLATFORM_HELPER=1 export NETMAP_SRCDIR=${ROOT_DIR}/netmap +if [[ ${ENABLE_DPDK_PKTIO} -eq 1 ]]; then + fgrep hugetlb /proc/mounts + if [ $? -ne 0 ]; then + echo "Unable to test ENABLE_DPDK_PKTIO due to already mounted hugetlbfs" + exit 1 + fi + source ${ROOT_DIR}/helper/platform/dpdk +fi generic_usage() { echo -e "\tENABLE_NETMAP_PKTIO:\t enable build with netmap, default: ${ENABLE_NETMAP_PKTIO}" @@ -14,6 +22,11 @@ generic_prepare() { export NETMAP_DIR=${NETMAP_SRCDIR} export CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-netmap-path=${NETMAP_DIR}" fi + + if [[ ${ENABLE_DPDK_PKTIO} -eq 1 ]]; then + export CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-dpdk-path=${ROOT_DIR_DPDK}/x86_64-native-linuxapp-gcc" + echo 1000 > /proc/sys/vm/nr_hugepages + fi } generic_get() { @@ -26,14 +39,23 @@ generic_get() { git reset --hard $NETMAP_REV popd > /dev/null fi + + if [[ ${ENABLE_DPDK_PKTIO} -eq 1 ]]; then + dpdk_get + fi } generic_build() { - : + if [[ ${ENABLE_DPDK_PKTIO} -eq 1 ]]; then + dpdk_build + fi } generic_cleanup() { rm -rf ${NETMAP_SRCDIR} + if [[ ${ENABLE_DPDK_PKTIO} -eq 1 ]]; then + dpdk_cleanup + fi } ## vim: set ft=sh sw=4 sts=4 et foldmethod=syntax : ##