From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91A19A0350; Mon, 11 May 2020 09:43:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 141891C2F0; Mon, 11 May 2020 09:43:52 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40079.outbound.protection.outlook.com [40.107.4.79]) by dpdk.org (Postfix) with ESMTP id CBE311C2B2 for ; Mon, 11 May 2020 09:43:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/Q1XOjiCDg36/OryYL3pd11bexhi3fCNuhuxxaSIb6qDLBJcAARw0Ac9fftyylsYyRju6og8EgHkdayFKZY8sxcuBwPo0/7jcgktBIJhrepiF440EQjxpCJOyHLLBR1HGWPtKH1y38Ef5eusowniRS7WajxUab2HFkf1jaX7G2zdEYEgAkcSeFdClt13Sa88m5+edmfpEXHifwXca5+7iwk2pKwSC29iXM2qDj9AP2cRR2obsXBgSjiKVhHdj47ECTnqEfP6ZEfQ6GOdTiSED12G2hZuFF6ujMcpN0V93IUJIt4NzXLTDLylq6PPRPtvFOnKazg7VkxS+MvfrpT1Q== 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-SenderADCheck; bh=BxgZSGx0vXGUr6Us5/jKuMzyWyYMXJELY9VW5Qfwfko=; b=eJyhufgRUJWZnXghT1GFCX2uzkssWtdFgmzUCwM7LPDOisxcYx/SmoRcD0VmfFq2tCzZyYPI/4rRoclSmXmpVlWrvTgQWoyvNvcKktIzmaac3Ljy7CEdUIqZsNoRA5pd8c7gC5STsz135U/snL/Nhe6qUJRPxkp3DzpCsLnovp7afJyEyFCnrH5u/Osxxh8vnlOLiSadGj8es1d3eBPWlxV7A4AnzAtow1vFNCK5MZHJIdlX1m9YE5ud1XVYxTCVpAz5RGWJipkMtAP5iiO3j49tf7rkCOawKoKXTDoIf5agwuB93e59mzEwjqXo7iZ3v/3iDx30n3h6w4OuM3CLrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BxgZSGx0vXGUr6Us5/jKuMzyWyYMXJELY9VW5Qfwfko=; b=IYt1qb+QOm2d4dbsv2G+5ZhmaKyQq5zW92RfuE3crx7M4uA49aZo5b++8nOOCIxcXv4j96KUzmQiRl3lYVupf3x3k31pMqDV90zyc5jbW7P0WfNOhn+ypgPiIaURNDlwX3yAELMDHECSKEV/PGYZ5LzGHDE65doEeXT45M87ILk= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR04MB5358.eurprd04.prod.outlook.com (2603:10a6:803:c9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Mon, 11 May 2020 07:43:48 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::8c03:2f5:3b48:ba74]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::8c03:2f5:3b48:ba74%7]) with mapi id 15.20.2979.033; Mon, 11 May 2020 07:43:48 +0000 From: Akhil Goyal To: Pablo de Lara CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 1/2] crypto/zuc: support IPSec Multi-buffer lib v0.54 Thread-Index: AQHWJwLy24UVKRs8uEiILmhY+wBX3qiigZBg Date: Mon, 11 May 2020 07:43:47 +0000 Message-ID: References: <1587488214-68422-1-git-send-email-pablo.de.lara.guarch@intel.com> <1589139650-195685-1-git-send-email-pablo.de.lara.guarch@intel.com> In-Reply-To: <1589139650-195685-1-git-send-email-pablo.de.lara.guarch@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [45.118.167.80] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 355a58e6-7861-46a8-8afa-08d7f57f0ad3 x-ms-traffictypediagnostic: VI1PR04MB5358: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 04004D94E2 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kHS9i+HBi6HePtyZAyVEx47sWrS/dkB2wBb++Fm53VTLe7qHWsCBiVtRn/8JSiA/0+4/zP6hl7OIysHkbkOaUS1BF68+DwcTG/jYM6dTNDEU3ZeHsI8OBkAU6WUu4M1BE8pS7Asf85BNOtNVEHElgtRbcLYIQnAGNpzcnrN3RdhgZ60SsurAQnmPFS2SbtIZ9+S1jXFfa9voN+UM5WXz+THaHfg2qwoeoglNi3Q5B/oC9sG5YewLMR7h/1WeDxBcve8EHjiY0bNb4gfQOZp+eGIRnb1WmIB6OnybV0Rxf/5914apc2yOR4nmPLIJpfQVL4GJyiQ1DdCWLPIoMmZ8GDDwldjNQ5xzrp+amIwPOBdWihP4GAMw1DTw/vr7AQCGooIT77LypdGqqOGPJ3ucSkjGfOr6xW3Pa8JBFK27Q/Blk440vyeZHNtFu+N7KR2Qxm06dBpQGwUW4oC8bo6FKs6y7DLNPJ5Xk9/qCzZVzTyqEj9R+DyXn0cimHs/56fmIAUbtLy3KFA1T2WvTt87cmZifexn7ZywUSN1nZWD3hyHTYkYDDlYzNZMvQV2k4RuipxaM/uIzymXNAae230HFgbDWbju5lafvBgCoxUPrsU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(366004)(376002)(396003)(39860400002)(136003)(33430700001)(2906002)(44832011)(83080400001)(71200400001)(33440700001)(55016002)(9686003)(8936002)(478600001)(8676002)(6916009)(316002)(4326008)(86362001)(66446008)(66476007)(5660300002)(33656002)(66556008)(26005)(66946007)(52536014)(186003)(6506007)(7696005)(64756008)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ITsPtjuiwFs5GroRna3MjcCACObPN/ms9DlbtXmxxrgONHLKpWJzhnv0pX+PXFvHh9df/e1JulbryMcFfulDP3RTUbr6T8lclXXJU0iWP0ZVLmDa0945L83EMAbZl9kBLbhKjVhOQGWWEOIxnSWEivS0ieLnqZujXQgDdzuIq/zzxwUQ6S6i4qm1zjaQ4CmLv5kJ+pbfojaX23czT8AH3GTITKUy39k/XODg+45m8DGTKaRaq5rkZyE21TP8pIf6j+pU1V1y4r3P7o/vH7Ij4e2rJXsEyrXCH8S95YrbfSjLK2Zzwb8K73szQmbo4/b0W5WywcCsYmGma7ReLY/4EA3/QS/Ydqmu0Hyu+3p5yK4o64HNImY8OUW6Fr2GPd1+7jW5g2ahx78CgSYFDL7nulAMADNvODfeZqVoLUPF+7aSMZUS47XKOxWwcVj0vYdDSDV9eXjom3JCejkVC+PDxISnN2Ya16D8quCPlCD+REk= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 355a58e6-7861-46a8-8afa-08d7f57f0ad3 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2020 07:43:48.6582 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: u7xLdNkqw0Cxl3ZNdhas6ocC9seDCBwFAdGR8zxsO/L7UNqjJBjs/Bh7g98P1X0bgvt/k9VuSWbUwkwvVvtf7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5358 Subject: Re: [dpdk-dev] [PATCH v2 1/2] crypto/zuc: support IPSec Multi-buffer lib v0.54 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Pablo, It seems there is compilation issue in Clang with this patch. Regards, Akhil > Signed-off-by: Pablo de Lara > --- >=20 > v2: > - Simplified logic in process_hash_op per Akhil's comments >=20 > doc/guides/cryptodevs/zuc.rst | 6 ++-- > doc/guides/rel_notes/release_20_05.rst | 7 ++++ > drivers/crypto/zuc/rte_zuc_pmd.c | 58 ++++++++++++++++++++--------= ------ > 3 files changed, 44 insertions(+), 27 deletions(-) >=20 > diff --git a/doc/guides/cryptodevs/zuc.rst b/doc/guides/cryptodevs/zuc.rs= t > index 38ea999..c384f3d 100644 > --- a/doc/guides/cryptodevs/zuc.rst > +++ b/doc/guides/cryptodevs/zuc.rst > @@ -35,8 +35,8 @@ Installation > To build DPDK with the ZUC_PMD the user is required to download the mult= i- > buffer > library from `here > om%2F01org%2Fintel-ipsec- > mb&data=3D02%7C01%7Cakhil.goyal%40nxp.com%7C5e2b3704135b4de6d5 > a708d7f51a140b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6372 > 47364662642602&sdata=3DgncK8ob%2FbtOTpjZH2luy4%2Fa4TcfQYGsvI6M% > 2BRQdkfBk%3D&reserved=3D0>`_ > and compile it on their user system before building DPDK. > -The latest version of the library supported by this PMD is v0.53, which > -can be downloaded from > ` com%2F01org%2Fintel-ipsec- > mb%2Farchive%2Fv0.53.zip&data=3D02%7C01%7Cakhil.goyal%40nxp.com%7 > C5e2b3704135b4de6d5a708d7f51a140b%7C686ea1d3bc2b4c6fa92cd99c5c301 > 635%7C0%7C0%7C637247364662642602&sdata=3DJuMgmXftLm62TGvaaSo > OUpSOWGhT9eVQ%2Bb8r3NEFUow%3D&reserved=3D0>`_. > +The latest version of the library supported by this PMD is v0.54, which > +can be downloaded from > ` com%2F01org%2Fintel-ipsec- > mb%2Farchive%2Fv0.54.zip&data=3D02%7C01%7Cakhil.goyal%40nxp.com%7 > C5e2b3704135b4de6d5a708d7f51a140b%7C686ea1d3bc2b4c6fa92cd99c5c301 > 635%7C0%7C0%7C637247364662642602&sdata=3D9oDdUezguCEPTCe5FfQS > w7zJKt5%2BiSUe5v4Ypm5YBIw%3D&reserved=3D0>`_. >=20 > After downloading the library, the user needs to unpack and compile it > on their system before building DPDK: > @@ -63,7 +63,7 @@ and the external crypto libraries supported by them: > DPDK version Crypto library version > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 16.11 - 19.11 LibSSO ZUC > - 20.02+ Multi-buffer library 0.53 > + 20.02+ Multi-buffer library 0.53 - 0.54 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 > diff --git a/doc/guides/rel_notes/release_20_05.rst > b/doc/guides/rel_notes/release_20_05.rst > index fe6c75e..7d3a4bf 100644 > --- a/doc/guides/rel_notes/release_20_05.rst > +++ b/doc/guides/rel_notes/release_20_05.rst > @@ -155,6 +155,13 @@ New Features >=20 > * Added support for intel-ipsec-mb version 0.54. >=20 > +* **Updated the ZUC crypto PMD.** > + > + * Added support for intel-ipsec-mb version 0.54. > + * Updated the PMD to support Multi-buffer ZUC-EIA3, > + improving performance significantly, when using > + intel-ipsec-mb version 0.54 > + > * **Added a new driver for Intel Foxville I225 devices.** >=20 > Added the new ``igc`` net driver for Intel Foxville I225 devices. See = the > diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c > b/drivers/crypto/zuc/rte_zuc_pmd.c > index 17926b4..45ae04b 100644 > --- a/drivers/crypto/zuc/rte_zuc_pmd.c > +++ b/drivers/crypto/zuc/rte_zuc_pmd.c > @@ -237,12 +237,13 @@ process_zuc_hash_op(struct zuc_qp *qp, struct > rte_crypto_op **ops, > struct zuc_session **sessions, > uint8_t num_ops) > { > - unsigned i; > + unsigned int i; > uint8_t processed_ops =3D 0; > - uint8_t *src; > - uint32_t *dst; > - uint32_t length_in_bits; > - uint8_t *iv; > + uint8_t *src[ZUC_MAX_BURST]; > + uint32_t *dst[ZUC_MAX_BURST]; > + uint32_t length_in_bits[ZUC_MAX_BURST]; > + uint8_t *iv[ZUC_MAX_BURST]; > + const void *hash_keys[ZUC_MAX_BURST]; > struct zuc_session *sess; >=20 > for (i =3D 0; i < num_ops; i++) { > @@ -255,33 +256,42 @@ process_zuc_hash_op(struct zuc_qp *qp, struct > rte_crypto_op **ops, >=20 > sess =3D sessions[i]; >=20 > - length_in_bits =3D ops[i]->sym->auth.data.length; > + length_in_bits[i] =3D ops[i]->sym->auth.data.length; >=20 > - src =3D rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) + > + src[i] =3D rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) + > (ops[i]->sym->auth.data.offset >> 3); > - iv =3D rte_crypto_op_ctod_offset(ops[i], uint8_t *, > + iv[i] =3D rte_crypto_op_ctod_offset(ops[i], uint8_t *, > sess->auth_iv_offset); >=20 > - if (sess->auth_op =3D=3D RTE_CRYPTO_AUTH_OP_VERIFY) { > - dst =3D (uint32_t *)qp->temp_digest; > - > - IMB_ZUC_EIA3_1_BUFFER(qp->mb_mgr, sess- > >pKey_hash, > - iv, src, > - length_in_bits, dst); > - /* Verify digest. */ > - if (memcmp(dst, ops[i]->sym->auth.digest.data, > - ZUC_DIGEST_LENGTH) !=3D 0) > - ops[i]->status =3D > RTE_CRYPTO_OP_STATUS_AUTH_FAILED; > - } else { > - dst =3D (uint32_t *)ops[i]->sym->auth.digest.data; > + hash_keys[i] =3D sess->pKey_hash; > + if (sess->auth_op =3D=3D RTE_CRYPTO_AUTH_OP_VERIFY) > + dst[i] =3D (uint32_t *)qp->temp_digest; > + else > + dst[i] =3D (uint32_t *)ops[i]->sym->auth.digest.data; >=20 > - IMB_ZUC_EIA3_1_BUFFER(qp->mb_mgr, sess- > >pKey_hash, > - iv, src, > - length_in_bits, dst); > - } > +#if IMB_VERSION_NUM < IMB_VERSION(0, 53, 3) > + IMB_ZUC_EIA3_1_BUFFER(qp->mb_mgr, hash_keys[i], > + iv[i], src[i], length_in_bits[i], dst[i]); > +#endif > processed_ops++; > } >=20 > +#if IMB_VERSION_NUM >=3D IMB_VERSION(0, 53, 3) > + IMB_ZUC_EIA3_N_BUFFER(qp->mb_mgr, (const void **)hash_keys, > + (const void **)iv, (const void **)src, length_in_bits, > + dst, processed_ops); > +#endif > + > + /* > + * If tag needs to be verified, compare generated tag > + * with attached tag > + */ > + for (i =3D 0; i < processed_ops; i++) > + if (sessions[i]->auth_op =3D=3D RTE_CRYPTO_AUTH_OP_VERIFY) > + if (memcmp(dst[i], ops[i]->sym->auth.digest.data, > + ZUC_DIGEST_LENGTH) !=3D 0) > + ops[i]->status =3D > RTE_CRYPTO_OP_STATUS_AUTH_FAILED; > + > return processed_ops; > } >=20 > -- > 2.7.5