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 9A1E5454AB; Thu, 20 Jun 2024 16:51:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EF0D42E7A; Thu, 20 Jun 2024 16:51:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 9013242E7E for ; Thu, 20 Jun 2024 16:51:19 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45KCTgvF011177; Thu, 20 Jun 2024 07:51:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=F o5zPhj6tWar6ZlTL7tHVYHAwyS9gHq3MJtp40J2fxc=; b=GS10QQq0DSYg3wOUO 7zZnT1tzDMvHZcIWi3YS3iSQPeUL4Zlt8uv25UMhC45G/qfVKjtgDgnmylp7bsG+ ec/6laEv97v5Y+XAgUzM48VNZLdh4WGIcAFbZYtLejfFLh/dsgzWTsTAAmBDZhTM qqxwE1OUDZPLf57pkdr7gEZiDIbKdlRzctH4DOalxOzD3kZmROwmqAOt5FQABKbe qcUYZEgmjApcikg6wIZrknrLAVRFhSfHel6aM/zQBlUKYfDHjx4uRV8IvZUutFKc /ntkYIrNzFesyI5HD80HK9f4UgfFvIvMHOOpidsOv6RNYIN4bT+CDso7qcZ+ES2G ZxPmA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yvbdyajxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Jun 2024 07:51:18 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 20 Jun 2024 07:51:17 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 20 Jun 2024 07:51:17 -0700 Received: from localhost.localdomain (unknown [10.28.36.177]) by maili.marvell.com (Postfix) with ESMTP id E46763F708C; Thu, 20 Jun 2024 07:51:14 -0700 (PDT) From: Aakash Sasidharan To: Akhil Goyal , Fan Zhang CC: , , , , Subject: [PATCH v2 6/7] test/security: add out of place sgl tests for TLS Date: Thu, 20 Jun 2024 20:20:55 +0530 Message-ID: <20240620145056.3456650-7-asasidharan@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240620145056.3456650-1-asasidharan@marvell.com> References: <20240617055841.2359729-1-asasidharan@marvell.com> <20240620145056.3456650-1-asasidharan@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: LMHawNh5ZzMbX1e1rk40GGlLXwhcwIqa X-Proofpoint-GUID: LMHawNh5ZzMbX1e1rk40GGlLXwhcwIqa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-20_07,2024-06-20_04,2024-05-17_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add multi segmented test for TLS 1.3 and multi segmented out of place tests for DTLS 1.2 and TLS 1.3. Signed-off-by: Aakash Sasidharan --- app/test/test_cryptodev.c | 69 ++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index dd8880ed87..e6ef5a13e0 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -12224,11 +12224,11 @@ test_tls_1_2_record_proto_display_list(void) } static int -test_tls_1_2_record_proto_sgl(void) +test_tls_record_proto_sgl(enum rte_security_tls_version tls_version) { struct tls_record_test_flags flags = { .nb_segs_in_mbuf = 5, - .tls_version = RTE_SECURITY_VERSION_TLS_1_2 + .tls_version = tls_version }; struct crypto_testsuite_params *ts_params = &testsuite_params; struct rte_cryptodev_info dev_info; @@ -12242,6 +12242,12 @@ test_tls_1_2_record_proto_sgl(void) return test_tls_record_proto_all(&flags); } +static int +test_tls_1_2_record_proto_sgl(void) +{ + return test_tls_record_proto_sgl(RTE_SECURITY_VERSION_TLS_1_2); +} + static int test_tls_record_proto_sgl_data_walkthrough(enum rte_security_tls_version tls_version) { @@ -12573,20 +12579,7 @@ test_dtls_1_2_record_proto_antireplay4096(void) static int test_dtls_1_2_record_proto_sgl(void) { - struct tls_record_test_flags flags = { - .nb_segs_in_mbuf = 5, - .tls_version = RTE_SECURITY_VERSION_DTLS_1_2 - }; - struct crypto_testsuite_params *ts_params = &testsuite_params; - struct rte_cryptodev_info dev_info; - - rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { - printf("Device doesn't support in-place scatter-gather. Test Skipped.\n"); - return TEST_SKIPPED; - } - - return test_tls_record_proto_all(&flags); + return test_tls_record_proto_sgl(RTE_SECURITY_VERSION_DTLS_1_2); } static int @@ -12595,6 +12588,12 @@ test_dtls_1_2_record_proto_sgl_data_walkthrough(void) return test_tls_record_proto_sgl_data_walkthrough(RTE_SECURITY_VERSION_DTLS_1_2); } +static int +test_dtls_1_2_record_proto_sgl_oop(void) +{ + return test_tls_record_proto_sgl_oop(RTE_SECURITY_VERSION_DTLS_1_2); +} + static int test_dtls_1_2_record_proto_corrupt_pkt(void) { @@ -12811,23 +12810,21 @@ test_tls_1_3_record_proto_data_walkthrough(void) } static int -test_tls_1_3_record_proto_sgl_data_walkthrough(void) +test_tls_1_3_record_proto_sgl(void) { - struct tls_record_test_flags flags = { - .nb_segs_in_mbuf = 5, - .tls_version = RTE_SECURITY_VERSION_TLS_1_3, - .data_walkthrough = true - }; - struct crypto_testsuite_params *ts_params = &testsuite_params; - struct rte_cryptodev_info dev_info; + return test_tls_record_proto_sgl(RTE_SECURITY_VERSION_TLS_1_3); +} - rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { - printf("Device doesn't support in-place scatter-gather. Test Skipped.\n"); - return TEST_SKIPPED; - } +static int +test_tls_1_3_record_proto_sgl_data_walkthrough(void) +{ + return test_tls_record_proto_sgl_data_walkthrough(RTE_SECURITY_VERSION_TLS_1_3); +} - return test_tls_record_proto_all(&flags); +static int +test_tls_1_3_record_proto_sgl_oop(void) +{ + return test_tls_record_proto_sgl_oop(RTE_SECURITY_VERSION_TLS_1_3); } #endif @@ -18145,6 +18142,10 @@ static struct unit_test_suite dtls12_record_proto_testsuite = { "Multi-segmented mode data walkthrough", ut_setup_security, ut_teardown, test_dtls_1_2_record_proto_sgl_data_walkthrough), + TEST_CASE_NAMED_ST( + "Multi-segmented mode out of place", + ut_setup_security, ut_teardown, + test_dtls_1_2_record_proto_sgl_oop), TEST_CASE_NAMED_ST( "Packet corruption", ut_setup_security, ut_teardown, @@ -18286,10 +18287,18 @@ static struct unit_test_suite tls13_record_proto_testsuite = { "Data walkthrough combined test alg list", ut_setup_security, ut_teardown, test_tls_1_3_record_proto_data_walkthrough), + TEST_CASE_NAMED_ST( + "Multi-segmented mode", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_sgl), TEST_CASE_NAMED_ST( "Multi-segmented mode data walkthrough", ut_setup_security, ut_teardown, test_tls_1_3_record_proto_sgl_data_walkthrough), + TEST_CASE_NAMED_ST( + "Multi-segmented mode out of place", + ut_setup_security, ut_teardown, + test_tls_1_3_record_proto_sgl_oop), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.25.1