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 A417BA0C47; Thu, 7 Oct 2021 15:55:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B68841214; Thu, 7 Oct 2021 15:55:03 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id DEE4E41212 for ; Thu, 7 Oct 2021 15:55:00 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="287139745" X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="287139745" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 06:54:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="657393018" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2021 06:54:59 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 06:54:58 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 7 Oct 2021 06:54:58 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 06:54:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJ0BHfbwB5Yreo5ugTAypBUY98DfcL5eHhecf35lZyuzKAcTASwPL0efmA7y+KdnkeakvcFQ6UE8EWHPuH2ZCrW7poeLF3WIDnls8dWcTZlu1h/BqISGtYier7P4suGOxOUrxLNXSWmigPeH7YxFwviUWt4ZJtb2lzC4NQVUDWjImbY9FUHg11WGUVjw+S/cn6hJVGqt1gUODBCjHV13FcsMwwKpMcRbRISoHezXs8L6KWbGkJV8qJ1OmXQ37Nw5agYZQ32ayZezgWJ2IKfGx6z/51VXOacrDb3c+wTMRVDP97qkjuI61cygAlvgjAmn3FO+4+frwGZ9c3gZK0oomQ== 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=2UTl68+n42++7gqpYEmybQn876FwYh3fS+SEc9LRACg=; b=nPlgN+7llg+qPDmjjrBTl1HH26l2cQZ06cKo9N02HJGxusHVKCPOVmerezbom84T7f+Pl82U7xTNUJZYZN4iHwbW32WvoleOkyI2H3byStvol1LLj0uf225EBxzyHxNWB4hzb55ezI0BxDTgw9NiCptMdqgA1Y9yrPW3blMMyBsLZUp0g3bI6as9SqVDQoQe5uzF0iPvK9KHJG3MITzLlcgNfiEx2OZo+ZrJJFF4S1Ub+T28kYepX6hAwFpjpSAkwp2urOZ1VY2Cq6zEAiXgbXLIctazQ49hdQxdiVf5xMc16ax8gpDI9kEkRI1PmhzYNV9nKYvowYHJq8k4g8NIVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2UTl68+n42++7gqpYEmybQn876FwYh3fS+SEc9LRACg=; b=Kc0+1r7EPi1VW/0rMKPXthkQ+8bI+vDa5IW0bc5PcNT/axARrZxNt/BvnPBKUm7QZy/eo5OJcwNt0I26qNR905NUGIZ8PNv2tbL+Mp4EtMiEzLllvpP66PwD3K1NGlKlS7qK7I+aCl50jMlFV7XS0AAZcYJzXQ5+nWuc1hrUZYA= Received: from CY4PR11MB1718.namprd11.prod.outlook.com (2603:10b6:903:2c::23) by CY4PR11MB1846.namprd11.prod.outlook.com (2603:10b6:903:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Thu, 7 Oct 2021 13:54:56 +0000 Received: from CY4PR11MB1718.namprd11.prod.outlook.com ([fe80::d46b:339a:9056:1122]) by CY4PR11MB1718.namprd11.prod.outlook.com ([fe80::d46b:339a:9056:1122%5]) with mapi id 15.20.4587.020; Thu, 7 Oct 2021 13:54:56 +0000 From: "Zhang, Roy Fan" To: Akhil Goyal , "Ji, Kai" , "dev@dpdk.org" CC: "hemant.agrawal@nxp.com" , "g.singh@nxp.com" Thread-Topic: [EXT] [dpdk-dev] [dpdk-dev v1] test/crypto: maxlen calculation update Thread-Index: AQHXtUgLyaseKHs+gUiv91CldvbILqvHiDmAgAAQRtA= Date: Thu, 7 Oct 2021 13:54:56 +0000 Message-ID: References: <20210929153809.69039-1-kai.ji@intel.com> In-Reply-To: Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6e9a5ad0-6bd7-41c7-679c-08d9899a0b97 x-ms-traffictypediagnostic: CY4PR11MB1846: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dsANA6Te/EM4g7Oi7CLFattRByJXQLsLbFSK4Xlwdx/Dr5vVPTNY7W3c1XATig7BzGLENQF0TEIGxXorfzOQ/SaomvlBihESuRP/0naSdsJTsn0pJxibT57jZ/pyJ350Sgu/5jjRWtThlmNuuFjw/PaTKLsm4DekYlV8WWaXEH11BrotRr05cG7t4F87+2XZ1V+DHUmWmhuk0qrwPN3c499gRgosxd/C8DDxHNNK8qRGjT6QLg73/PQdvBMEm8GbUiW5CBWmeuzGIwS/4Wgui35L/6e1XgnVtnvKzNeP+PetGVR84O2Z5HRhVZbDA6rMnGYkKLwjzZkhxy74kv3Et3VNbtHnFTmvkedercAhmmV7fim5Ss+jK3h0qZDLdiML/oPwb8CHo8Crht5UQs1lQSIOdNcQf/dd1AFlFSSXZpjby1nEE63yOXQNjEgVtFZc03roVQ38BPBYUEcoScWcp9tzPVMwloWbpngMU7GpwQoXPrNgEJdNiZAKIxjdoYnu9T7VDU5jPGQ3ho6HZSTY4PU/y570QZiKeLzfcYsHfFJxkyZTO031iJDbTJA1kMrIA59vFsRFhvZtxRqDaN6RQr+/l5c8pVMzli9pZVgC0q8lL9gGcLUp2xD6UKJXerGC/NR+Fyb3GC6Ib56oX+ng0AAxiHe2RZtKyc9qYvtwy+Sp2o1Agb+ENrX/6DePUof24UMq3vMmigKoJX0e1PXOFESsTLGKFtBLY53eJzoXN/bp29unMaDGMRT+twr6l3dE0FWB8XBSPDLbztyC5Te3TzDfcu/fKbUPIVjmDvZp5Ro/eONCgxvvjKUQmqhS57qTNtBNh+jsg8aORWJ9CndQfg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8936002)(5660300002)(86362001)(33656002)(55016002)(38100700002)(316002)(966005)(83380400001)(122000001)(53546011)(6506007)(110136005)(54906003)(186003)(508600001)(52536014)(26005)(9686003)(66946007)(66556008)(64756008)(4326008)(66476007)(66446008)(2906002)(8676002)(76116006)(71200400001)(15650500001)(38070700005)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?S71YzJ5erB+V7rtZHw8Li6/dLFHiYg3witmZ2VHPFlnP/nnyl9TLiDH8?= =?Windows-1252?Q?KyCdGzz75uFP+HRGkfNzlZH04oTYUblVwVnWNDlvbBaRdYZS6SugvGYs?= =?Windows-1252?Q?FHXmnKHexbffkAkLEcYSUo7hk+FyNe4RRJf53mB131C3UgPnFfsp2y6R?= =?Windows-1252?Q?/LlOjQ+Jfyks3tUnMFwug5Q9jYdfYk7iFDhlFyqjyoYGeNPRWT6LVo9i?= =?Windows-1252?Q?f3tgV1whyh+aBi1qWux5Nu1zG3Le8rMuXW5OtPetVvrXXhFfBo9lidpx?= =?Windows-1252?Q?rQzt4z70/eSRBMG3izNMoTarOB81wbbo08Q8dTeKw06X619NeGWeD46Z?= =?Windows-1252?Q?QTR6Zi2u8Rzxr8K72i4ybetba2MJb/wSMvt9JvI3TUPdtYP+Rb3O2Zqm?= =?Windows-1252?Q?YrfzgUp+4oSbDM3xJ827WsE/Dt3F+91CjU3VxLxYV2659PkerRCTo0XD?= =?Windows-1252?Q?1yfYYlucAXT/LxDeN2b0CixmZXCSlQ/61vQiW1W8I8F+ecjS0n1oLCTm?= =?Windows-1252?Q?eUGvBBW/SlVhg60GzKrEvYLLP3FWuwKN88RXUkaD1AAHWdUYAUu/iqVe?= =?Windows-1252?Q?8gOt3dwXHnzjvEngtSmI5JlB2OS74pfVvWb2xC/kVAtmX6wqBtx3KlI7?= =?Windows-1252?Q?QFXV0rzeIYxfu/TEU5MtdUIRe5VOv/LdTnEBwWTXPsJmM8Saof4ujpK5?= =?Windows-1252?Q?+ZVSD7/nlXIisYbx3FDg/Q2MWUYyu9L7m85MWY7SyPQjqQyuR4F8PYuc?= =?Windows-1252?Q?757+VOnKyIVh9sLWMjiIE6hyANdoHuRDI3bLZIctxkCbIT0xfbBe8I0V?= =?Windows-1252?Q?5rLIO2gfTqrdLAiG7wUIvinHcrxJ0Sv3OZQETb+I8yGpq26K3ebRl0If?= =?Windows-1252?Q?kuxJXtHhgcDy1j7tbwZkkz4GQ5lvwVQeUE8whBF1yb4vKioY+FiSc64f?= =?Windows-1252?Q?xQ3oKGzYePaxKC8L9/1cJMdambNAzz4LVUllalqCa6n5/gYbHxtdmqiE?= =?Windows-1252?Q?MKZUCbA+2Gf+XafPcNR/VidgqhKG+VPoBP3kt/r7svsbGSGkeVrS8I3F?= =?Windows-1252?Q?wJzdZPpGz8pILJUDt5eGO2ddRpuQ1K8oOI4sgw4Vg2To0pRSpDTRAQr2?= =?Windows-1252?Q?s/i6acR8NsV1e5yMg74JL+P4SPbpQ4r4Ao6rEc+Yd0RgUP4TqJp8fPOv?= =?Windows-1252?Q?RcwqUL5P3BGTP+rZUhLclug3nZE54TbPKCeVgxkC0AmgKN14eSkh7wPv?= =?Windows-1252?Q?0GI03RN13LNX2XIj2H0LGBs0a2b5HkloEDHbcEzik10F38pUTyghKJwL?= =?Windows-1252?Q?sKMqumOFUU3wCiM0ICdIJfYz/9OvImcisltgsHSQbIUA5+T9hjum7B2I?= =?Windows-1252?Q?sLNrnjJfFhJhSsShvC5pNk5uOkND0ln09HHdO/EApOeOjkcODkn+I5HS?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e9a5ad0-6bd7-41c7-679c-08d9899a0b97 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 13:54:56.0777 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tiUz1gJHbuOfLx1ELGI+L9qvoYLDaVSIpmshqxpdrGqKEoGNc7HbFB5nFbD4qCp/aH8aW0hiRzZ7GyKAevsRTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1846 X-OriginatorOrg: intel.com 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" Hi Akhil and Hemant, This is a generic problem to raw_api applies either with dst_buf added or n= ot. The idea is for SGL test when Wireless algo digest encrypted case is tested= and RTE_MAX(cipher_off + cipher len, auth_off + auth_len) is smaller than=20 RTE_MAX(cipher_off + cipher len, auth_off + auth_len + digest_len), the ori= ginal code will not add digest data SGL info into rte_crypto_sgl, leave alone the= 4-byte digest is split into 2 2-byte segments. This patch only try to address the problem and as far as I can see from the= patch https://patchwork.dpdk.org/project/dpdk/patch/20210907075957.28848-15-heman= t.agrawal@nxp.com/ the problem is not touched. Regards, Fan > -----Original Message----- > From: Akhil Goyal > Sent: Thursday, October 7, 2021 1:47 PM > To: Ji, Kai ; dev@dpdk.org > Cc: Zhang, Roy Fan ; hemant.agrawal@nxp.com; > g.singh@nxp.com > Subject: RE: [EXT] [dpdk-dev] [dpdk-dev v1] test/crypto: maxlen calculati= on > update >=20 > > 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. > > > > Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API") > > Cc: roy.fan.zhang@intel.com > > > > Signed-off-by: Kai Ji > > --- > > app/test/test_cryptodev.c | 35 +++++++++++++++++++++++++++++++--- > - > > 1 file changed, 31 insertions(+), 4 deletions(-) > > > > 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; > > } > > > > +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; >=20 > There is a patch series pending to be merged which support oop in raw dp = api. > 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; > > > > + 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; > > } > > > > -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