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 5FB32A0C41; Thu, 30 Sep 2021 11:43:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC00240DDA; Thu, 30 Sep 2021 11:43:47 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 95D184067E; Thu, 30 Sep 2021 11:43:46 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="204632220" X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="204632220" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 02:43:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,335,1624345200"; d="scan'208";a="555654752" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by FMSMGA003.fm.intel.com with ESMTP; 30 Sep 2021 02:43:45 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 02:43:44 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx604.amr.corp.intel.com (10.22.229.17) 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, 30 Sep 2021 02:43:44 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 30 Sep 2021 02:43:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdI+xbG9ajKhcgO0Y3zfDsC5SIHdODWmcl5g3tAE/+k3p8EGMS/7I4JPlRRnL9BnykP78plJFHFd7QTPjCu1X2Uq8+DTSviFlmuYIl5JneJ35unm1bDyWxwSEPh1cLl1u9yQVf6Ze0two00CTzs49J4HBM4wrEz+ykK65+5RNYRPCNFK1PBYxh8dBpLYYmgzZ046jI29P/n4wjPNzpiPSY0Kio7pI1uGVnXpRn/nbwnp7N4okcfFUp2sw0DoYbDcDEAH3hbs3CsJMjLwpWRRATdzsDjvCoPbcxiDpbWR94Nd5FUZ6O0d4wb9t6bZltpPvh1WcLx1sfwO6vcgb+mpxg== 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; bh=lHZEanjGjB3N2Qlnr+52AgUQbjV0D5m6snjiiVgFFiE=; b=K7E23pSygT0woxOMxo01oyaXYxDnFrQhBnNrwb+yz+GnJ5E6S1dLG7Diswrgo8xV77rAS6A6wUnhFkV8Tv2xbUmvAixJ/DB+G6HvqTB1TqEKyc5mcQm0nCRS2KcNxdk5bfwQrrY5rdp+/3gGCWf26+UERkEB0JwkpQ+1bxeDt7rpx69vm4hKUW3HGC2QGmsG4l5+9ykUFRFl0ODY3O4w9/6N/PsJQV9mczef8JEQnOuWcVid6Levmqw3oTtXdMkvjLe8R9tR17OpPg3zQHFsosc+h9IvOKuRrBC+84m1sZsQw+Ryyh8K2qfWJ94TVVAFSLh4o3HxlrGVwjX7QzGzgQ== 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=lHZEanjGjB3N2Qlnr+52AgUQbjV0D5m6snjiiVgFFiE=; b=YwZ2Y7NQ0RxAdys1auzWRLVKXY82SFZ/AXFu8OHj2HQE2cnM94fU+geLjmDEYbS8Ay48z2uFoew9L9iX5CZ5myKLszictbAa1Afnmz9VvkESG0kT2wwZUc7gAfUzm57BNHxjHzmR/C4bLS/f1HqqxS66K/YG4/TThMju++UH6WI= Received: from CY4PR11MB1718.namprd11.prod.outlook.com (2603:10b6:903:2c::23) by CY4PR11MB1479.namprd11.prod.outlook.com (2603:10b6:910:5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Thu, 30 Sep 2021 09:43:37 +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.4566.014; Thu, 30 Sep 2021 09:43:37 +0000 From: "Zhang, Roy Fan" To: "stable@dpdk.org" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev v1] test/crypto: maxlen calculation update Thread-Index: AQHXtUgLyaseKHs+gUiv91CldvbILqu8VJfw Date: Thu, 30 Sep 2021 09:43:37 +0000 Message-ID: References: <20210929153809.69039-1-kai.ji@intel.com> In-Reply-To: <20210929153809.69039-1-kai.ji@intel.com> 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: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 949e3a73-2ac1-4ef9-3a8e-08d983f6c73d x-ms-traffictypediagnostic: CY4PR11MB1479: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Tjikw9GdJmNyEw8j7nHqmun+HSyYsfb7Nu20amKIAdouli4vbpQDBpnjiit6r34RUwPzE65OhdJRdg1epD/JkI/rGWPUqlC0BBG1N9QA2nA/WxitxjFBt4WMgEMmbIa0r4rNNq/Q8Go7MvZmBtQEgKRGrsrF15+ds4thI2qKTD+Qpi+dnPxLVEnLcWw7nYaR1kU/2fLijX53g1UApkArvgDdugIS5WedUFGdT9UUd/PKmj3hzT7ynN90Eg5DPtzm6BrtZMm9z7306e0ZRKKC9DMOoE8nIkL3v25/AB+X5+7DxiM0gnRzVJSJ+3PA97sqGm9LLijF2WA4gy4ZUcdR+vYH+YC+T3YIJBjdl74nRxd4S6LvUVwe7x5c8NgUiSy8lfa2UEz51Qe4xo6D0bjk41h7HQWgMHJYKkMGpCim1o65QjSHxczsnlyHUseTlNN9w+5l0qjsCw/mTgChXUcpl2kT7amdn/jM4gouS7weJQbEuEHC6pbQdvE/eZr4BuLUP0jY87evUJe3QW1mocbtG28HZc480WWeItDpm+GroagEH/MyyaDnLKIiqm3OqFsnxLhDQwTOaT1Yw5+BzYWPxZQ3VQJbBExDTSPGp9pwdGqjgSPsUd+DLRmLBw7S5OLeNiRBQ1Pdb7D3PTmA5WXcl02cmkjr58hgizwQAB5u5k+p1+a/6CTz4MlLXD9neoIR4tv0eZ6CU02lCMxDPeHt4g== 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)(66476007)(15650500001)(66556008)(450100002)(6506007)(64756008)(53546011)(66446008)(33656002)(26005)(4326008)(66946007)(52536014)(7696005)(2906002)(38100700002)(122000001)(76116006)(8936002)(71200400001)(9686003)(38070700005)(83380400001)(186003)(8676002)(316002)(86362001)(508600001)(5660300002)(6916009)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?H19x3CB9q/BEYB2faEZ3/g9CSWFxR3o9K7hJGu09HNlFA5Q1i5jAwX2/?= =?Windows-1252?Q?j89rcDMUK1s0yHz1yn7e06DecTiHRmjtiJ19Pi3Q0+P9CFO6O9Tgqp3y?= =?Windows-1252?Q?aR9c9ss9XezEoaH65CcHV55dh5BMycxbSuPkMAzPxQPLgeG16Awpczpu?= =?Windows-1252?Q?tN917IPyxe6dsS7mCsJ2obya9SvTBRk8U8PUUBFEznmWZ+1P1HPx+lUh?= =?Windows-1252?Q?MCNuoEW5uY3Mq6oqTNDaBIxMTDoBtosNLrS0u1NoMmdjaVj0SoW82+ZZ?= =?Windows-1252?Q?V+UqVJyBa5ejjSVPp6Ayoi9te3tUYQYYI1D8loW6gOlItrStzW9/zpsI?= =?Windows-1252?Q?1OWNwrmFuMSlMtqpUWmjUWrCJCIzr+5cTvskg2EG8EQiFKd4yXJMdr34?= =?Windows-1252?Q?uKPqPXy+qsRSvJzVrJAfl8CaHIJfaa76K1bV+GZpCwWn3joD+Mi8E39j?= =?Windows-1252?Q?IEtXsmZiHXK1pf3LtHH1D3nEXZFfm5YyhJFp2JZa6flD0+xYZn8egklW?= =?Windows-1252?Q?lQmN4KgJhwUVixa4mKs2ZkwVSz0cECrEX/lSy/FtZo/AWuXQn45YU9QD?= =?Windows-1252?Q?53caTUntblwAwNhvN+0DW9vMy8zmyZb3wSCFIE0wOOQH9u9AHxFCB62q?= =?Windows-1252?Q?PIGHDsPmmxWs2ejQUObAWTVPZ2ncgSC+jJ2h8LLAHU9iRsB68ztkMNvG?= =?Windows-1252?Q?d36IkpPo66H3ZNblWVCoamsBmaOIqVj+i1sd7oatCuyujmGZrojs+Ey+?= =?Windows-1252?Q?jBztvBTDn7erw7C8z1FyHjy7Ifh7QyAeVngbwxqnspePswVi0N0WuNbL?= =?Windows-1252?Q?x7p8y51TuvXO0A0VXoqCSlaDRhTK9DdmEHvbpieLpKxnuhuEchaNG2WO?= =?Windows-1252?Q?jgiiIqjoLL9UHxp06gQM9qSGviCH9eSZewHSGd7Kh1Upknlfbg+Al3OE?= =?Windows-1252?Q?lWqE5Rb/zeWsbS3y5Qo/PctPULG1oTUJHv8+HutrbEq0Yl7okgjwMS53?= =?Windows-1252?Q?T5i4Ewot0YXOVlGSa34fFJ8jtE8cjmO92Qaf8jO0oOc9tuVmP5Sci0kR?= =?Windows-1252?Q?W9uy5GJJYo3kckE6RmXLvOsOTGOq3qusgf/3lkKcaRLiZ4r7f1eRG/h5?= =?Windows-1252?Q?j48j7h/7h5vO8IVHalQxQp8TsN/8hqIRjaV0jSJ9IW/7qg5FsnzLMdCs?= =?Windows-1252?Q?xQUqecSUs8BUrDdAvbj4GoLMXu6e1/673qv4uaR527d7O1rpr/HobWld?= =?Windows-1252?Q?6aiU9s+hTCJ9ZAHLvuwWXRnnpqG8ikmGgBXFKOlQQAAX0OoK5Qko2jYV?= =?Windows-1252?Q?tmsodt7p1rzZWPGdbn1N0zqkN/nIw68ilBKYlZzQMuLkWo0MFXDn4L3q?= =?Windows-1252?Q?hIL3zCilr5yuR/9Xr9JPLoptdJdjalP0MxeZIVxyGUKr9t3jokmod1Bg?= x-ms-exchange-transport-forked: True 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: 949e3a73-2ac1-4ef9-3a8e-08d983f6c73d X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2021 09:43:37.6768 (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: VQheeRvH8nGXATQtK7a3mfgje/yFkcropjZmFGc7qbTJKqdNm5nSDoCjkUVITizZiBBynXvZgbEfASRyIVKLTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1479 X-OriginatorOrg: intel.com Subject: [dpdk-dev] FW: [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" CCing to stable@dpdk.org > -----Original Message----- > From: Ji, Kai > Sent: Wednesday, September 29, 2021 4:38 PM > To: dev@dpdk.org > Cc: Zhang, Roy Fan ; Ji, Kai > Subject: [dpdk-dev v1] test/crypto: maxlen calculation 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. >=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; >=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