From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D884A0548 for ; Sun, 28 Nov 2021 15:58:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12E9F42735; Sun, 28 Nov 2021 15:58:33 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2072.outbound.protection.outlook.com [40.107.93.72]) by mails.dpdk.org (Postfix) with ESMTP id 853CB42746 for ; Sun, 28 Nov 2021 15:58:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TXf/3Nx+q9jrADF0T4cKzF+0lNFvlSe/QA/E1j+mFeVWVAdW/icuAqL0sbWk0YWgyrYcB67J3Pjhs8BFMBgSPYCq9mQQ8DDsRMXnuLparx1If1C2DnHNI7EJbAldQ/v75kfI80+e5paJGFH5CPiMOZuAlojcPb6Os1TWXJSnQk0aPgIq7XgOsdzmkZ/2IOQkvy4EmXpavcl43NjjuMKrC8KAm4tOnyKdXYV9qA5DHBh1VWM1HcK4mxBx9Ecv7FCGNdgqO50hVQAPd1MDLF1xyPaucjzVvw3FiJCkEz9Ib0KgzAsUkG4p3ooFz6rBuQkV/qjIqEvR3KWx6tElL1IHtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9uF6Y2WVuawStaNeAo4NdxeOB34DVa5ovBAexsnkWvQ=; b=PPxeSVHwQTcIkBZLaFM2qRq+d66UeyHu68YJ37pgcPciS79NzmFm71enPxc+t0UZCuGdoxQ/pcFxz6OwRch0ctD2jkQ9HLnthUEvQLaro7ooTWnUuWG07F7S11LfL327YuxQWRYb2ZCRTjardGOLmhPkPxni+0ZmsSX6Rp4gxys/jZ8AZoJMwX2EOR5xy3rjJmQFNjCW38exRJWlYTJydcjPcBmHXTANNwRahVM88vCqg8TfezWhE2Lqq6gsY9xDBMtcT21yEJdfnFIu0pDT2TZzGJauodCVp/Wo12Guga9eImwrcoLhN7/f/yBPQx5FfrVlClQczjNyJqZkgIF2fA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9uF6Y2WVuawStaNeAo4NdxeOB34DVa5ovBAexsnkWvQ=; b=LCJGk/lc58lEO49aL0ZOjZdhIDdE617YPM6sh9HHerw272ocog8xWScHtQxRy2AZFjS9gLb9qiizQ8DgScoejzn8hXRp28WUKMpiS/4WxmQSi9SNYbhrLeSSx7eGNGe8kEv+MbsKP8MXxN5YbOLhL8WT8Suv5aZtRC0x8lX8/8a4TFGSR7a6fAvsIjAKW389vBzkaEBxc0q6Sx9snhKyg6YgepsIDhLNS4V/RgP+voe+RNXo6YyYmEcOWYUKRWxKhFlDoxk77rcCGCZ5vSkv1dqxnnAEXB8LSMxnMFgLM/sAqLzwNnRtJwSQOuqYlApj3rZkfZXE+B/j2KIXjCh69g== Received: from BN0PR04CA0086.namprd04.prod.outlook.com (2603:10b6:408:ea::31) by CH2PR12MB4328.namprd12.prod.outlook.com (2603:10b6:610:a6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Sun, 28 Nov 2021 14:58:29 +0000 Received: from BN8NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ea:cafe::bf) by BN0PR04CA0086.outlook.office365.com (2603:10b6:408:ea::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Sun, 28 Nov 2021 14:58:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT060.mail.protection.outlook.com (10.13.177.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:58:29 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 28 Nov 2021 14:58:26 +0000 From: Xueming Li To: Anoob Joseph CC: Luca Boccassi , Akhil Goyal , dpdk stable Subject: patch 'test/crypto: fix missing return checks' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:37 +0800 Message-ID: <20211128145423.3974892-34-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4e2805b-d1b2-4924-157c-08d9b27f8a17 X-MS-TrafficTypeDiagnostic: CH2PR12MB4328: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SVAbpLc8AnUbfPswBGl1HDjMxDTRGBEIcAjUt8BIGK+/t1NDVV0G+l8XHk5XYNc5+dnXQF4JIvJvMe368gJ84bifIfUgrWGGMMTUNAuKQuYLwKxtxvt8iw0SUsAORj3OpORqy9SKl+nDRXjeoHerM3ViGJm/ad4bZkzt28IZ2P3PKKgDKa73OeypDlVrHOhFsy316NpBXLPIw6bR9kGYW1c9Q6JBayTe7NyhXuXNK/PtbfYugxPqOieZBpCtW1TbBvVSFVEv2lQnUr4BuaNXPm89RttoxGvYLRhEDYCMfzovES+Wo4NgGCDVmjBk1NdUBjSQn8GyL+ulFCj8chlg6a7NLbefFAz5IH96Gj0Jm/2CztkwkzSEC+LLmKC15qoN/F9DOvtzLwXA7YAsxjrKPYk2zg55UdIjyi2gyXnrDVr5+jonyf0Vk36PhazwkwoCiwsp5Fljsxduv4QkGbMzmRC2fyF+ixqJ7pp8NvsK/FcANbNsvyC+QmJgeUu1ihKDao+fby0ZFooeXfn3JjKrLNN1yUwbSjuWHwbUR7mxZTTj5pE/nNTxx9g1jsqP38yZZOWEpyXVx4H92RRX12tobP7Pg8l/5loeGN+oYRE0G8nr5Ld7E+X++xvhE2407fi6vSIm4WRty0UzitQCql/2+VuCdyGjAgYXpGmeiyjXlfTPma9m4sfl/Ly/2p8mv65/SHt0vRp7jhyEkUMHtZowMcQ7s49vS6plmkFvTfkXsDKsQnDY8xfbkQ/DuU0bDbhxtHgVhy3AuufHsHCQA4pumzOZq6VxgfhZg+7K9GVFGyBwIGStgrcv+BkhUfDmPyK0LpoQxh9EOP8G5BfsqXC5XQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(26005)(54906003)(186003)(8936002)(86362001)(6916009)(5660300002)(16526019)(1076003)(6666004)(55016003)(82310400004)(508600001)(47076005)(966005)(6286002)(36756003)(2906002)(426003)(336012)(8676002)(4326008)(4001150100001)(83380400001)(70586007)(70206006)(36860700001)(316002)(7696005)(7636003)(356005)(2616005)(30864003)(53546011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 14:58:29.5406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4e2805b-d1b2-4924-157c-08d9b27f8a17 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4328 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/ce1df1c241eec4e077d0c705f59dbc878715a382 Thanks. Xueming Li --- >From ce1df1c241eec4e077d0c705f59dbc878715a382 Mon Sep 17 00:00:00 2001 From: Anoob Joseph Date: Mon, 8 Nov 2021 20:43:46 +0530 Subject: [PATCH] test/crypto: fix missing return checks Cc: Xueming Li [ upstream commit 0015b149bcc59bdd5d8797c8e19c26b0f6f1b40d ] The API could return errors. Add error checking for the same. Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions") Signed-off-by: Anoob Joseph Acked-by: Akhil Goyal --- app/test/test_cryptodev.c | 116 ++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 36 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 7a205a2b00..a655c37a10 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -1675,6 +1675,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + int status; /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -1721,12 +1722,17 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); /* Create crypto session*/ - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], + status = rte_cryptodev_sym_session_init(ts_params->valid_devs[0], ut_params->sess, &ut_params->cipher_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + + if (status == -ENOTSUP) + return TEST_SKIPPED; + + TEST_ASSERT_EQUAL(status, 0, "Session init failed"); /* Generate crypto op data structure */ ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, @@ -7439,6 +7445,7 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, uint8_t iv_len) { uint8_t aead_key[key_len]; + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -7462,14 +7469,13 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->aead_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - - return 0; + return status; } static int @@ -10190,6 +10196,7 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, const struct HMAC_MD5_vector *test_case) { uint8_t key[64]; + int status; memcpy(key, test_case->key.data, test_case->key.len); @@ -10205,13 +10212,15 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + if (ut_params->sess == NULL) + return TEST_FAILED; - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], + status = rte_cryptodev_sym_session_init(ts_params->valid_devs[0], ut_params->sess, &ut_params->auth_xform, ts_params->session_priv_mpool); - - if (ut_params->sess == NULL) - return TEST_FAILED; + if (status == -ENOTSUP) + return TEST_SKIPPED; ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); @@ -10424,6 +10433,7 @@ test_multi_session(void) struct rte_cryptodev_sym_session **sessions; uint16_t i; + int status; /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -10453,14 +10463,17 @@ test_multi_session(void) sessions[i] = rte_cryptodev_sym_session_create( ts_params->session_mpool); - - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], - sessions[i], &ut_params->auth_xform, - ts_params->session_priv_mpool); TEST_ASSERT_NOT_NULL(sessions[i], "Session creation failed at session number %u", i); + status = rte_cryptodev_sym_session_init( + ts_params->valid_devs[0], + sessions[i], &ut_params->auth_xform, + ts_params->session_priv_mpool); + if (status == -ENOTSUP) + return TEST_SKIPPED; + /* Attempt to send a request on each session */ TEST_ASSERT_SUCCESS( test_AES_CBC_HMAC_SHA512_decrypt_perform( sessions[i], @@ -10553,6 +10566,7 @@ test_multi_session_random_usage(void) }, }; + int status; /* Verify the capabilities */ struct rte_cryptodev_sym_capability_idx cap_idx; @@ -10576,6 +10590,9 @@ test_multi_session_random_usage(void) for (i = 0; i < MB_SESSION_NUMBER; i++) { sessions[i] = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(sessions[i], + "Session creation failed at session number %u", + i); rte_memcpy(&ut_paramz[i].ut_params, &unittest_params, sizeof(struct crypto_unittest_params)); @@ -10585,16 +10602,16 @@ test_multi_session_random_usage(void) ut_paramz[i].cipher_key, ut_paramz[i].hmac_key); /* Create multiple crypto sessions*/ - rte_cryptodev_sym_session_init( + status = rte_cryptodev_sym_session_init( ts_params->valid_devs[0], sessions[i], &ut_paramz[i].ut_params.auth_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(sessions[i], - "Session creation failed at session number %u", - i); + if (status == -ENOTSUP) + return TEST_SKIPPED; + TEST_ASSERT_EQUAL(status, 0, "Session init failed"); } srand(time(NULL)); @@ -10706,6 +10723,7 @@ test_null_burst_operation(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + int status; unsigned i, burst_len = NULL_BURST_LENGTH; @@ -10733,12 +10751,17 @@ test_null_burst_operation(void) ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); /* Create Crypto session*/ - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], + status = rte_cryptodev_sym_session_init(ts_params->valid_devs[0], ut_params->sess, &ut_params->cipher_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + + if (status == -ENOTSUP) + return TEST_SKIPPED; + + TEST_ASSERT_EQUAL(status, 0, "Session init failed"); TEST_ASSERT_EQUAL(rte_crypto_op_bulk_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC, burst, burst_len), @@ -10896,6 +10919,7 @@ static int create_gmac_session(uint8_t dev_id, enum rte_crypto_auth_operation auth_op) { uint8_t auth_key[tdata->key.len]; + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -10916,14 +10940,13 @@ static int create_gmac_session(uint8_t dev_id, ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->auth_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - - return 0; + return status; } static int @@ -10961,6 +10984,8 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata) retval = create_gmac_session(ts_params->valid_devs[0], tdata, RTE_CRYPTO_AUTH_OP_GENERATE); + if (retval == -ENOTSUP) + return TEST_SKIPPED; if (retval < 0) return retval; @@ -11090,6 +11115,8 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata) retval = create_gmac_session(ts_params->valid_devs[0], tdata, RTE_CRYPTO_AUTH_OP_VERIFY); + if (retval == -ENOTSUP) + return TEST_SKIPPED; if (retval < 0) return retval; @@ -11217,6 +11244,8 @@ test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata, retval = create_gmac_session(ts_params->valid_devs[0], tdata, RTE_CRYPTO_AUTH_OP_GENERATE); + if (retval == -ENOTSUP) + return TEST_SKIPPED; if (retval < 0) return retval; @@ -11546,6 +11575,7 @@ create_auth_session(struct crypto_unittest_params *ut_params, { struct crypto_testsuite_params *ts_params = &testsuite_params; uint8_t auth_key[reference->auth_key.len + 1]; + int status; memcpy(auth_key, reference->auth_key.data, reference->auth_key.len); @@ -11561,14 +11591,13 @@ create_auth_session(struct crypto_unittest_params *ut_params, /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->auth_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - - return 0; + return status; } static int @@ -11581,6 +11610,7 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, struct crypto_testsuite_params *ts_params = &testsuite_params; uint8_t cipher_key[reference->cipher_key.len + 1]; uint8_t auth_key[reference->auth_key.len + 1]; + int status; memcpy(cipher_key, reference->cipher_key.data, reference->cipher_key.len); @@ -11614,14 +11644,13 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->auth_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - - return 0; + return status; } static int @@ -11837,6 +11866,9 @@ test_authentication_verify_fail_when_data_corruption( ts_params->valid_devs[0], reference, RTE_CRYPTO_AUTH_OP_VERIFY); + + if (retval == -ENOTSUP) + return TEST_SKIPPED; if (retval < 0) return retval; @@ -12009,6 +12041,9 @@ test_authenticated_decryption_fail_when_corruption( reference, RTE_CRYPTO_AUTH_OP_VERIFY, RTE_CRYPTO_CIPHER_OP_DECRYPT); + + if (retval == -ENOTSUP) + return TEST_SKIPPED; if (retval < 0) return retval; @@ -12121,13 +12156,17 @@ test_authenticated_encrypt_with_esn( /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], + status = rte_cryptodev_sym_session_init(ts_params->valid_devs[0], ut_params->sess, &ut_params->cipher_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + if (status == -ENOTSUP) + return TEST_SKIPPED; + + TEST_ASSERT_EQUAL(status, 0, "Session init failed"); ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); TEST_ASSERT_NOT_NULL(ut_params->ibuf, @@ -12203,6 +12242,7 @@ test_authenticated_decrypt_with_esn( uint8_t cipher_key[reference->cipher_key.len + 1]; uint8_t auth_key[reference->auth_key.len + 1]; struct rte_cryptodev_info dev_info; + int status; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); uint64_t feat_flags = dev_info.feature_flags; @@ -12253,13 +12293,17 @@ test_authenticated_decrypt_with_esn( /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); - rte_cryptodev_sym_session_init(ts_params->valid_devs[0], + retval = rte_cryptodev_sym_session_init(ts_params->valid_devs[0], ut_params->sess, &ut_params->auth_xform, ts_params->session_priv_mpool); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + if (retval == -ENOTSUP) + return TEST_SKIPPED; + + TEST_ASSERT_EQUAL(retval, 0, "Session init failed"); ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); TEST_ASSERT_NOT_NULL(ut_params->ibuf, -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:05.095528780 +0800 +++ 0033-test-crypto-fix-missing-return-checks.patch 2021-11-28 22:41:03.273541825 +0800 @@ -1 +1 @@ -From 0015b149bcc59bdd5d8797c8e19c26b0f6f1b40d Mon Sep 17 00:00:00 2001 +From ce1df1c241eec4e077d0c705f59dbc878715a382 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 0015b149bcc59bdd5d8797c8e19c26b0f6f1b40d ] @@ -9 +11,0 @@ -Cc: stable@dpdk.org @@ -18 +20 @@ -index 29e8675e30..ef0433680c 100644 +index 7a205a2b00..a655c37a10 100644 @@ -21 +23 @@ -@@ -2138,6 +2138,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) +@@ -1675,6 +1675,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) @@ -29 +31 @@ -@@ -2184,12 +2185,17 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) +@@ -1721,12 +1722,17 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void) @@ -49 +51 @@ -@@ -7972,6 +7978,7 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, +@@ -7439,6 +7445,7 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, @@ -57 +59 @@ -@@ -7995,14 +8002,13 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, +@@ -7462,14 +7469,13 @@ create_aead_session(uint8_t dev_id, enum rte_crypto_aead_algorithm algo, @@ -75 +77 @@ -@@ -11103,6 +11109,7 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, +@@ -10190,6 +10196,7 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, @@ -83 +85 @@ -@@ -11118,13 +11125,15 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, +@@ -10205,13 +10212,15 @@ static int MD5_HMAC_create_session(struct crypto_testsuite_params *ts_params, @@ -103 +105 @@ -@@ -11337,6 +11346,7 @@ test_multi_session(void) +@@ -10424,6 +10433,7 @@ test_multi_session(void) @@ -111 +113 @@ -@@ -11366,14 +11376,17 @@ test_multi_session(void) +@@ -10453,14 +10463,17 @@ test_multi_session(void) @@ -133 +135 @@ -@@ -11466,6 +11479,7 @@ test_multi_session_random_usage(void) +@@ -10553,6 +10566,7 @@ test_multi_session_random_usage(void) @@ -141 +143 @@ -@@ -11489,6 +11503,9 @@ test_multi_session_random_usage(void) +@@ -10576,6 +10590,9 @@ test_multi_session_random_usage(void) @@ -151 +153 @@ -@@ -11498,16 +11515,16 @@ test_multi_session_random_usage(void) +@@ -10585,16 +10602,16 @@ test_multi_session_random_usage(void) @@ -172 +174 @@ -@@ -11619,6 +11636,7 @@ test_null_burst_operation(void) +@@ -10706,6 +10723,7 @@ test_null_burst_operation(void) @@ -180 +182 @@ -@@ -11646,12 +11664,17 @@ test_null_burst_operation(void) +@@ -10733,12 +10751,17 @@ test_null_burst_operation(void) @@ -200 +202 @@ -@@ -12049,6 +12072,7 @@ static int create_gmac_session(uint8_t dev_id, +@@ -10896,6 +10919,7 @@ static int create_gmac_session(uint8_t dev_id, @@ -208 +210 @@ -@@ -12069,14 +12093,13 @@ static int create_gmac_session(uint8_t dev_id, +@@ -10916,14 +10940,13 @@ static int create_gmac_session(uint8_t dev_id, @@ -226 +228 @@ -@@ -12114,6 +12137,8 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata) +@@ -10961,6 +10984,8 @@ test_AES_GMAC_authentication(const struct gmac_test_data *tdata) @@ -235 +237 @@ -@@ -12243,6 +12268,8 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata) +@@ -11090,6 +11115,8 @@ test_AES_GMAC_authentication_verify(const struct gmac_test_data *tdata) @@ -244 +246 @@ -@@ -12370,6 +12397,8 @@ test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata, +@@ -11217,6 +11244,8 @@ test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata, @@ -253 +255 @@ -@@ -12699,6 +12728,7 @@ create_auth_session(struct crypto_unittest_params *ut_params, +@@ -11546,6 +11575,7 @@ create_auth_session(struct crypto_unittest_params *ut_params, @@ -261 +263 @@ -@@ -12714,14 +12744,13 @@ create_auth_session(struct crypto_unittest_params *ut_params, +@@ -11561,14 +11591,13 @@ create_auth_session(struct crypto_unittest_params *ut_params, @@ -279 +281 @@ -@@ -12734,6 +12763,7 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, +@@ -11581,6 +11610,7 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, @@ -287 +289 @@ -@@ -12767,14 +12797,13 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, +@@ -11614,14 +11644,13 @@ create_auth_cipher_session(struct crypto_unittest_params *ut_params, @@ -305 +307 @@ -@@ -12990,6 +13019,9 @@ test_authentication_verify_fail_when_data_corruption( +@@ -11837,6 +11866,9 @@ test_authentication_verify_fail_when_data_corruption( @@ -315 +317 @@ -@@ -13165,6 +13197,9 @@ test_authenticated_decryption_fail_when_corruption( +@@ -12009,6 +12041,9 @@ test_authenticated_decryption_fail_when_corruption( @@ -325,9 +327 @@ -@@ -13226,6 +13261,7 @@ test_authenticated_encrypt_with_esn( - uint8_t cipher_key[reference->cipher_key.len + 1]; - uint8_t auth_key[reference->auth_key.len + 1]; - struct rte_cryptodev_info dev_info; -+ int status; - - rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - uint64_t feat_flags = dev_info.feature_flags; -@@ -13277,13 +13313,17 @@ test_authenticated_encrypt_with_esn( +@@ -12121,13 +12156,17 @@ test_authenticated_encrypt_with_esn( @@ -353 +347,9 @@ -@@ -13409,13 +13449,17 @@ test_authenticated_decrypt_with_esn( +@@ -12203,6 +12242,7 @@ test_authenticated_decrypt_with_esn( + uint8_t cipher_key[reference->cipher_key.len + 1]; + uint8_t auth_key[reference->auth_key.len + 1]; + struct rte_cryptodev_info dev_info; ++ int status; + + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); + uint64_t feat_flags = dev_info.feature_flags; +@@ -12253,13 +12293,17 @@ test_authenticated_decrypt_with_esn(