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 7A810A0C4B; Thu, 14 Oct 2021 15:43:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07F824112E; Thu, 14 Oct 2021 15:43:11 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3975F40E50 for ; Thu, 14 Oct 2021 15:43:09 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10136"; a="214841137" X-IronPort-AV: E=Sophos;i="5.85,372,1624345200"; d="scan'208";a="214841137" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2021 06:43:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,372,1624345200"; d="scan'208";a="717719020" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 14 Oct 2021 06:43:07 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 14 Oct 2021 06:43:07 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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, 14 Oct 2021 06:43:07 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 14 Oct 2021 05:40:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZSgnR9uK3viM0XvlSRpYIlQxHiVYcAJZV2KTalvhyXx+bETCrTpAMgSEukbs121DNWciVOo1I6KuBo2yca4ychHdJUOkS0YQqFtEVYRRx8k1RIkMk//Z0LU5f9IVakuWM0U4y3Zv9/eByMx0aQGZnGppgzb2ihyJKD6Ix4P2q9k7eFUl4nGTEGfrnpQ8wfmhezZHgsG1eGnIrDrxMgVnoulOkRZEZJrkX7d0mnTPaX1frI73VF+Hi29CjnKkPmBVUUzma9pnh3X69DsL3j3BWHEqE6nAdQjWs7hpKxe9beXoKmNBE6Oi9y+lV+L4hftEtbxvzHGbLeqkcWs8X3Tt+g== 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=13mTIbrxF2WF4Ij+LseKerX4wDcDD3lqPvbHn3e1WzU=; b=UDgbNpfX/kuVuAzCeaWKlFio2+qAdRbJsIQ3g/gaQCg8VQ7ITVA1op5qdhDmzh9qW1httHctYXeu9u3+RBit0QTOiXLtSLZFE3NXUADvM8OKPmfvM/iAY4QYa1hn0HNacqLBoLP6XSZQ9EQAW3m5QxX09mf/QeEZSUwQgiYZSavB0a6R87uc/D0B1YM9gXwaJJU3wyGKOByWztEVmmLDIdGJBayrPfaK+X/mocoIbXaGZ29zMTne1DVqkqQ7S4d7SYd8Q5PVne9fOHWF4z7dGy3iAT3m4yOSHvP6H/5Nfbj3aHOWQziXDpyaxhCwAXeld5jdDXndguOFgdL3qQyMuA== 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=13mTIbrxF2WF4Ij+LseKerX4wDcDD3lqPvbHn3e1WzU=; b=Ju5qLGhGXI5SQvXduq/fyMNX9M69f/8OsCLHey/1YuOn57t7vFLTIsG6o6X/v4pt5xyOxtfAlBtDfJHXZowO5y7L17OuHP6z2QxX6pEYPYR9pdPpc58YhFUwwigDXZpuCyauhezZKBcoteCETLKDPpnu9tqmzi5dgDozfK06cs0= Received: from MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by MWHPR11MB1869.namprd11.prod.outlook.com (2603:10b6:300:108::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Thu, 14 Oct 2021 12:39:44 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::2c31:1470:3036:959b]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::2c31:1470:3036:959b%8]) with mapi id 15.20.4608.016; Thu, 14 Oct 2021 12:39:44 +0000 From: "Zhang, Roy Fan" To: Hemant Agrawal , "dev@dpdk.org" , "gakhil@marvell.com" CC: "Ananyev, Konstantin" , Gagandeep Singh Thread-Topic: [PATCH v4 02/15] crypto: add total raw buffer length Thread-Index: AQHXwGVEzkcsqQURPUmSPF3nd5BGRavSbpoQ Date: Thu, 14 Oct 2021 12:39:44 +0000 Message-ID: References: <20210907075957.28848-1-hemant.agrawal@nxp.com> <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211013190032.2308-3-hemant.agrawal@nxp.com> In-Reply-To: <20211013190032.2308-3-hemant.agrawal@nxp.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: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6c4d1f9d-6103-4881-f8b0-08d98f0fb321 x-ms-traffictypediagnostic: MWHPR11MB1869: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VbSpap8bSAbpky+aE6/TR+V3eJ/NV6oQA0JlUGv9fH3+mmqJgQickF3aK0SU4vYxyZRAgCDQpwray14vv/45l+tOJOYyVvu3rXNqR0d7LM2T76aXqGux/LvdztbiPzWIGKGh0XIwgKwlByt1srr9GXVrSB8bRv0qNaKIwskevmW6Pgi53ldPEWXsHHpYQMZ4NLIsvVovwbXWocESMg36Cqq/ZdrVSxGg2UHd+ZaHeB3aJDbrSNP0ldmd/q5n46SztrkjcmmmfTDZENMsNbDQJbbl4iAE7wec0WSgz6v9FwbRiFzMZY1RFaghh/sdCwWPu/ViE1HaCg+04z5xPEJtZqme10arSQZRm5pRBVt/iUdJuCGucPnL1VRsUyk0DvFdtSutAP2Aoa1gJKzxX70VeKjSfpmxmFKDip777bJV7m3XfTqvjz/RQoh0uHvT44Kz2oOwTbMQi7azpHW0/Ht+2rfA1KxIp0cZHFFA5194a4X4HNXhgvIj6cxTW2as4xj808b0yuch3mEJdaOgyxan8rUs+XO2PNiQf/Wz7fgD1VsJl4fD6v1MYaJN5s0+lb+VFHPJmxQNj2I2TJpuJmSpMCNnZB2SkTa+zSRAZrM2Vdp6ueKVeqvB1IKi5ShcTWRK8kqx/kKn4wcsATLWXWL5WG7tr4qvWBLM4BknPhsxfpQ6TIUIqjx5Pj0XSORpbkkAW/T8FFCJbIkaNVb+34g6kQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR11MB5809.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(316002)(8676002)(508600001)(26005)(2906002)(38070700005)(76116006)(7696005)(83380400001)(64756008)(33656002)(6506007)(66476007)(66946007)(53546011)(66556008)(55016002)(54906003)(110136005)(38100700002)(86362001)(66446008)(71200400001)(122000001)(52536014)(9686003)(8936002)(82960400001)(186003)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?mJpa9rzKUpwHndJORO4aqDQHbQl/M21K+aKMV5udWiqtk+EdEvnICXSv?= =?Windows-1252?Q?XKOdRrgDshNGZsys4fNvW8ZrJlVy5EHEFQd7Rnw0HGRS0CV3TrBNs93V?= =?Windows-1252?Q?kccunCcxAXN558KAWWt3cwtyJVaOM6/eLG0loTy2cUXkWdkRPYFEOq6j?= =?Windows-1252?Q?o2bJv+t9qp8iVP8fA1gcbBl7BlLaS4ZrWTOyYio/vdfULSEkkBFyCkhN?= =?Windows-1252?Q?6ULhWBuEGG7vDguXw/TIBRzg+PrnRld5IJRefvWTSILRHq+DPUP7FKfF?= =?Windows-1252?Q?dB7N8FICSXaFvsWiZaw7W5rFQLGcXAMwkPjGVzPlaDU4wZQAlQ8gAbrf?= =?Windows-1252?Q?QbCIrTpcFW/LwCVjAzKhA73NW6atKj64h96oOE4ODjiuru1VXgvLovtw?= =?Windows-1252?Q?p/nWJSLFXt8sIB+ekNNE3wqsoAnSy8aIl+8qa6ovSVOEDB6EGy8s79C0?= =?Windows-1252?Q?HBXASx2S49Lj5YVn5gD2gKO5KFV3j35hYDKazO2LwGvmdKrocCNzYNf1?= =?Windows-1252?Q?vsLkmTy3F622VzxOMrQNaJHdGUSQhIw8H00haP0wwMENsxgqdLbh/PYg?= =?Windows-1252?Q?P0vxslxjaXEmMjAhqWg7TnXgdzcsc97Skv3lxFcvk62hps8WKoMSwmjn?= =?Windows-1252?Q?P1ryiy1G3M/9G1gogaerBsftIETtrdM9XUIE/329uNZEvF31+idOa43Y?= =?Windows-1252?Q?Qs3JOCfG2muki8hIgWqo42nPo2Wt7B/DW13wYjrby/ITbvf1Yw3H/uSn?= =?Windows-1252?Q?fzPVEUxP4DEHUfHV0z4Nje5BKKvuOibiExkNRLWWZTMFdojiCqL6M2Bu?= =?Windows-1252?Q?0DKvQxuCmrTfFnBS4917lHR5PXmshix70x66GOHLc8QxS19MDwiylB5q?= =?Windows-1252?Q?PdlrOsvCTZNcuqoIcQ+0Dl38lgY4DSD3lwUi7NG7HGC0njFQfwE0Ln8r?= =?Windows-1252?Q?SmEM1/ORkk0Ze9pTdFl+Grq3T0SpRoeJpX9R1K7/9Q5ZFMYGp9vsIQvO?= =?Windows-1252?Q?5t9kMqP55biykPLlHdtZmhCK3R4uAoYZHw1tDnZRFilJDI211ZwIbVV7?= =?Windows-1252?Q?tdSEdQMy1yNwIQbWzfL4fSE5Q5h1wMTLb5sV84Z8bmiRsDcDyw0C904k?= =?Windows-1252?Q?l4i6jeZsS6qDVnONW/1grAxTki4TlCUITiao6U7e0z1wAUu792nhrIj3?= =?Windows-1252?Q?uGUaCdz7pUt2qXPJMOfy2Jby8laDSssWLlNn02ZzJjY7be8XS0pxXa2F?= =?Windows-1252?Q?8pZLlCbvg7krEdzq2i2sdcjSzhxQkY30rC/yj3LEW2w2cEw6mJqcUpRw?= =?Windows-1252?Q?H0zMZrh/2Kmmd7WSqexze/n2JKSGCtMaFgMvrpaYy9w7bs4FXd2MhA2r?= =?Windows-1252?Q?PzuIegN9kAL6GFTWz42OFtD7JJKhd//srXPbj0sMBZsZn6wOziST6/ci?= 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: MW5PR11MB5809.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c4d1f9d-6103-4881-f8b0-08d98f0fb321 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2021 12:39:44.0642 (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: /Ti1wefrfYKy17rrI3iw4PNRpK5hRBygeABoIBVCIR+IDCk/2m03VFsE+5/XA559sx5Su+zRVHGQzUwVrbeAwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1869 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 02/15] crypto: add total raw buffer length 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 Hemant, I still think it is enough to use rte_crypto_vec as well as=20 rte_crypto_sym_ofs is enough to describe the data including both the data and aad. Imagine 2 10 bytes segments case, encryption/hash size of 12 and aad of 8. We will have=20 struct rte_crypto_vec sgl[2] =3D {{.base =3D x, .len =3D 10}, {.base =3D y,= .len =3D 10}}; union rte_crypto_sym_ofs ofs =3D {.cipher.head =3D 0, .cipher.tail =3D 8, = .auth.head =3D 0, .auth.tail =3D 8}; The driver shall understand there are 8 bytes not included for cipher/auth. Regards, Fan > -----Original Message----- > From: Hemant Agrawal > Sent: Wednesday, October 13, 2021 8:00 PM > To: dev@dpdk.org; gakhil@marvell.com > Cc: Ananyev, Konstantin ; Zhang, Roy Fan > ; Gagandeep Singh > Subject: [PATCH v4 02/15] crypto: add total raw buffer length >=20 > From: Gagandeep Singh >=20 > The current crypto raw data vectors is extended to support > rte_security usecases, where we need total data length to know > how much additional memory space is available in buffer other > than data length so that driver/HW can write expanded size > data after encryption. >=20 > Signed-off-by: Gagandeep Singh > Acked-by: Akhil Goyal > --- > doc/guides/rel_notes/deprecation.rst | 7 ------- > lib/cryptodev/rte_crypto_sym.h | 7 +++++++ > 2 files changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/deprecation.rst > b/doc/guides/rel_notes/deprecation.rst > index a4e86b31f5..53155459a0 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -188,13 +188,6 @@ Deprecation Notices > This field will be null for inplace processing. > This change is targeted for DPDK 21.11. >=20 > -* cryptodev: The structure ``rte_crypto_vec`` would be updated to add > - ``tot_len`` to support total buffer length. > - This is required for security cases like IPsec and PDCP encryption off= load > - to know how much additional memory space is available in buffer other > than > - data length so that driver/HW can write expanded size data after > encryption. > - This change is targeted for DPDK 21.11. > - > * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and > ``rte_cryptodev_asym_session`` to remove unnecessary indirection > between > session and the private data of session. An opaque pointer can be expo= sed > diff --git a/lib/cryptodev/rte_crypto_sym.h > b/lib/cryptodev/rte_crypto_sym.h > index dcc0bd5933..6be283e83c 100644 > --- a/lib/cryptodev/rte_crypto_sym.h > +++ b/lib/cryptodev/rte_crypto_sym.h > @@ -37,6 +37,8 @@ struct rte_crypto_vec { > rte_iova_t iova; > /** length of the data buffer */ > uint32_t len; > + /** total buffer length */ > + uint32_t tot_len; > }; >=20 > /** > @@ -980,12 +982,14 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf > *mb, uint32_t ofs, uint32_t len, > seglen =3D mb->data_len - ofs; > if (len <=3D seglen) { > vec[0].len =3D len; > + vec[0].tot_len =3D mb->buf_len - rte_pktmbuf_headroom(mb) > - ofs; > return 1; > } >=20 > /* data spread across segments */ > vec[0].len =3D seglen; > left =3D len - seglen; > + vec[0].tot_len =3D mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; > for (i =3D 1, nseg =3D mb->next; nseg !=3D NULL; nseg =3D nseg->next, i= ++) { >=20 > vec[i].base =3D rte_pktmbuf_mtod(nseg, void *); > @@ -995,6 +999,8 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, > uint32_t ofs, uint32_t len, > if (left <=3D seglen) { > /* whole requested data is completed */ > vec[i].len =3D left; > + vec[i].tot_len =3D mb->buf_len - > rte_pktmbuf_headroom(mb) > + - ofs; > left =3D 0; > break; > } > @@ -1002,6 +1008,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf > *mb, uint32_t ofs, uint32_t len, > /* use whole segment */ > vec[i].len =3D seglen; > left -=3D seglen; > + vec[i].tot_len =3D mb->buf_len - rte_pktmbuf_headroom(mb) > - ofs; > } >=20 > RTE_ASSERT(left =3D=3D 0); > -- > 2.17.1