From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62648A04B3 for ; Tue, 28 Jan 2020 10:52:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BBAA1C1AA; Tue, 28 Jan 2020 10:52:47 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 79C6B1C1AA for ; Tue, 28 Jan 2020 10:52:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 01:52:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,373,1574150400"; d="scan'208";a="261376631" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga002.fm.intel.com with ESMTP; 28 Jan 2020 01:52:43 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.164]) by IRSMSX104.ger.corp.intel.com ([169.254.5.203]) with mapi id 14.03.0439.000; Tue, 28 Jan 2020 09:52:42 +0000 From: "Dybkowski, AdamX" To: "stable@dpdk.org" , "Trahe, Fiona" CC: "Dybkowski, AdamX" Thread-Topic: [PATCH v1] test/crypto: fix missing operation status check Thread-Index: AdXVv3sxkLYsDz8hQUKTopE9z30c4A== Date: Tue, 28 Jan 2020 09:52:42 +0000 Message-ID: <522B1A062D56224ABC0C6BDBCD64D9D38CA9F8D3@IRSMSX103.ger.corp.intel.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-stable] [PATCH v1] test/crypto: fix missing operation status check X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit b26ef1a11f21ecde63582ed6db281c93ce9fbf23 ] This patch adds checking of the symmetric crypto operation status that was silently skipped before. Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented"= ) Signed-off-by: Adam Dybkowski --- test/test/test_cryptodev.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 7b654f34f..e13c454a4 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -136,6 +136,11 @@ process_crypto_request(uint8_t dev_id, struct rte_cryp= to_op *op) while (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) =3D=3D 0) rte_pause(); =20 + if (op->status !=3D RTE_CRYPTO_OP_STATUS_SUCCESS) { + RTE_LOG(DEBUG, USER1, "Operation status %d\n", op->status); + return NULL; + } + return op; } =20 @@ -2899,8 +2904,8 @@ test_snow3g_authentication(const struct snow3g_hash_t= est_data *tdata) =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - ut_params->obuf =3D ut_params->op->sym->m_src; TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); + ut_params->obuf =3D ut_params->op->sym->m_src; ut_params->digest =3D rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) + plaintext_pad_len; =20 @@ -3019,8 +3024,8 @@ test_kasumi_authentication(const struct kasumi_hash_t= est_data *tdata) =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - ut_params->obuf =3D ut_params->op->sym->m_src; TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); + ut_params->obuf =3D ut_params->op->sym->m_src; ut_params->digest =3D rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) + plaintext_pad_len; =20 @@ -4781,8 +4786,8 @@ test_zuc_authentication(const struct wireless_test_da= ta *tdata) =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - ut_params->obuf =3D ut_params->op->sym->m_src; TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); + ut_params->obuf =3D ut_params->op->sym->m_src; ut_params->digest =3D rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) + plaintext_pad_len; =20 @@ -8100,13 +8105,7 @@ test_authentication_verify_fail_when_data_corruption= ( =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); - TEST_ASSERT_EQUAL(ut_params->op->status, - RTE_CRYPTO_OP_STATUS_AUTH_FAILED, - "authentication not failed"); - - ut_params->obuf =3D ut_params->op->sym->m_src; - TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf"); + TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); =20 return 0; } @@ -8161,13 +8160,7 @@ test_authentication_verify_GMAC_fail_when_corruption= ( =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); - TEST_ASSERT_EQUAL(ut_params->op->status, - RTE_CRYPTO_OP_STATUS_AUTH_FAILED, - "authentication not failed"); - - ut_params->obuf =3D ut_params->op->sym->m_src; - TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf"); + TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); =20 return 0; } @@ -8221,14 +8214,7 @@ test_authenticated_decryption_fail_when_corruption( =20 ut_params->op =3D process_crypto_request(ts_params->valid_devs[0], ut_params->op); - - TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process"); - TEST_ASSERT_EQUAL(ut_params->op->status, - RTE_CRYPTO_OP_STATUS_AUTH_FAILED, - "authentication not failed"); - - ut_params->obuf =3D ut_params->op->sym->m_src; - TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf"); + TEST_ASSERT_NULL(ut_params->op, "authentication not failed"); =20 return 0; } --=20 2.13.6