From patchwork Thu Dec 7 13:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 134926 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49E2743699; Thu, 7 Dec 2023 14:04:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3962B42EF1; Thu, 7 Dec 2023 14:03:07 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D31B542EF1 for ; Thu, 7 Dec 2023 14:03:05 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B79PG3B032040; Thu, 7 Dec 2023 05:03:05 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=rqnepvuZqbVSPRe5AeYlqxxetx/prT86J2i14at4mXs=; b=eICEiMZayaelOqhMjETviVn8OYwDYOrivb60gq3yK1jWddDPdWnxEap4BAiBYDEN4B+N Ptzb1hbu0KELTwVIXes/JYKrHKL6A8IIZGe9m+pduphspPJf7GPBYg0fri09wzg8jBVR 4gH11yvJsQDkTsQYtoj47gN6vbtCJlfSsyGH5z1DbtpinWgszJLqnZNqKkI4Z8oTpoGi o6qXbs/f/aU8Wmv4czXpTYsajAiJ0parX8JYQ9ZZ2h10ZGvvAR3bvI2PdM4goeFjaBCT xxIVMYuieKeJ8wbAYPG1fLR65EATFwbpJlb8NiJssD2yl9nfUU96VErQFkH4WVUlSFRK 7Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uubdd8n7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 05:03:05 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 7 Dec 2023 05:03:03 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 7 Dec 2023 05:03:03 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.163.189]) by maili.marvell.com (Postfix) with ESMTP id 99DCF3F70B2; Thu, 7 Dec 2023 05:02:59 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Tejasree Kondoj , Harry van Haaren , Hemant Agrawal , Konstantin Ananyev , , "Vidya Sagar Velumuri" Subject: [PATCH 14/14] test/crypto: add multi segmented cases Date: Thu, 7 Dec 2023 18:32:16 +0530 Message-ID: <20231207130216.140-15-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231207130216.140-1-anoobj@marvell.com> References: <20231207130216.140-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: _9d9aNtVvEOCdYrO4TO4oUvpXNrvbdZ2 X-Proofpoint-GUID: _9d9aNtVvEOCdYrO4TO4oUvpXNrvbdZ2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-07_10,2023-12-07_01,2023-05-22_02 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 From: Tejasree Kondoj Add multi segmented buffer test cases in TLS suites. Signed-off-by: Tejasree Kondoj Signed-off-by: Vidya Sagar Velumuri --- app/test/test_cryptodev.c | 29 ++++++++++++++++++- app/test/test_cryptodev_security_tls_record.h | 1 + doc/guides/rel_notes/release_24_03.rst | 4 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 86e2ccd483..b208cca4e2 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -11699,6 +11699,7 @@ test_tls_record_proto_process(const struct tls_record_test_data td[], struct tls_record_test_data res_d[], int nb_td, bool silent, const struct tls_record_test_flags *flags) { + int nb_segs = flags->nb_segs_in_mbuf ? flags->nb_segs_in_mbuf : 1; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; struct rte_security_tls_record_xform tls_record_xform; @@ -11801,7 +11802,7 @@ test_tls_record_proto_process(const struct tls_record_test_data td[], for (i = 0; i < nb_td; i++) { /* Setup source mbuf payload */ ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, td[i].input_text.len, - 1, 0); + nb_segs, 0); pktmbuf_write(ut_params->ibuf, 0, td[i].input_text.len, td[i].input_text.data); /* Generate crypto op data structure */ @@ -11958,6 +11959,24 @@ test_tls_record_proto_display_list(void) return test_tls_record_proto_all(&flags); } +static int +test_tls_record_proto_sgl(void) +{ + struct tls_record_test_flags flags = { + .nb_segs_in_mbuf = 5 + }; + 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); +} + #endif static int @@ -16956,6 +16975,10 @@ static struct unit_test_suite tls12_record_proto_testsuite = { "Combined test alg list", ut_setup_security, ut_teardown, test_tls_record_proto_display_list), + TEST_CASE_NAMED_ST( + "Multi-segmented mode", + ut_setup_security, ut_teardown, + test_tls_record_proto_sgl), TEST_CASES_END() /**< NULL terminate unit test array */ } }; @@ -17053,6 +17076,10 @@ static struct unit_test_suite dtls12_record_proto_testsuite = { "Combined test alg list", ut_setup_security, ut_teardown, test_tls_record_proto_display_list), + TEST_CASE_NAMED_ST( + "Multi-segmented mode", + ut_setup_security, ut_teardown, + test_tls_record_proto_sgl), TEST_CASES_END() /**< NULL terminate unit test array */ } }; diff --git a/app/test/test_cryptodev_security_tls_record.h b/app/test/test_cryptodev_security_tls_record.h index 82a1776265..0bd83f88f0 100644 --- a/app/test/test_cryptodev_security_tls_record.h +++ b/app/test/test_cryptodev_security_tls_record.h @@ -55,6 +55,7 @@ struct tls_record_test_data { struct tls_record_test_flags { bool display_alg; + int nb_segs_in_mbuf; }; extern struct tls_record_test_data tls_test_data_aes_128_gcm_v1; diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index e9c9717706..0d226e9644 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added TLS record test suite.** + + Added a new test suite in cryptodev autotest framework to test TLS record + security offload by supported cryptodevs. Removed Items -------------