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 9DB7345610 for ; Fri, 12 Jul 2024 13:03:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9714D402E5; Fri, 12 Jul 2024 13:03:59 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2052.outbound.protection.outlook.com [40.107.96.52]) by mails.dpdk.org (Postfix) with ESMTP id A0C3040677 for ; Fri, 12 Jul 2024 13:03:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DOTLjek2YHKoqXcNrL91vnnQaNwfLg7WBdMv3u6XlNS/UW9yFGu0N5Tix+qmViuhbYucvBvLMcvNCXMkp4tVRYDAkS+RRp8cWez+BHqYfnneex+qzOyE93wYQjar4UqDA0rJiIl0LmgqN5PrFfgQAvav3SgncQNWZjewI07EXrHDYNzUQnZTiAiOfEFa7wWW+c9hQkm6qS5LsbbWPbi6eAc5uHPAx1aZfX/N4nUpsCiQhJDfGQN4CZDKj8mZ03Utmeg9pbTv61pc75b0Pscy38CPYFlecbqU0gMAbZhEpZ1Vkyt2YxOra1mQ0Eh6mFGAFlS5a1Y/87ETwzM91JizRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3zGJS01J0724HtBnDIWp3qwn8gYgp8XCd23stnafkrw=; b=DwLuQrpuiaPXxVoOOXNDFg1IldrEA5JY/SIQo3WDWehvfSjZ4IUJ/AP/rkyHdQhxM96rpLxRZQZuGSwCL7enUCKH+DeIcTGfR1WQ9NlD5ek9B8OAtcfCWcERc3rZU+2o/v6GUNXpNr/eTGr5GhCh5vAGJponXmGNzie5BvpIaqTod337HzIEGTu+47De0aTFZRamqrK686Jt7pp+1eSTEg6+0PePgABVHwr6Z7RI6EFLi0U4M1t7kHFxb3PrLPKxguUUW6Z6DR4x4zU30zY3V8+FGCZFmQ15NzALOa+ZmPoijEsS2msThgVYletU1t4z3ns7GAy/JOxBaQCdNA6agA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=3zGJS01J0724HtBnDIWp3qwn8gYgp8XCd23stnafkrw=; b=cq7XFFvXWuUy10qJ5e4gZYIb7ubm0qyGkNCKpBRBzZJuaUTwSXtiwGDpi6DO7BesI01BGAWGjqXxVRKjXlfdqXjsfIkH/lRRWKXJsYVOOffSr2ajC21Ty+kgcj6G/YVpRiVw7WV44VJttXDABnS2gB6M7wDwyoG59fhXhVCt0mHPa0EeNSHiVpXioBFKEi2ZZEve9D1fk1jpLWf/tFc9kkMlgof8cxZtwvP8Ut+iI73m50CP0OH690rdlvMperUyuP7iT2yOxktiwA3rOi42H5P1QhU9X9H2rczr1mxoB/5+m4zwP3aP31bU+ZHHOgwf0c5Ufje/lh+pP0Yp9dcliQ== Received: from SJ0PR03CA0010.namprd03.prod.outlook.com (2603:10b6:a03:33a::15) by IA1PR12MB8495.namprd12.prod.outlook.com (2603:10b6:208:44d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Fri, 12 Jul 2024 11:03:54 +0000 Received: from SJ5PEPF000001EC.namprd05.prod.outlook.com (2603:10b6:a03:33a:cafe::9f) by SJ0PR03CA0010.outlook.office365.com (2603:10b6:a03:33a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 11:03:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ5PEPF000001EC.mail.protection.outlook.com (10.167.242.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 11:03:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 04:03:44 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 04:03:41 -0700 From: Xueming Li To: Akhil Goyal CC: Ganapati Kundapura , dpdk stable Subject: patch 'test/crypto: fix enqueue/dequeue callback case' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 19:01:49 +0800 Message-ID: <20240712110153.309690-19-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712110153.309690-1-xuemingl@nvidia.com> References: <20240712104528.308638-1-xuemingl@nvidia.com> <20240712110153.309690-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EC:EE_|IA1PR12MB8495:EE_ X-MS-Office365-Filtering-Correlation-Id: 36ee93f2-7b3e-4cb1-1f5a-08dca26251ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/y5XPDgZqqz0/aUcmv/0+X66smK4S9ewOq2D+5vf5PMmHqNcSqN7r0R71Oqv?= =?us-ascii?Q?R3GyUNL0HDaKhJ7VWoqL9uGJMvPC611PeZgMBEyPsbx2x75UklByLTgBHDlf?= =?us-ascii?Q?6V6nXYXexIMjIjlgkXYiSD5lnjKYHn0okHyhqoPik0TGtiFoiqmFBq37phSw?= =?us-ascii?Q?E4CmKg2KjUOPZ+iGtYhD96MxGuw3qq12B3+nTKjIb43BZSIcOFil/L4C2dVt?= =?us-ascii?Q?e5zFzN0lVPcGn7gjEbQeZC+lMzmfZoM8WV0E5+EJJcC9a/c3/lPW21xi/mGj?= =?us-ascii?Q?Jm8jAxTOMSzXBUe9iLdG+Sa9SniKTCzLkZFBVY1+LGaSTI585FZfrfKsR2jA?= =?us-ascii?Q?ZOUIlG+9XaBHGMjpixgQF8PlLJX3CkM6EkkWsMeiehRxde/Dzz/K03LuYUml?= =?us-ascii?Q?jWcMBSti6gxdYYXw0KqWLGD3HKHudi7lUi9C0TmgBHAnmO8obMIPSdyVGcH9?= =?us-ascii?Q?7U8d+CFaaiAEm+djWr7C2JuIPEMZwnzjGabyhEOhunzxHOvrgASRDTyIhxAG?= =?us-ascii?Q?p1eGOMiGhViLh6YC8f/GoHWJGrJNRrdLOf5x0wzqX92/QKTrh572c8sejCgW?= =?us-ascii?Q?MD/goKP6BEv+QHmIRcTNx2eL3dL2FJwKEG80lE5P/5mdDHWdJwb1jh9+qG7g?= =?us-ascii?Q?HoFT5Rv/3OU+iCemDUoi1RO4fZV1AtxsxEkB3DbQm3PARTBJ9LunaolcmEvd?= =?us-ascii?Q?fPgFqURdUL5DTcOA/+mbB1PxeuZdYRfHQateXL/uG/hygoEtWGFBCV6vzWne?= =?us-ascii?Q?nAE6JGusGcdbAFL2s1f0wa0S6IdWHGXefzGbjaGvadAmC/VV/5tMHOFRwF+c?= =?us-ascii?Q?NeIYydxt7pBVeqlxiXR4DYU42o9S8ZJTp7/ysMfRzPbvl6beapHdFKRLcdpu?= =?us-ascii?Q?c9yB46KhIIcIA2NFuZ3L75zUZvpeo5SEDMzGx3hY1e/BoUDHmYn+Kw3jnn+g?= =?us-ascii?Q?d5WsmgVZ4nqUR6v0MxLXedUlgp33qdONJxF55l4BpCK/a+p37QaqXtqqGpkd?= =?us-ascii?Q?nc2tQaIzDFc8jD9d/41Lg8KSRRat/MVYzbOr7JUhf9Tzeupmvw4ANu5F4O7/?= =?us-ascii?Q?6s52/ZLUDdR/yQB5g2tL2zTJ4GZEM13z+xFGEX1bud5TRkqaRiuIcXue2ddQ?= =?us-ascii?Q?esy4aXiGK7JwwV+cqBQaSDd5wMrr2TCqM0jjpjQrtqbL2c88RzBVPukKQypV?= =?us-ascii?Q?t6k5BbmfHqsYSIZxU2NEYXgZw2VuB6IG0had6irFFElM6X0wba3fKrPQDlir?= =?us-ascii?Q?GSKWQC3T30q8PayLq0ea1B1vPcYJcmy2RWFPV4f3tBej92lzRTEst3dKHHjy?= =?us-ascii?Q?5hnZYKSg41IdOQEBXFyCA96YpZBu++C2hKGzV9pvVJDXJAQy6KrmweYfG4KW?= =?us-ascii?Q?KQgkSZBAT3iQNEEE6JiTpN40KNK5cjXWeRfguDYCPhVrBbV3BcquCrR/H0uW?= =?us-ascii?Q?5h5f3Owskv8xhXlhzc0rcDn/eodp0F98?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 11:03:54.4091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36ee93f2-7b3e-4cb1-1f5a-08dca26251ea X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8495 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 23.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f484d7d8b59d4d2f9e6f8a0ba4f4d23511ef2bfb Thanks. Xueming Li --- >From f484d7d8b59d4d2f9e6f8a0ba4f4d23511ef2bfb Mon Sep 17 00:00:00 2001 From: Akhil Goyal Date: Fri, 24 May 2024 22:43:27 +0530 Subject: [PATCH] test/crypto: fix enqueue/dequeue callback case Cc: Xueming Li [ upstream commit 4ad17a1c8fb336a182f2c1b62127d8871d45f804 ] The enqueue/dequeue callback test cases were using the test_null_burst_operation() for doing enqueue/dequeue. But this function is only designed to be run for NULL PMD. Hence for other PMDs, the callback was not getting called. Now, separate processing thread is removed, instead NULL crypto operation is created and processed so that callbacks are called. Also added a check on a global static variable to verify that the callback is actually called and fail the case if it is not getting called. Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue callbacks") Signed-off-by: Akhil Goyal Acked-by: Ganapati Kundapura --- app/test/test_cryptodev.c | 106 ++++++++++++++++++++++++++++++++------ 1 file changed, 89 insertions(+), 17 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 58561ededf..3464df22a1 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -196,6 +196,8 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, static struct crypto_testsuite_params testsuite_params = { NULL }; struct crypto_testsuite_params *p_testsuite_params = &testsuite_params; static struct crypto_unittest_params unittest_params; +static bool enq_cb_called; +static bool deq_cb_called; int process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, @@ -13540,6 +13542,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, RTE_SET_USED(ops); RTE_SET_USED(user_param); + enq_cb_called = true; printf("crypto enqueue callback called\n"); return nb_ops; } @@ -13553,21 +13556,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, RTE_SET_USED(ops); RTE_SET_USED(user_param); + deq_cb_called = true; printf("crypto dequeue callback called\n"); return nb_ops; } /* - * Thread using enqueue/dequeue callback with RCU. + * Process enqueue/dequeue NULL crypto request to verify callback with RCU. */ static int -test_enqdeq_callback_thread(void *arg) +test_enqdeq_callback_null_cipher(void) { - RTE_SET_USED(arg); - /* DP thread calls rte_cryptodev_enqueue_burst()/ - * rte_cryptodev_dequeue_burst() and invokes callback. - */ - test_null_burst_operation(); + struct crypto_testsuite_params *ts_params = &testsuite_params; + struct crypto_unittest_params *ut_params = &unittest_params; + + /* Setup Cipher Parameters */ + ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; + ut_params->cipher_xform.next = &ut_params->auth_xform; + + ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; + ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; + + /* Setup Auth Parameters */ + ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; + ut_params->auth_xform.next = NULL; + + ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL; + ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; + + /* Create Crypto session */ + ut_params->sess = rte_cryptodev_sym_session_create(ts_params->valid_devs[0], + &ut_params->auth_xform, ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); + + ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); + TEST_ASSERT_NOT_NULL(ut_params->op, "Failed to allocate symmetric crypto op"); + + /* Allocate mbuf */ + ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); + TEST_ASSERT_NOT_NULL(ut_params->ibuf, "Failed to allocate mbuf"); + + /* Append some random data */ + TEST_ASSERT_NOT_NULL(rte_pktmbuf_append(ut_params->ibuf, sizeof(unsigned int)), + "no room to append data"); + + rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess); + + ut_params->op->sym->m_src = ut_params->ibuf; + + /* Process crypto operation */ + TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0], ut_params->op), + "failed to process sym crypto op"); + return 0; } @@ -13575,6 +13615,7 @@ static int test_enq_callback_setup(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; + struct rte_cryptodev_sym_capability_idx cap_idx; struct rte_cryptodev_info dev_info; struct rte_cryptodev_qp_conf qp_conf = { .nb_descriptors = MAX_NUM_OPS_INFLIGHT @@ -13582,6 +13623,19 @@ test_enq_callback_setup(void) struct rte_cryptodev_cb *cb; uint16_t qp_id = 0; + int j = 0; + + /* Verify the crypto capabilities for which enqueue/dequeue is done. */ + cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; + cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL; + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], + &cap_idx) == NULL) + return TEST_SKIPPED; + cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; + cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL; + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], + &cap_idx) == NULL) + return TEST_SKIPPED; /* Stop the device in case it's started so it can be configured */ rte_cryptodev_stop(ts_params->valid_devs[0]); @@ -13605,6 +13659,7 @@ test_enq_callback_setup(void) qp_conf.nb_descriptors, qp_id, ts_params->valid_devs[0]); + enq_cb_called = false; /* Test with invalid crypto device */ cb = rte_cryptodev_add_enq_callback(RTE_CRYPTO_MAX_DEVS, qp_id, test_enq_callback, NULL); @@ -13637,12 +13692,11 @@ test_enq_callback_setup(void) rte_cryptodev_start(ts_params->valid_devs[0]); - /* Launch a thread */ - rte_eal_remote_launch(test_enqdeq_callback_thread, NULL, - rte_get_next_lcore(-1, 1, 0)); + TEST_ASSERT_SUCCESS(test_enqdeq_callback_null_cipher(), "Crypto Processing failed"); - /* Wait until reader exited. */ - rte_eal_mp_wait_lcore(); + /* Wait until callback not called. */ + while (!enq_cb_called && (j++ < 10)) + rte_delay_ms(10); /* Test with invalid crypto device */ TEST_ASSERT_FAIL(rte_cryptodev_remove_enq_callback( @@ -13667,6 +13721,8 @@ test_enq_callback_setup(void) "qp %u on cryptodev %u", qp_id, ts_params->valid_devs[0]); + TEST_ASSERT(deq_cb_called == true, "Crypto dequeue callback not called"); + return TEST_SUCCESS; } @@ -13674,6 +13730,7 @@ static int test_deq_callback_setup(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; + struct rte_cryptodev_sym_capability_idx cap_idx; struct rte_cryptodev_info dev_info; struct rte_cryptodev_qp_conf qp_conf = { .nb_descriptors = MAX_NUM_OPS_INFLIGHT @@ -13681,6 +13738,19 @@ test_deq_callback_setup(void) struct rte_cryptodev_cb *cb; uint16_t qp_id = 0; + int j = 0; + + /* Verify the crypto capabilities for which enqueue/dequeue is done. */ + cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; + cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL; + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], + &cap_idx) == NULL) + return TEST_SKIPPED; + cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; + cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL; + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], + &cap_idx) == NULL) + return TEST_SKIPPED; /* Stop the device in case it's started so it can be configured */ rte_cryptodev_stop(ts_params->valid_devs[0]); @@ -13704,6 +13774,7 @@ test_deq_callback_setup(void) qp_conf.nb_descriptors, qp_id, ts_params->valid_devs[0]); + deq_cb_called = false; /* Test with invalid crypto device */ cb = rte_cryptodev_add_deq_callback(RTE_CRYPTO_MAX_DEVS, qp_id, test_deq_callback, NULL); @@ -13736,12 +13807,11 @@ test_deq_callback_setup(void) rte_cryptodev_start(ts_params->valid_devs[0]); - /* Launch a thread */ - rte_eal_remote_launch(test_enqdeq_callback_thread, NULL, - rte_get_next_lcore(-1, 1, 0)); + TEST_ASSERT_SUCCESS(test_enqdeq_callback_null_cipher(), "Crypto processing failed"); - /* Wait until reader exited. */ - rte_eal_mp_wait_lcore(); + /* Wait until callback not called. */ + while (!deq_cb_called && (j++ < 10)) + rte_delay_ms(10); /* Test with invalid crypto device */ TEST_ASSERT_FAIL(rte_cryptodev_remove_deq_callback( @@ -13766,6 +13836,8 @@ test_deq_callback_setup(void) "qp %u on cryptodev %u", qp_id, ts_params->valid_devs[0]); + TEST_ASSERT(enq_cb_called == true, "Crypto enqueue callback not called"); + return TEST_SUCCESS; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:18.472830403 +0800 +++ 0098-test-crypto-fix-enqueue-dequeue-callback-case.patch 2024-07-12 18:40:14.356594197 +0800 @@ -1 +1 @@ -From 4ad17a1c8fb336a182f2c1b62127d8871d45f804 Mon Sep 17 00:00:00 2001 +From f484d7d8b59d4d2f9e6f8a0ba4f4d23511ef2bfb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4ad17a1c8fb336a182f2c1b62127d8871d45f804 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index f2d249f6b8..94438c587a 100644 +index 58561ededf..3464df22a1 100644 @@ -29 +31 @@ -@@ -199,6 +199,8 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, +@@ -196,6 +196,8 @@ post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, @@ -38 +40 @@ -@@ -14671,6 +14673,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, +@@ -13540,6 +13542,7 @@ test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, @@ -46 +48 @@ -@@ -14684,21 +14687,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, +@@ -13553,21 +13556,58 @@ test_deq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, @@ -112 +114 @@ -@@ -14706,6 +14746,7 @@ static int +@@ -13575,6 +13615,7 @@ static int @@ -120 +122 @@ -@@ -14713,6 +14754,19 @@ test_enq_callback_setup(void) +@@ -13582,6 +13623,19 @@ test_enq_callback_setup(void) @@ -140 +142 @@ -@@ -14736,6 +14790,7 @@ test_enq_callback_setup(void) +@@ -13605,6 +13659,7 @@ test_enq_callback_setup(void) @@ -148 +150 @@ -@@ -14768,12 +14823,11 @@ test_enq_callback_setup(void) +@@ -13637,12 +13692,11 @@ test_enq_callback_setup(void) @@ -165 +167 @@ -@@ -14798,6 +14852,8 @@ test_enq_callback_setup(void) +@@ -13667,6 +13721,8 @@ test_enq_callback_setup(void) @@ -169 +171 @@ -+ TEST_ASSERT(enq_cb_called == true, "Crypto enqueue callback not called"); ++ TEST_ASSERT(deq_cb_called == true, "Crypto dequeue callback not called"); @@ -174 +176 @@ -@@ -14805,6 +14861,7 @@ static int +@@ -13674,6 +13730,7 @@ static int @@ -182 +184 @@ -@@ -14812,6 +14869,19 @@ test_deq_callback_setup(void) +@@ -13681,6 +13738,19 @@ test_deq_callback_setup(void) @@ -202 +204 @@ -@@ -14835,6 +14905,7 @@ test_deq_callback_setup(void) +@@ -13704,6 +13774,7 @@ test_deq_callback_setup(void) @@ -210 +212 @@ -@@ -14867,12 +14938,11 @@ test_deq_callback_setup(void) +@@ -13736,12 +13807,11 @@ test_deq_callback_setup(void) @@ -227 +229 @@ -@@ -14897,6 +14967,8 @@ test_deq_callback_setup(void) +@@ -13766,6 +13836,8 @@ test_deq_callback_setup(void) @@ -231 +233 @@ -+ TEST_ASSERT(deq_cb_called == true, "Crypto dequeue callback not called"); ++ TEST_ASSERT(enq_cb_called == true, "Crypto enqueue callback not called");