From patchwork Thu Feb 26 23:19:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B520D2043C for ; Thu, 26 Feb 2015 23:19:48 +0000 (UTC) Received: by lbiw7 with SMTP id w7sf11131438lbi.0 for ; Thu, 26 Feb 2015 15:19:47 -0800 (PST) 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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=yBK/tSXO/GK6oW2/5b59fUx+ZejHHILeFX+rc5KRVpo=; b=XWlauFeMT9jWQM03G7zs53FS7PJOU2ksQ49E3usxszmGmAhhfT0jkV6hcLVSofWl8w 8jrgkmwEuUfbE5NE2wUPkAxHsCjv6rJvBQoGp6O+D2eQfr4IEf0B/WUfO/s0oVh1XBW5 cvMySlqkZZLfLxhLoW6PAEdPzfbACjhLOF5e5uyOqYmLgGJMdOX9ji5YTYoCjx6A/lt9 wM26UPIXaTRNe/D6DIl6wIKhHcKDLj/ds9YBtNAkeT2CXBFMEaEW5lqa2zazQaUZGNvr h+4Qr/rizgvsJ7Bl0+NrYirKgu1/RQCMJflnexi4zX+85jrXm56QF+Lqp7Eb0gMog5mx QNgA== X-Gm-Message-State: ALoCoQkml+L0sMOtAl8i3mmNJNQ1yptpQDGXJy1ZFJwTYt8s0rHYonD+O/8l2X6RwFJMEMxkrJNS X-Received: by 10.181.29.66 with SMTP id ju2mr52125wid.1.1424992787714; Thu, 26 Feb 2015 15:19:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.39 with SMTP id cr7ls77320lad.56.gmail; Thu, 26 Feb 2015 15:19:47 -0800 (PST) X-Received: by 10.152.234.43 with SMTP id ub11mr10054674lac.42.1424992787552; Thu, 26 Feb 2015 15:19:47 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id o10si1642510lbw.132.2015.02.26.15.19.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 15:19:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lamq1 with SMTP id q1so14208625lam.5 for ; Thu, 26 Feb 2015 15:19:47 -0800 (PST) X-Received: by 10.112.57.139 with SMTP id i11mr9986200lbq.106.1424992787252; Thu, 26 Feb 2015 15:19:47 -0800 (PST) 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 h5csp3587812lbj; Thu, 26 Feb 2015 15:19:46 -0800 (PST) X-Received: by 10.140.135.207 with SMTP id 198mr23479619qhh.71.1424992785994; Thu, 26 Feb 2015 15:19:45 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id il1si2374236qab.0.2015.02.26.15.19.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 15:19:45 -0800 (PST) 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 1YR7iY-0002cM-LJ; Thu, 26 Feb 2015 23:19:42 +0000 Received: from mail-lb0-f170.google.com ([209.85.217.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR7iP-0002a6-4r for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 23:19:33 +0000 Received: by lbdu10 with SMTP id u10so13978331lbd.7 for ; Thu, 26 Feb 2015 15:19:27 -0800 (PST) X-Received: by 10.152.19.9 with SMTP id a9mr10081526lae.80.1424992766921; Thu, 26 Feb 2015 15:19:26 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id en12sm489514lbc.11.2015.02.26.15.19.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 15:19:26 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 27 Feb 2015 01:19:19 +0200 Message-Id: <1424992760-28846-2-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424992760-28846-1-git-send-email-taras.kondratiuk@linaro.org> References: <1424992760-28846-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto Subject: [lng-odp] [RFC 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.44 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 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c index 9e4e9f1..494a68e 100644 --- a/test/validation/crypto/odp_crypto_test_async_inp.c +++ b/test/validation/crypto/odp_crypto_test_async_inp.c @@ -90,21 +90,22 @@ 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); + 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); - odp_crypto_compl_result(compl_event, &result); - odp_crypto_compl_free(compl_event); + compl_event = 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);