From patchwork Mon Dec 6 07:58:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 104886 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 738D5A034F; Mon, 6 Dec 2021 09:00:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6F2E411CE; Mon, 6 Dec 2021 09:00:12 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5A497411B8 for ; Mon, 6 Dec 2021 09:00:11 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1B5Kt1uP010600; Mon, 6 Dec 2021 00:00:10 -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=FypFZT/WcdUTpRGSmXSjZRMUna70/9YtNYomf3zPC9c=; b=TzKInoOVhMsHc1hKzLO2gQdaS8KJrqDhCGTSFO+GRdrYLDwy2Y1v8l4gMfKJpax7ZcEX GFUbBoC3cysQByfs7/mD7tnHe7r0mTJOnpTbtu9IzyC/ujBK8696pDoTFwTMTqBDGW+m rHVuUrqFusYpLny0fQSfe527FVabTSmsky5aYknHlx9ndKdBniIrH4tq9Ydn85T+iRgw kzJU9VVlNOAB2PIlLHESJiAWw6o0ExE7NW/6DKvPg2dAQiDbRYwnmUesxNcluGCmWgBc Q0p5YXyVj0CmKJQnLKpyYGQyzC7nMSzUsj2i8i2RqciLES2VoiBLtpJrPnffQl0j5jG7 qQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cs0qn2753-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 00:00:10 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 6 Dec 2021 00:00:08 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 6 Dec 2021 00:00:08 -0800 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id D4D503F70C9; Mon, 6 Dec 2021 00:00:04 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Declan Doherty , Fan Zhang , "Pablo de Lara" CC: Tejasree Kondoj , Jerin Jacob , Archana Muniganti , Hemant Agrawal , Radu Nicolau , Ciara Power , Gagandeep Singh , Subject: [PATCH 10/13] test/crypto: add fragmented packet case Date: Mon, 6 Dec 2021 13:28:45 +0530 Message-ID: <1638777528-553-11-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1638777528-553-1-git-send-email-anoobj@marvell.com> References: <1638777528-553-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 8LNIfnkvzJSd11-SyjHW9fSsyvZT1EHO X-Proofpoint-ORIG-GUID: 8LNIfnkvzJSd11-SyjHW9fSsyvZT1EHO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-06_03,2021-12-06_01,2021-12-02_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 From: Tejasree Kondoj Add fragmented plain packet test case in combined mode. Signed-off-by: Tejasree Kondoj --- app/test/test_cryptodev.c | 16 ++++++++++++++++ app/test/test_cryptodev_security_ipsec.c | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 34bc3e0..744eb9f 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -9670,6 +9670,18 @@ test_ipsec_proto_stats(const void *data __rte_unused) } static int +test_ipsec_proto_pkt_fragment(const void *data __rte_unused) +{ + struct ipsec_test_flags flags; + + memset(&flags, 0, sizeof(flags)); + + flags.fragment = true; + + return test_ipsec_proto_all(&flags); +} + +static int test_PDCP_PROTO_all(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; @@ -14677,6 +14689,10 @@ static struct unit_test_suite ipsec_proto_testsuite = { "Statistics: success", ut_setup_security, ut_teardown, test_ipsec_proto_stats), + TEST_CASE_NAMED_ST( + "Fragmented packet", + ut_setup_security, ut_teardown, + test_ipsec_proto_pkt_fragment), TEST_CASES_END() /**< NULL terminate unit test array */ } }; diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c index 6fa1d3d..832f9d8 100644 --- a/app/test/test_cryptodev_security_ipsec.c +++ b/app/test/test_cryptodev_security_ipsec.c @@ -418,6 +418,13 @@ test_ipsec_td_prepare(const struct crypto_param *param1, if (flags->stats_success) td->ipsec_xform.options.stats = 1; + if (flags->fragment) { + struct rte_ipv4_hdr *ip; + ip = (struct rte_ipv4_hdr *)&td->input_text.data; + ip->fragment_offset = 4; + ip->hdr_checksum = rte_ipv4_cksum(ip); + } + } }