From patchwork Tue Jul 19 14:20:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 72326 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp107043qga; Tue, 19 Jul 2016 07:21:16 -0700 (PDT) X-Received: by 10.55.215.141 with SMTP id t13mr53985316qkt.31.1468938076499; Tue, 19 Jul 2016 07:21:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u65si19729478qtd.0.2016.07.19.07.21.15; Tue, 19 Jul 2016 07:21:16 -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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D771B686A6; Tue, 19 Jul 2016 14:21:15 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 8BC06684F1; Tue, 19 Jul 2016 14:21:11 +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 DAEA06863B; Tue, 19 Jul 2016 14:21:07 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id ECE756809F for ; Tue, 19 Jul 2016 14:21:05 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id g62so15734145lfe.3 for ; Tue, 19 Jul 2016 07:21:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+SJt+XMdJBeN3IzC33yam+2NB+qRAULReY0glkZyaHg=; b=coFq/S7zGxUJjXefHT47ogdzDuLrjngbkQgrfBpeSu9kzGmm1WoHW+gPK2ruAoP40A qTcGYbIB/RHbcNLjCJtEplyLJFxPdbs74HAuZxzVpsfLALn7ZBckSewsOdZovyzmk8aT lK3DtzLjVscEb9JGscjIUZSrJrE4couwtep0GtwY6Dd6mvTtX/bdkSp+PEycGSX3N74W 9aj4LPTHFDq8woe/WCuW2JU7DVNJWGZzYuqP5qeNgguwnv/FOVVfhlvn7XqxpLEBmmpH kqxcx6BA/aF7o9j01+QjAk6wn/KU9OJcLZEcQl4m4wJ86+lmuSMlTey9lkEWka+lmsR6 MqOw== X-Gm-Message-State: ALyK8tKfGSh7h/2ORPeJTBwb8/J2dP0Mrs5g99DOesNQcIXV4KfY0boGiw9uB5+qO0wuuGMd8Fw= X-Received: by 10.25.19.169 with SMTP id 41mr15384325lft.24.1468938064794; Tue, 19 Jul 2016 07:21:04 -0700 (PDT) Received: from localhost.localdomain ([83.220.238.101]) by smtp.gmail.com with ESMTPSA id g3sm2392174lfe.14.2016.07.19.07.21.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 07:21:04 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 19 Jul 2016 17:20:58 +0300 Message-Id: <1468938058-14659-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: crypto patch Subject: [lng-odp] [PATCH] test: odp_crypto add termination path 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" Signed-off-by: Maxim Uvarov --- test/performance/odp_crypto.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) -- 2.7.1.250.gff4ea60 Reviewed-by: Mike Holmes mike.holmes@linaro.org diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index 404984d..b7818ea 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -545,9 +545,11 @@ run_measure_one(crypto_args_t *cargs, * every time. * Note we leaked one packet here. */ - pkt = odp_packet_alloc(pkt_pool, - payload_length); - if (pkt == ODP_PACKET_INVALID) { + odp_packet_t newpkt; + + newpkt = odp_packet_alloc(pkt_pool, + payload_length); + if (newpkt == ODP_PACKET_INVALID) { app_err("failed to allocate buffer\n"); return -1; } else { @@ -555,8 +557,8 @@ run_measure_one(crypto_args_t *cargs, memset(mem, 1, payload_length); } - params.pkt = pkt; - params.out_pkt = cargs->in_place ? pkt : + params.pkt = newpkt; + params.out_pkt = cargs->in_place ? newpkt : ODP_PACKET_INVALID; } @@ -650,6 +652,8 @@ run_measure_one(crypto_args_t *cargs, cargs->iteration_count; } + odp_packet_free(pkt); + return rc; } @@ -821,6 +825,21 @@ int main(int argc, char *argv[]) } } + if (odp_pool_destroy(pool)) { + app_err("Error: pool destroy\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_local()) { + app_err("Error: term local\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_global(instance)) { + app_err("Error: term global\n"); + exit(EXIT_FAILURE); + } + return 0; }