From patchwork Wed Mar 18 15:40:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9334D2153B for ; Wed, 18 Mar 2015 15:40:51 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf8069576lbi.2 for ; Wed, 18 Mar 2015 08:40: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:from:to:date:message-id:in-reply-to :references:cc: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=1hWo+q6SqEMmxOhLyAFxqQqiTUxRlAFDpR1XsIGZ5Ug=; b=OvD+DyOaB5I1cAEBYIw6sUNnfgS/DpsihAXTBY8JVjS4OO8f2dbzHtAhdoXUIkzQG9 QiNYRV2nCkIWgw/y+gDw8dAJX4Y1rs8KYdjzUdsJ6UVah63SAHcPNkBxaY0Ujo7aFQb3 mwkP3LGRilT+l9ZucQFMLw8yOz4Poe7JOwG7N/9dTbfUH8FreJZmSPvJv2L3TK9Nqbmv ZF69vvEDC9fs65vssX7j3577bk6WappOvb50oCDKCq3ZKPnw/bCeDJXohtfz4UXkJ5dU n6utGsB6vy4EVFA5owAZJPM/4nriA8N09SIh68WGKMZRyu5a+IDTCBs1Bb48hZYGpRC7 nLeQ== X-Gm-Message-State: ALoCoQkqD1U6Q2aFd399RjnKapgMvyEMHM+JR1N5PDwMbQqMOXBnsBpw/L8wToO8JraNVfE2tbeF X-Received: by 10.112.125.67 with SMTP id mo3mr9435985lbb.6.1426693250377; Wed, 18 Mar 2015 08:40:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.67 with SMTP id o3ls149010laj.67.gmail; Wed, 18 Mar 2015 08:40:50 -0700 (PDT) X-Received: by 10.112.26.134 with SMTP id l6mr56508042lbg.23.1426693250084; Wed, 18 Mar 2015 08:40:50 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id l8si9556287lbm.58.2015.03.18.08.40.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 08:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by ladw1 with SMTP id w1so39394826lad.0 for ; Wed, 18 Mar 2015 08:40:50 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr64004678lal.73.1426693249991; Wed, 18 Mar 2015 08:40:49 -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.35.133 with SMTP id h5csp1235956lbj; Wed, 18 Mar 2015 08:40:49 -0700 (PDT) X-Received: by 10.55.31.101 with SMTP id f98mr102761879qkf.34.1426693247228; Wed, 18 Mar 2015 08:40:47 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id z3si16990692qcp.5.2015.03.18.08.40.45 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Mar 2015 08:40:47 -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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYG5L-00051i-Rw; Wed, 18 Mar 2015 15:40:43 +0000 Received: from mail-lb0-f173.google.com ([209.85.217.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YYG5C-00051H-Ck for lng-odp@lists.linaro.org; Wed, 18 Mar 2015 15:40:34 +0000 Received: by lbbsy1 with SMTP id sy1so32653675lbb.1 for ; Wed, 18 Mar 2015 08:40:28 -0700 (PDT) X-Received: by 10.112.114.164 with SMTP id jh4mr65117107lbb.21.1426693228601; Wed, 18 Mar 2015 08:40:28 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id pd1sm2671263lbc.9.2015.03.18.08.40.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 08:40:27 -0700 (PDT) From: Taras Kondratiuk To: mike.holmes@linaro.org, robking@cisco.com Date: Wed, 18 Mar 2015 17:40:20 +0200 Message-Id: <1426693221-31018-2-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426693221-31018-1-git-send-email-taras.kondratiuk@linaro.org> References: <1426693221-31018-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 1/2] validation: crypto: handle synchronous operations in async test 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: taras.kondratiuk@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.215.42 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 Current API can't force crypto operation to be strictly sync or async. Hence test should handle synchronous operation even if 'pref_mode' is set to ODP_CRYPTO_ASYNC. Signed-off-by: Taras Kondratiuk --- test/validation/crypto/odp_crypto_test_async_inp.c | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c index feefd49..527e98a 100644 --- a/test/validation/crypto/odp_crypto_test_async_inp.c +++ b/test/validation/crypto/odp_crypto_test_async_inp.c @@ -92,23 +92,24 @@ static void alg_test(enum odp_crypto_op op, CU_FAIL("%s : not implemented for combined alg mode\n"); } - rc = odp_crypto_operation(&op_params, &posted, NULL); + rc = odp_crypto_operation(&op_params, &posted, &result); if (rc < 0) { CU_FAIL("Failed odp_crypto_operation()"); goto cleanup; } - CU_ASSERT(posted); - - /* Poll completion queue for results */ - do { - event = odp_queue_deq(compl_queue); - } while (event == ODP_EVENT_INVALID); - - compl_event = odp_crypto_compl_from_event(event); - CU_ASSERT(odp_crypto_compl_to_u64(compl_event) == - odp_crypto_compl_to_u64(odp_crypto_compl_from_event(event))); - odp_crypto_compl_result(compl_event, &result); - odp_crypto_compl_free(compl_event); + + if (posted) { + /* Poll completion queue for results */ + do { + event = odp_queue_deq(suite_context.queue); + } while (event == ODP_EVENT_INVALID); + + compl_event = odp_crypto_compl_from_event(event); + CU_ASSERT(odp_crypto_compl_to_u64(compl_event) == + odp_crypto_compl_to_u64(odp_crypto_compl_from_event(event))); + odp_crypto_compl_result(compl_event, &result); + odp_crypto_compl_free(compl_event); + } CU_ASSERT(result.ok); CU_ASSERT(result.pkt == pkt);