From patchwork Mon Aug 4 05:37:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 34763 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2D9C521F5F for ; Mon, 4 Aug 2014 05:38:03 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf24934611yha.11 for ; Sun, 03 Aug 2014 22:38:03 -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=N3BeJUpM+pNyW7tRsw8PYV/vJItrNjFmW/9YlXPHRlw=; b=Y7IlklQFRidB4P+/OeuKE824wGvYSfQwo1bILsnk4aquR8NysedwWyNqJnhiXENmnA WbyzgOFzpy+nbGQbVZaHc2PvJZAF8QRu/aJUAhguP6x7FwKVRGkuTasEA7E7g4HVLX5L T3bflwoTzGJY0oLAkV0m8Ao6SPqX54xZAKif76r+IvGRXzGV7ERZKFjvU5Xy+sg0nzww wJHfPHrdLOx/YdYKT0bESP9Vmz4Oz6tF37o4erWd7jqwshkGEkRinAoFx1Y2+q71d5YJ sVQoIbjGt1Hg4EJC3mu8HAT1l+I3FCjH1OaRqnixfRGvBuajycXqgVgJsnD562d9re9c 1ZcQ== X-Gm-Message-State: ALoCoQlYzIEbHAbm4vPDTeM1/By7yQJnWbw6d5w1gX4iwBntAjc/utpvxup+qqYXtXb06Y9IrknW X-Received: by 10.224.169.20 with SMTP id w20mr6052994qay.4.1407130682939; Sun, 03 Aug 2014 22:38:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.228 with SMTP id j91ls2044174qgf.31.gmail; Sun, 03 Aug 2014 22:38:02 -0700 (PDT) X-Received: by 10.52.36.80 with SMTP id o16mr1265954vdj.58.1407130682879; Sun, 03 Aug 2014 22:38:02 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id id4si11331809vdb.100.2014.08.03.22.38.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so10356654vcb.1 for ; Sun, 03 Aug 2014 22:38:02 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr1459924vcq.50.1407130682758; Sun, 03 Aug 2014 22:38:02 -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 tc5csp278626vcb; Sun, 3 Aug 2014 22:38:02 -0700 (PDT) X-Received: by 10.140.87.244 with SMTP id r107mr30046023qgd.13.1407130682243; Sun, 03 Aug 2014 22:38:02 -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 a5si26900038qag.11.2014.08.03.22.38.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:38:02 -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 1XEAy9-0006h1-GY; Mon, 04 Aug 2014 05:38:01 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEAy3-0006gq-PF for lng-odp@lists.linaro.org; Mon, 04 Aug 2014 05:37:55 +0000 Received: by mail-pa0-f49.google.com with SMTP id hz1so9363694pad.36 for ; Sun, 03 Aug 2014 22:37:50 -0700 (PDT) X-Received: by 10.68.230.194 with SMTP id ta2mr21553706pbc.51.1407130670247; Sun, 03 Aug 2014 22:37:50 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id dd9sm24843697pdb.42.2014.08.03.22.37.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 22:37:49 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Mon, 4 Aug 2014 11:07:19 +0530 Message-Id: <1407130639-3417-2-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407130639-3417-1-git-send-email-santosh.shukla@linaro.org> References: <1407130639-3417-1-git-send-email-santosh.shukla@linaro.org> X-Topics: timers patch Subject: [lng-odp] [ODP/PATCH 2/2] test_api:timer: allow send thd to spwan first 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: santosh.shukla@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.220.170 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 currently rx_thread spawn first and at times leads to tmo search failure for first ping request thats because send thread not yet pushed tmo entry into ticklist. Making send_tx thread spawn first avoid rx_ping tmo failure for initial ping request. also includes one misc fix, this returning from rx ping thread even if current tmo search failed, allow other ping request to process. Signed-off-by: Santosh Shukla --- test/api_test/odp_timer_ping.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index 88650d6..c1cc255 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -94,7 +94,8 @@ static int listen_to_pingack(void) sd = socket(PF_INET, SOCK_RAW, proto->p_proto); if (sd < 0) { ODP_ERR("Listener socket open failed\n"); - return -1; + err = -1; + goto err; } for (i = 0; i < PING_CNT; i++) { @@ -125,8 +126,11 @@ static int listen_to_pingack(void) if (odp_timer_cancel_tmo(test_timer_ping, test_ping_tmo) != 0) { ODP_ERR("cancel_tmo failed ..exiting listner thread\n"); + /* avoid exiting from here even if tmo + * failed for current ping, + * allow subsequent ping_rx request */ err = -1; - goto err; + } /* cruel bad hack used for sender, listner ipc.. * euwww.. FIXME .. @@ -362,9 +366,9 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) void *(*run_thread) (void *); if (i == 0) - run_thread = rx_ping; - else run_thread = send_ping; + else + run_thread = rx_ping; /* Create and launch worker threads */ odp_linux_pthread_create(&thread_tbl[i], 1, i,