From patchwork Thu Jun 1 09:03:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 100854 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp710080qge; Thu, 1 Jun 2017 02:16:41 -0700 (PDT) X-Received: by 10.237.60.74 with SMTP id u10mr477618qte.205.1496308600983; Thu, 01 Jun 2017 02:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496308600; cv=none; d=google.com; s=arc-20160816; b=s9K16bNtuzDnKhbog46kQoKaDqNnDXz1js9as1DpKHPbQN1mGJwdDObSAAntp+pEiJ OM88tNO5BaAdNxASiBHQgtYW3qu+8rICox3Reb31AIyvkTs31K0G7S10i7CKnb2dMe2c L2xRlpTE3BDV/mHLon2V7TwYGXYt5YTxLQK9N8EE9SGb+/x2vxJv+mASVE9QaZvbV4kZ X5qcgZ4z+udVyfTI0UNrwfcAP4Q2z+FZ8oagiQ+KvXJ2njlGHyn936T6k6+yIG9lniRj iSkXUxdt5oTJv3rheFRV4qn1G4uhl80D0x+J5AxcwEQ0KxBkoW+u8zsUVyue4/wVnYtJ ZG5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=DrmYfzoxgxfP57WWlcwHNHapKk1BEH6/qnR86gPDWbE=; b=WvRK9K4RxKUYmUVhLFlNLumJjnsggB7r/KD2mdKJNmpQgKfiYkEeDPQVZD9hrylU/p OJB3ZTVkf3KqY+86V5dz07gVztLujIW2mga+BaI+198NofZtYRG7REvuASOSzn8AqIxt IHIplV254uOHuaI6APgj3qMBFk/26pWP6wS5B6voufsXXo4VDOYJD6AGg7n5aaKyAJeg hN5mmZGrDdiJhsdNSN6wP5+aE4pxm2hFIUBD1XrND0sC4ERMkkEjk7HyWS1+rk8H4JgV MGAoXQjfwUxUrZOEZhvH5n7lnhkkaDfuaCEvLQN6Cg1o/c9lENEaEOn2XY7hd0M2HC6G liNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h8si19527974qtc.177.2017.06.01.02.16.40; Thu, 01 Jun 2017 02:16:40 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A37B360679; Thu, 1 Jun 2017 09:16:40 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, 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 E3FD260D88; Thu, 1 Jun 2017 09:06:23 +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 0EE0C60D89; Thu, 1 Jun 2017 09:06:15 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id 62CBA6084E for ; Thu, 1 Jun 2017 09:04:02 +0000 (UTC) Received: by mail-lf0-f53.google.com with SMTP id c184so17852617lfe.2 for ; Thu, 01 Jun 2017 02:04:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=DrmYfzoxgxfP57WWlcwHNHapKk1BEH6/qnR86gPDWbE=; b=QVdB1cI+fkWP79jhLcE31kFZ2vCSualUDNrangKmUkBwPDGKx+7C0hYUreKmNkMHlb gcjVELZb+4sguk8RL69cUzxrLDBsSsg1+tU4KFanjBwt3eeUF2LNzcViM15tdQpUEH73 7bYLr7lBnyLf1f1ox0iTjrP3Q7ekUptAHkkCBtNGagCwTJEQWo1mI7gd2cXSbqVTOcTc jiY/nfxj2eDBQOnafCCOcfaOeacF/qmxWzlEr30Cx69XTZEJi/TX1gS//4KmXJvC4vU7 OAI7sy/i0nVwOR5Rf0684kByRoP63OzMeDVAa0Ndvs/CUWUZlVuXpRwolHe0keK2bxV3 1/KA== X-Gm-Message-State: AODbwcD6KS8yJXpmAL/St07P4gxp+O9b9Zr4r0oPx8L9z7SlE5huLuN0 pvc13t1DFyUyp3CgzcsrJJqr X-Received: by 10.46.22.18 with SMTP id w18mr159685ljd.85.1496307841054; Thu, 01 Jun 2017 02:04:01 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.12]) by smtp.gmail.com with ESMTPSA id 129sm4232819ljf.36.2017.06.01.02.04.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 02:04:00 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 1 Jun 2017 12:03:33 +0300 Message-Id: <20170601090339.9313-18-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> References: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT v5 17/23] test: odp_crypto: bail out if odp_crypto_session_create failed X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" If odp_crypto_session_create() failed, there is no point in checking/freeing session, as it might not have been updated. Signed-off-by: Dmitry Eremin-Solenikov --- test/common_plat/performance/odp_crypto.c | 44 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) -- 2.11.0 diff --git a/test/common_plat/performance/odp_crypto.c b/test/common_plat/performance/odp_crypto.c index 6a58294a25ff..c3dd6d38f3cb 100644 --- a/test/common_plat/performance/odp_crypto.c +++ b/test/common_plat/performance/odp_crypto.c @@ -665,34 +665,32 @@ run_measure_one_config(crypto_args_t *cargs, int rc = 0; if (create_session_from_config(&session, config, cargs)) - rc = -1; - - if (!rc) { - if (cargs->payload_length) { - rc = run_measure_one(cargs, config, &session, - cargs->payload_length, &result); - if (!rc) { - print_result_header(); - print_result(cargs, cargs->payload_length, - config, &result); - } - } else { - unsigned i; + return -1; + if (cargs->payload_length) { + rc = run_measure_one(cargs, config, &session, + cargs->payload_length, &result); + if (!rc) { print_result_header(); - for (i = 0; i < num_payloads; i++) { - rc = run_measure_one(cargs, config, &session, - payloads[i], &result); - if (rc) - break; - print_result(cargs, payloads[i], - config, &result); - } + print_result(cargs, cargs->payload_length, + config, &result); + } + } else { + unsigned i; + + print_result_header(); + for (i = 0; i < num_payloads; i++) { + rc = run_measure_one(cargs, config, &session, + payloads[i], &result); + if (rc) + break; + print_result(cargs, payloads[i], + config, &result); } } - if (session != ODP_CRYPTO_SESSION_INVALID) - odp_crypto_session_destroy(session); + odp_crypto_session_destroy(session); + return rc; }