From patchwork Thu Sep 10 11:55:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 53379 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id A113B22B19 for ; Thu, 10 Sep 2015 11:55:51 +0000 (UTC) Received: by lagj9 with SMTP id j9sf14526531lag.0 for ; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=VDDu96obA94zlV+E0X8/4mVWJyihiP+T6vN6ct1l9Ho=; b=dYX+wdCGjcja2TLF5yC755nWv4D0xUPAg5PzRKSmRTNlDxx7P9UKhc4a3erupBdJgP mDD7ohJC/1ICAlkTLjtW3jppoo8eJ/joiPzVVop9vF6raALL1slN8MsQGUSrKoLOfASG gCbTYaYOER3y6wDS4jEY8WN2IjXt+6guhFaoqBK0otw1QNb3abdZM93u9OlKndM0s74Y 7kTe0nKqTPeFATpXSFgDdcRGQcaG574YkkcNOwKvERcpEVrJW4mfmcHOv16OjTbUga4o +YcRYEA/Mb35oy+SRgSlAbFni/Vgkk3zECNL3q7rWT8ZETthLvSdrwQTm5SRk4o4P53P DCPA== X-Gm-Message-State: ALoCoQkRpg5kkAA4djscMQ00YRlYd7z5/ab/FH1XUUsXraJcSi+zWnIsd9n49xU26Bzydsy5vQoS X-Received: by 10.112.17.106 with SMTP id n10mr9834240lbd.18.1441886150632; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.100 with SMTP id s4ls182556lag.83.gmail; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) X-Received: by 10.152.37.42 with SMTP id v10mr34655844laj.96.1441886150453; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id e2si10225486lbp.39.2015.09.10.04.55.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 04:55:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbpo4 with SMTP id o4so21657181lbp.2 for ; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) X-Received: by 10.152.9.200 with SMTP id c8mr32587533lab.76.1441886150365; Thu, 10 Sep 2015 04:55:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp924306lbq; Thu, 10 Sep 2015 04:55:49 -0700 (PDT) X-Received: by 10.55.201.220 with SMTP id m89mr52067846qkl.87.1441886149455; Thu, 10 Sep 2015 04:55:49 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m204si12893111qhb.108.2015.09.10.04.55.48; Thu, 10 Sep 2015 04:55:49 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 8807B619F5; Thu, 10 Sep 2015 11:55: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, 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 D6310619A6; Thu, 10 Sep 2015 11:55:44 +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 4B17F619AD; Thu, 10 Sep 2015 11:55:43 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by lists.linaro.org (Postfix) with ESMTPS id 76E1361970 for ; Thu, 10 Sep 2015 11:55:42 +0000 (UTC) Received: by wiclk2 with SMTP id lk2so20100382wic.1 for ; Thu, 10 Sep 2015 04:55:41 -0700 (PDT) X-Received: by 10.180.10.8 with SMTP id e8mr5488729wib.22.1441886141712; Thu, 10 Sep 2015 04:55:41 -0700 (PDT) Received: from e106441.emea.arm.com ([2001:41d0:a:3cb4::abcd]) by smtp.gmail.com with ESMTPSA id l17sm15309249wjr.18.2015.09.10.04.55.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 04:55:41 -0700 (PDT) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Thu, 10 Sep 2015 12:55:16 +0100 Message-Id: <1441886116-31863-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCH] performance: l2fwd: obey -t in queue mode X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The -t command line argument specifies the length of time the application should run before exiting, but this doesn't always work in queue mode as the odp_schedule() call may not return if no packets are received. Signed-off-by: Stuart Haslam --- test/performance/odp_l2fwd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 64fc1b2..75e5cb8 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -131,6 +131,7 @@ static void *pktio_queue_thread(void *arg) odp_packet_t pkt; odp_event_t ev; thread_args_t *thr_args = arg; + uint64_t wait; stats_t *stats = calloc(1, sizeof(stats_t)); *thr_args->stats = stats; @@ -140,10 +141,14 @@ static void *pktio_queue_thread(void *arg) printf("[%02i] QUEUE mode\n", thr); odp_barrier_wait(&barrier); + wait = odp_schedule_wait_time(ODP_TIME_MSEC * 100); + /* Loop packets */ while (!exit_threads) { /* Use schedule to get buf from any input queue */ - ev = odp_schedule(NULL, ODP_SCHED_WAIT); + ev = odp_schedule(NULL, wait); + if (ev == ODP_EVENT_INVALID) + continue; pkt = odp_packet_from_event(ev); /* Drop packets with errors */