From patchwork Tue Jun 24 14:05:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 32426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2E241201EF for ; Tue, 24 Jun 2014 14:01:40 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id n15sf502121wiw.6 for ; Tue, 24 Jun 2014 07:01:34 -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:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=kvz3URTolwQTv8AVDQYBl9g7ZumeB7E03DadLM3l+S8=; b=ksaQxBNw6V1i6XqEVPjiOduns5wde5CAIonVqppJKn1zePbzpVPg+5IaDD10Ltce/H ELhIVRfen4wGZGRf3G8O/wDAa2uK5+7Q6z/Z080zw9nSIHbkksIG3nNRFGk7H3mYOxBh g/rHwN8epNLwEg/d8Ttt+PML54q0/y2OwF52NrnzQsjxLPqdhLSTHaFsY0VNNCC0RBtI 0Hw+onxIhrRf/NmXncCaA/2TnsHqOp2C+0lJu9KCkFJyATytkZEMMOa/tYsSV4S3kQVe vn2cPhirpCUWzMaLUoXKIUKuwsyVjoovuSdqB0YXSlewTnMvx/hoDqJUQNXAr4Z5tce6 soqA== X-Gm-Message-State: ALoCoQnJ8OrlUnRLBuTL6rnfs5vHwbSp74IV5Yd3ySXdr0uQako413kTDHXxtKW/SUNzx4/tRvX1 X-Received: by 10.194.3.34 with SMTP id 2mr175727wjz.4.1403618494758; Tue, 24 Jun 2014 07:01:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.35 with SMTP id d32ls2434743qga.87.gmail; Tue, 24 Jun 2014 07:01:34 -0700 (PDT) X-Received: by 10.58.82.106 with SMTP id h10mr600648vey.60.1403618494657; Tue, 24 Jun 2014 07:01:34 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id g10si244325vdt.41.2014.06.24.07.01.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Jun 2014 07:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id db11so360020veb.4 for ; Tue, 24 Jun 2014 07:01:34 -0700 (PDT) X-Received: by 10.58.219.194 with SMTP id pq2mr581363vec.71.1403618494567; Tue, 24 Jun 2014 07:01:34 -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.221.37.5 with SMTP id tc5csp213161vcb; Tue, 24 Jun 2014 07:01:34 -0700 (PDT) X-Received: by 10.224.156.132 with SMTP id x4mr1753367qaw.101.1403618493961; Tue, 24 Jun 2014 07:01:33 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id a7si457231qat.99.2014.06.24.07.01.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Jun 2014 07:01:33 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WzRG8-0007cc-2j; Tue, 24 Jun 2014 13:59:40 +0000 Received: from mail-qg0-f49.google.com ([209.85.192.49]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WzRG2-0007cO-5j for lng-odp@lists.linaro.org; Tue, 24 Jun 2014 13:59:34 +0000 Received: by mail-qg0-f49.google.com with SMTP id f51so284768qge.22 for ; Tue, 24 Jun 2014 07:01:22 -0700 (PDT) X-Received: by 10.140.38.112 with SMTP id s103mr1961366qgs.40.1403618482108; Tue, 24 Jun 2014 07:01:22 -0700 (PDT) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id u7sm583726qat.2.2014.06.24.07.01.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Jun 2014 07:01:21 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 24 Jun 2014 17:05:47 +0300 Message-Id: <1403618747-28212-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403618747-28212-1-git-send-email-petri.savolainen@linaro.org> References: <1403618747-28212-1-git-send-email-petri.savolainen@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH 2/2] Timer test uses timeout buffer X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@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.128.173 as permitted sender) smtp.mail=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 Timer test modified to use the timeout buffer type. Signed-off-by: Petri Savolainen --- test/timer/odp_timer_test.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/test/timer/odp_timer_test.c b/test/timer/odp_timer_test.c index 341265d..b4ef988 100644 --- a/test/timer/odp_timer_test.c +++ b/test/timer/odp_timer_test.c @@ -26,15 +26,6 @@ #define MAX_WORKERS 32 /**< Max worker threads */ #define MSG_POOL_SIZE (4*1024*1024) /**< Message pool size */ -/** Dummy message */ -typedef struct { - int msg_id; /**< Message ID */ - int seq; /**< Sequence number */ -} test_message_t; - -#define MSG_HELLO 1 /**< Hello */ -#define MSG_ACK 2 /**< Ack */ - /** Test arguments */ typedef struct { int core_count; /**< Core count*/ @@ -70,10 +61,12 @@ static void test_timeouts(int thr) ODP_DBG(" [%i] current tick %"PRIu64"\n", thr, tick); while (1) { + odp_timeout_t tmo; + buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); - /* TODO: read tick from tmo metadata */ - tick = odp_timer_current_tick(test_timer); + tmo = odp_timeout_from_buffer(buf); + tick = odp_timeout_tick(tmo); ODP_DBG(" [%i] timeout, tick %"PRIu64"\n", thr, tick); @@ -270,8 +263,9 @@ int main(int argc, char *argv[]) MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE); pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, - sizeof(test_message_t), - ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW); + 0, + ODP_CACHE_LINE_SIZE, + ODP_BUFFER_TYPE_TIMEOUT); if (pool == ODP_BUFFER_POOL_INVALID) { ODP_ERR("Pool create failed.\n");