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 6BD83A0C47; Thu, 7 Oct 2021 14:46:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 274E3411D7; Thu, 7 Oct 2021 14:46:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D7FA9411CD for ; Thu, 7 Oct 2021 14:46:52 +0200 (CEST) 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 SMTP id 1977TRmg012033; Thu, 7 Oct 2021 05:46:52 -0700 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by mx0a-0016f401.pphosted.com with ESMTP id 3bhvj2s75n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Oct 2021 05:46:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XmlIzgwUq0HEqGPbIwcmBfpkrSjQFduA7JqvMfX21/bhCc/BcLT3+eXfS3JzzTUju5SKtRPqLholRBBFQr9P6Wkh2ec7B+m0ma3WR+Xmaf68WjgZlqMh6g0CzLYVGHDSN0PigA4KAjdtHSoBQJNZBioczCe6AFkN3RqzfnZ29qSlURoja2xl1X2mXd/TEG0m2DpPFxV+6fbX9GlqVRrLwNz2kTzLgrIhhmsdKwsaeNoNFWXU8py6M8bhSEi4uiJ9bfO4c9Ulp3gfSOKzyA5GBJm2IxqTqOiiw3KgPUOUV386yy5irwN8CYNNoX5lX5kYWmmXSbkAmhbSO5bGr8Jtaw== 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=dl2N9AmzhzbIOpi0EwYNohoHB9GhQLl1otq5Mf0d43k=; b=iPNHWHw5uyLS8/4GvbVrceALkfy/5a+TA2vTIL7Fk+XZwA5qYDC0EqZhCMHA9wwQFRQUNn4OcR19PytkxpckA5VoZtz4eymzXJiheQNFFxhMoVo4vMxZM6m4cSY3dMdYIUvHi+X0mGym4FyZ4IkOvoO0rRDo/a1moMonykwHNE5RJ6TzdH4081LYnee2UJKsiBhZAW03SgYac3eM7AqJGDAU5nfkC5l3yNwWFilm19tn/s4VnLPm6sgHtE0qZfgMsFplelRXbU/jAvedfq203EdDTQMk8OOEUwD85KO8l2w4GSrWO0kpiCl4OWv1TwSgwqYJJC113GQYgwvjFnosxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dl2N9AmzhzbIOpi0EwYNohoHB9GhQLl1otq5Mf0d43k=; b=K6rCQnvv8PeiwK58lcEdXi/MfTk1/Q00RqW5j1mNjs6YVv3HjL6u0VUxUc3YANT5uVMN602CFzCioAhG13XTK471YVminZtcqP78DBAK9IYv3mI3z4gTl9qtE9vgoKqg+j1XkJ6Zhc+e4KyiBRMmpkN561XDTY1tBCzwKYLZovA= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4539.namprd18.prod.outlook.com (2603:10b6:303:fe::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Thu, 7 Oct 2021 12:46:49 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%6]) with mapi id 15.20.4566.023; Thu, 7 Oct 2021 12:46:49 +0000 From: Akhil Goyal To: Kai Ji , "dev@dpdk.org" CC: "roy.fan.zhang@intel.com" , "hemant.agrawal@nxp.com" , "g.singh@nxp.com" Thread-Topic: [EXT] [dpdk-dev] [dpdk-dev v1] test/crypto: maxlen calculation update Thread-Index: AQHXtUgQrGFqn8teT0GpQiKHeUSyd6vHh6rA Date: Thu, 7 Oct 2021 12:46:49 +0000 Message-ID: References: <20210929153809.69039-1-kai.ji@intel.com> In-Reply-To: <20210929153809.69039-1-kai.ji@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 664dc72a-18b6-47fe-3b7d-08d9899087bb x-ms-traffictypediagnostic: CO1PR18MB4539: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JxWPqQhQ/6B63WYqACDSHYU5oFFSfsjDIFCA4PL9JPzcJ5rxiIBN5CCdD1ZdT/oI360XVl6wn8hpXjdpSSAqgMG/7wKFZ9BrsvvfRCuyJ2+Di01e+FHvPvvnXlWFmR32qoQmo9twxHMQ+QfWF1rJ8TQ/jn2Z/LRDZzpL1X4Ump1cDt/qUd70/jjIKqqgR2FygBMlNnZNtwyGt9a04VKyFndoPkSN+pJFsI7TpqViqz0UcELlc1PbiTZIKyoDEfUkhS+QM28M1lhIzHGnmBfkxVPs4a057LIl3jsS9zdu+RRh5IiW4bClt3n7+NzwiKPoLqCQQrYRRqt0IcLqo+wL96Nm5+04J2vWUIbWZxFnl24Dp8TUMCua81EHQCF/eXT5Gwa1LTut5wcLBpKZ7JaxD+Huzdp2jNmgSA2oOFZI5d7Ff61bMH1aKbcJgzEtCl8uoR4ElRXotAZUGkTj6+fOjsh6wXypEzieRf2I2sqinknMNLKe/HTCTBD5Ufn3D381hl925+9qKfJqp07pDPWH6uvl364CY5GDa+cuSIcaJBSsT1wcV5M6RlQ0n5yHLS5TB1byAnbvmXZf9isZW1C5NMM39wIWYwaJvolP7OuITNVOUJnftUucZU04hK5fEdmu+by9GPyZuT8b8dmwko5o6QkZ7RJtu0Y2+23JXyRF/ufITf6ZfDY7VB+/aA2ynXYWGb3zA/CVaU2VNEzeuhRIDojXoTyGkYieLbjIYWvjhehGG7y3t/ldg1Wmuu+TQOQ4shb1d4yXzh0L/PDt+Fs3FZYIUyP2G8zi8K0aC964b6o= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(38070700005)(15650500001)(38100700002)(186003)(52536014)(122000001)(7696005)(2906002)(66476007)(66556008)(5660300002)(6506007)(8676002)(66946007)(55236004)(71200400001)(26005)(83380400001)(8936002)(66446008)(316002)(110136005)(966005)(508600001)(64756008)(55016002)(54906003)(33656002)(86362001)(76116006)(9686003)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9M8fjwVLKP7DH7OVUnl/JUYsR9tOBCSC1YSte+iKzNxqrjBPslZT2lFuEgvg?= =?us-ascii?Q?/E3TDZ68UpsMXoUgoYUdFsMht7xKgnaOxXBjfho0HbwNTW9J8SvuzlFq0t/+?= =?us-ascii?Q?/Ww2pOCbHvG1skTxph3ypGS19wbkg0BzRQp8AwSC1XgMoqybQXnT1S9sgYhw?= =?us-ascii?Q?gNmM5igomaxfn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b/TRNy?= =?us-ascii?Q?zyNAIFzLqZq6OGo78kpWd1p3jzNFljp/6teKgX7i0i224+fWu2FJpg25OOyI?= =?us-ascii?Q?38kuBcW8LpiBtpZQoG7vhZ1mIDp2BPbc/DIx5cQ9FYxihkEk6dmqjHF8sKvc?= =?us-ascii?Q?85qFv8rinhcfH8csErVmKH4K0NEZkfZFS31rD2liCoHL6Khb6Sb1oIcEwW1h?= =?us-ascii?Q?YNu5m/u7rc8Sti/Ju1gWOuQBYDOfg9SrJ6LOSTp2YV+FdwJIe/C5kPb1vyDs?= =?us-ascii?Q?ob0SmXBxuKjuWvapm+Py6Sp6?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 664dc72a-18b6-47fe-3b7d-08d9899087bb X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 12:46:49.3971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UYWyY7Rmq5g3kdnF+O/TA6c9gvNkdBWnoOzriDSeuccJeWG6cDedVymdeNWZBBsThWKPRlQh2ACCo1ddcl/DNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4539 X-Proofpoint-ORIG-GUID: g6mX3AZFlkW3EayrnZPiyn8UYfJgp9BX X-Proofpoint-GUID: g6mX3AZFlkW3EayrnZPiyn8UYfJgp9BX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-07_01,2021-10-07_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [dpdk-dev v1] test/crypto: maxlen calculation update 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 Sender: "dev" > Update the calculation of the max length needed when converting mbuf to > data vec in partial digest test case. This update make sure the enough > vec buffers are allocated for the appended digest in sgl op for QAT raw > datapath api. >=20 > Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API") > Cc: roy.fan.zhang@intel.com >=20 > Signed-off-by: Kai Ji > --- > app/test/test_cryptodev.c | 35 +++++++++++++++++++++++++++++++---- > 1 file changed, 31 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 16d770a17f..ea46911648 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -167,6 +167,10 @@ post_process_raw_dp_op(void *user_data, > uint32_t index __rte_unused, > RTE_CRYPTO_OP_STATUS_ERROR; > } >=20 > +static struct crypto_testsuite_params testsuite_params =3D { NULL }; > +struct crypto_testsuite_params *p_testsuite_params =3D &testsuite_params= ; > +static struct crypto_unittest_params unittest_params; > + > void > process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, > struct rte_crypto_op *op, uint8_t is_cipher, uint8_t is_auth, > @@ -181,6 +185,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t > qp_id, > struct rte_crypto_sgl sgl; > uint32_t max_len; > union rte_cryptodev_session_ctx sess; > + uint64_t auth_end_iova; > uint32_t count =3D 0; > struct rte_crypto_raw_dp_ctx *ctx; > uint32_t cipher_offset =3D 0, cipher_len =3D 0, auth_offset =3D 0, > @@ -190,6 +195,9 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t > qp_id, > int ctx_service_size; > int32_t status =3D 0; > int enqueue_status, dequeue_status; > + struct crypto_unittest_params *ut_params =3D &unittest_params; > + /* oop is not supported in raw hw dp api*/ > + int is_sgl =3D sop->m_src->nb_segs > 1; There is a patch series pending to be merged which support oop in raw dp ap= i. Can we sync this patch based on that? https://patchwork.dpdk.org/project/dpdk/patch/20210907075957.28848-4-hemant= .agrawal@nxp.com/ >=20 > ctx_service_size =3D rte_cryptodev_get_raw_dp_ctx_size(dev_id); > if (ctx_service_size < 0) { > @@ -255,6 +263,29 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t > qp_id, > digest.va =3D (void *)sop->auth.digest.data; > digest.iova =3D sop->auth.digest.phys_addr; >=20 > + if (is_sgl) { > + uint32_t remaining_off =3D auth_offset + auth_len; > + struct rte_mbuf *sgl_buf =3D sop->m_src; > + > + while (remaining_off >=3D > rte_pktmbuf_data_len(sgl_buf) > + && sgl_buf->next !=3D NULL) { > + remaining_off -=3D > rte_pktmbuf_data_len(sgl_buf); > + sgl_buf =3D sgl_buf->next; > + } > + > + auth_end_iova =3D (uint64_t)rte_pktmbuf_iova_offset( > + sgl_buf, remaining_off); > + } else { > + /* oop is not supported in raw hw dp api */ > + auth_end_iova =3D rte_pktmbuf_iova(op->sym->m_src) > + > + auth_offset + > auth_len; > + } > + /* Then check if digest-encrypted conditions are met */ > + if ((auth_offset + auth_len < cipher_offset + cipher_len) && > + (digest.iova =3D=3D auth_end_iova) && is_sgl) > + max_len =3D RTE_MAX(max_len, auth_offset + > auth_len + > + ut_params->auth_xform.auth.digest_length); > + > } else if (is_cipher) { > cipher_offset =3D sop->cipher.data.offset; > cipher_len =3D sop->cipher.data.length; > @@ -477,10 +508,6 @@ process_crypto_request(uint8_t dev_id, struct > rte_crypto_op *op) > return op; > } >=20 > -static struct crypto_testsuite_params testsuite_params =3D { NULL }; > -struct crypto_testsuite_params *p_testsuite_params =3D &testsuite_params= ; > -static struct crypto_unittest_params unittest_params; > - > static int > testsuite_setup(void) > { > -- > 2.17.1