From patchwork Thu Dec 28 11:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122833 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3301739qgn; Thu, 28 Dec 2017 03:01:21 -0800 (PST) X-Google-Smtp-Source: ACJfBotr9777tg64b+Tz1Kpp6ltXS0IdukCNy4vLI0sfe1Qs8rC1n2/MvitBFX3lyjYU/hyEIwKu X-Received: by 10.237.37.177 with SMTP id x46mr43631758qtc.76.1514458881228; Thu, 28 Dec 2017 03:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514458881; cv=none; d=google.com; s=arc-20160816; b=KQZu2LR76Be8OPomgibq7jeU+dNOpEfz4R3x9Piop2zF46YbTt52c8P/dIJeV50tNj 1NQwNzz7lSjicXBaMYlfSdXxUHkgZeQedPBCopfAGwn5BBNS8D39OqvjarI8joKXIR0C EKxKVipEoVlZlbiq3766O5OPI1RWT6+FTUo5/mmqu0xg4FWwjFckXuruALFyq+t+GTQ3 41bm7+Jq4n6pVynF3r99Wnf6gTbFL7Y1nJY9nKw3b7ZwLl2nHXQrQu9YqfcXaKX6grOz S16Eu2WOjf6ni8gP/YUAP72gDGztEwS34h5DDjROu/1T0cuHwLDBabfSNvlvu+T6mpPN NANQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=PZr4pUGRwOPoVvbIGZFhKGwiR9HFr5LAf3xcXfpvRlQ=; b=h4ZlXs8nScym7Nt3Hk3tQFiWpLHOURPe9rcLUrVqL8ClhgUEKnJABASot2tZr1E8Cg c+YWvMYNy8sjDmMxvqiyTpLwAtC01w+P1D6o9qB5yfsCypZq9YOiCOhkp/r3A39rMRNg dO/udNWCns0nwaOPCas9BnXn58ad5IBC80PYw0YaLMnNBlPaDjAZH0/8dqdjAe5zdhsg 4SPAo4P0wVnUv8iTy5pWrzn9U/ReA8WPXWca+AiCA+rG5ZFgCzn6z7RazP1EcHTBN3rK r0+CKQ3qJTybzQPg20/wtWlfqcmVhsOMq0XmA1KAyRfblOb0LGRHcHhTFbiA7ABd9X2w paaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id s87si5950081qki.430.2017.12.28.03.01.20; Thu, 28 Dec 2017 03:01:21 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D691E614FF; Thu, 28 Dec 2017 11:01:20 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 74757609AA; Thu, 28 Dec 2017 11:00: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 54F4E60912; Thu, 28 Dec 2017 11:00:18 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 2AF2D608D4 for ; Thu, 28 Dec 2017 11:00:17 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward102o.mail.yandex.net (Yandex) with ESMTP id EF53F5A03B71 for ; Thu, 28 Dec 2017 14:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VDEAsKiAVa-0AUaltmP; Thu, 28 Dec 2017 14:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5RDKid1QT5-0AMmhCGQ; Thu, 28 Dec 2017 14:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 28 Dec 2017 14:00:07 +0300 Message-Id: <1514458808-9218-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> References: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 376 Subject: [lng-odp] [PATCH API-NEXT v1 1/2] validation: crypto: clean shutdown in case pkt allocation 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" From: Dmitry Eremin-Solenikov Provide clean shutdown path for the case of odp_packet_alloc() returning ODP_PACKET_INVALID. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 376 (lumag:test-fixes) ** https://github.com/Linaro/odp/pull/376 ** Patch: https://github.com/Linaro/odp/pull/376.patch ** Base sha: 68735b312926a44ddf42f9ecf96a0badd941a247 ** Merge commit sha: c3ae2320e846c56ecc6040c63336b9e30de0beee **/ test/validation/api/crypto/odp_crypto_test_inp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index f1da6989c..821bdc7e4 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -458,6 +458,8 @@ static void alg_test(odp_crypto_op_t op, odp_packet_t pkt = odp_packet_alloc(suite_context.pool, ref->length + ref->digest_length); CU_ASSERT(pkt != ODP_PACKET_INVALID); + if (pkt == ODP_PACKET_INVALID) + goto cleanup; for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) { /* checking against wrong digest is meaningless for NULL digest @@ -523,10 +525,11 @@ static void alg_test(odp_crypto_op_t op, } } + odp_packet_free(pkt); + +cleanup: rc = odp_crypto_session_destroy(session); CU_ASSERT(!rc); - - odp_packet_free(pkt); } /** From patchwork Thu Dec 28 11:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122832 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3301111qgn; Thu, 28 Dec 2017 03:00:52 -0800 (PST) X-Google-Smtp-Source: ACJfBots8CsLLaIY7iMUlZ1fHXbG6bOeGQDnyYnLG7YZCFC2WTDGwpiLi/Ujk9JK0lXPCD2iSmGl X-Received: by 10.200.54.139 with SMTP id a11mr41898358qtc.325.1514458852060; Thu, 28 Dec 2017 03:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514458852; cv=none; d=google.com; s=arc-20160816; b=JR6QOto9NNfoQMwFxSgrPn0ql8fmtQggRSSzqGCBlnC71AxOcLIsJMZBzWBpoRI6SC mbnq7yfwbCJJyiTQ+PnXs9JQVOXOXSXUoKzjA9/IwmscIOBqO+s9YsmzsbvBW8vKPpjf VZb/RRHATBfb5mkSyPkeuEzyLwbMDcTu3YnYeaxh/UjdTTG5hwGTif2pX+W3jzz8Qrhp Xt43CHi9nvEjdY9us6er6F7LFfXDIRhJb6LmGqejchrt8sETrd83SA21Ui8rrU4cVTMw JpvQIJDXdvt9HIzkh09qVVB82YgMaB3mPJ3dRPRPnZcSm/5c8fyfV4Chm4HGhWMqunLK Gn9w== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=uWeGlkLkiay5mqV7oF8WuRHNjFGLpxhGjnM2i6Lt96M=; b=tddSYYY7rLvONS8lrICQDi22pzd/I6ruGQ8FWRedmJ6tnatAi2ejp/V9vkO1PzfGCe zuvNfDUrP7bxzfrNx3uqPgLoD/ssqxrPimQRcNk/vunbcmPpFsreklkkWY5ULB55Rf0S +oCE+MyAtm5TQWpAVa2xsr3fwLiZ5yaiUz345xT+5pyig4jnhnqplxhKEopn/VIBnMMl Z1GBuX5U0MzioF6DoGustdvrZRbQ8B8+2ZE10xnLAxDmVzvvSOmqfQQ+sevQ6mZ7XGJQ x6zO5+rjAN/e0B966ybnNngNlDj2ChZo9vJ6oJmZJqHaP6aGWPQR5wysJLmZMALnZvFt ywnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w4si2825317qkd.390.2017.12.28.03.00.51; Thu, 28 Dec 2017 03:00:52 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B68BF60BF4; Thu, 28 Dec 2017 11:00:51 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 BE2F26095F; Thu, 28 Dec 2017 11:00:20 +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 76DB4608F7; Thu, 28 Dec 2017 11:00:14 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 483FE608D4 for ; Thu, 28 Dec 2017 11:00:13 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 95A802A2257A for ; Thu, 28 Dec 2017 14:00:11 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tGD1ZD5J9H-0Bb4PCMs; Thu, 28 Dec 2017 14:00:11 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5RDKid1QT5-0BMaikBn; Thu, 28 Dec 2017 14:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 28 Dec 2017 14:00:08 +0300 Message-Id: <1514458808-9218-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> References: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 376 Subject: [lng-odp] [PATCH API-NEXT v1 2/2] validation: pktio: clean shutdown in case pkt sending 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" From: Dmitry Eremin-Solenikov Provide clean shutdown path for the case of odp_pktout_send() returning an error during pktio_test_send_failure test. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 376 (lumag:test-fixes) ** https://github.com/Linaro/odp/pull/376 ** Patch: https://github.com/Linaro/odp/pull/376.patch ** Base sha: 68735b312926a44ddf42f9ecf96a0badd941a247 ** Merge commit sha: c3ae2320e846c56ecc6040c63336b9e30de0beee **/ test/validation/api/pktio/pktio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index a6820a1de..a23641036 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1846,7 +1846,9 @@ void pktio_test_send_failure(void) * the initial short packets should be sent successfully */ odp_errno_zero(); ret = odp_pktout_send(pktout, pkt_tbl, TX_BATCH_LEN); - CU_ASSERT_FATAL(ret == long_pkt_idx); + CU_ASSERT(ret == long_pkt_idx); + if (ret != long_pkt_idx) + goto cleanup; CU_ASSERT(odp_errno() == 0); info_rx.id = pktio_rx; @@ -1897,6 +1899,7 @@ void pktio_test_send_failure(void) odp_packet_free(pkt_tbl[i]); } +cleanup: if (pktio_rx != pktio_tx) { CU_ASSERT(odp_pktio_stop(pktio_rx) == 0); CU_ASSERT(odp_pktio_close(pktio_rx) == 0);