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 A15E4A0C41; Thu, 16 Sep 2021 13:42:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E92040151; Thu, 16 Sep 2021 13:42:55 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7C5934003F for ; Thu, 16 Sep 2021 13:42:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10108"; a="209633608" X-IronPort-AV: E=Sophos;i="5.85,298,1624345200"; d="scan'208";a="209633608" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 04:42:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,298,1624345200"; d="scan'208";a="700586926" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 16 Sep 2021 04:42:52 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 16 Sep 2021 04:42:52 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 16 Sep 2021 04:42:51 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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, 16 Sep 2021 04:42:51 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.49) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 16 Sep 2021 04:42:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AFKsytsuwOU8DKVio4b60GQ3oE92Zq+mVBHHHLp4WElwXJmMjBABGI2EMxwf6cRMTi47SRUx3xdvXhI7Y6/BiZUTzQbQ5qv3aLn/FuyVvyk9nrBzk6dkG7IUPmusfjqzU2a4haCSMqJPEc1SwR4yUzYuhW4XGyJ9f8tNvOn6MGOzjXad4h5i9AVbpVWGZ2WCixXC9/X6R5sYLRIIEOYc9m/R3eD1HY/09FDgy+mPYWkdNvDP0GZaxnKd6cnEdeNtXZoGWigqG+GB4t+GAqANazsfDAYLgUlGu8ZpKgqZfWJRm2TawvCcNsAPjCuSSyi/O0J0gjyACvU57aV8za3mhQ== 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=S+6txzb4K8UGHRgKsXXuETOX4D4yi7VrEODkHtmBsMY=; b=JzE+7CsGvNCAlgeJb4JfUMqPUT1zyjUROk4ci38ZzkyYrYZhvZkTTj9C0QETdZ+OFVDw58BGIws8jPyPZMBMZ6XHu5IwG4E5EAXNo9A7I6SgEzbqGNwVfTXUKQUmzmYdrZTj5oxFo7OS7ssnxVEPl5bcJjjc8Cv4dG4ea5W1MeCbCxvPcHLfG87x0HRs6Awo23WcSKl9E2xVO2Lwpbo8wFoI9LhQ+wMZ3EphA04BrpaCXBBeu03uAp1wxlqjbJvr8hzXnq8Y2k3oD43cpMqsrkMtJbes4G4HNDPysDiz+OiPEPnKhQROz7fec+QhU3YAEGM1iBzwi3vYFnnRoD3gNA== 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=S+6txzb4K8UGHRgKsXXuETOX4D4yi7VrEODkHtmBsMY=; b=KH/K9+R1eQtdrA2Q6CN3rxuWQt7X/3uydS+eReuQ/vBb/cRYgap/Ex8fjqYF+do0lDMOWXmeGKvodFn7Cgk1aY38C8boRZukg73ssjvVu05LXQHtNaVNRXnZYsOymvZnZm6Sh///OdLEuzqwD8Tl1C/86xXilGHvk3q9zcBE/q0= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM4PR11MB5437.namprd11.prod.outlook.com (2603:10b6:5:398::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 16 Sep 2021 11:42:48 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4523.016; Thu, 16 Sep 2021 11:42:48 +0000 From: "Ananyev, Konstantin" To: Hemant Agrawal , "dev@dpdk.org" , "gakhil@marvell.com" CC: "Zhang, Roy Fan" , Gagandeep Singh Thread-Topic: [PATCH v2 02/15] crypto: add total raw buffer length Thread-Index: AQHXo77sIg/VlXOqrE6sOfOO5ZWyMKuml6zw Date: Thu, 16 Sep 2021 11:42:48 +0000 Message-ID: References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> <20210907075957.28848-3-hemant.agrawal@nxp.com> In-Reply-To: <20210907075957.28848-3-hemant.agrawal@nxp.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 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: b0f05f67-614f-4df9-1f33-08d979071b7b x-ms-traffictypediagnostic: DM4PR11MB5437: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lvJdP+M096VlWY4FzX/P3F/8pfhyeIp/3BhCVn+qtda9yHzcoMSl0hGIWAjMGNtMFzRxvdKyXWnCUUkt9BKMj5TqWvuXqlZdUZunUhPI78TBNNXlusePhCdv2JsN+ILwHPX1slSbBZnJHeRw+EKRKT5bIYzdQpkObZuMWgd0BfUkcE8TUqBTfmov3+P6EjM0uDfpe7bQGOjAkjYnwMRtGy/NlWEHlRhwYDvks70buRJ7ohinGNiR7R/XCmUcihD2jRvC39S2/nXNEMEiizrJDNFLZjjcBiPTgXoFGF84VZeRs23dEuArIdlaWRys57F7OkhUjfUBjuyLg6GWjHgjQuEJjChytsr8RTnPPseujhMH4Z/KArkseodx6r7I+fKldWTABdoTTpgV/yvcencgMlc0vlyEv06xyRs4+sq2mAKaUTXi8LPDZ0l7zwxMKjImBzC0jm1aqJ4jBiKYHWB0JyO/E3lveeIKlVKGTsUR4PFeGJ7KEBZCs7NxbtLkjA+o5ZmYEDXWevSNRVIDKxFNBqWD/yMUhnRWxH86B+VLeISgPzYtiiBU1LqB1MdhK/OYLEPga25XqBaE4vSIxSaYGKoKmV1JDftFWTl1BOzbJYti/t/plIPW0JuimhcUksbktZ2xfc4hNEsyEtgWy2+/T2DZ6BmmBJWp0jkpQu4n8HkCAv1RBo5m/xbQf0CDsQggxBWmI7el04eDpIkxbmOSVw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(346002)(376002)(396003)(136003)(478600001)(316002)(122000001)(110136005)(54906003)(38100700002)(71200400001)(86362001)(9686003)(55016002)(4326008)(64756008)(83380400001)(8676002)(66556008)(66946007)(6506007)(2906002)(55236004)(186003)(66476007)(8936002)(66446008)(7696005)(26005)(52536014)(76116006)(33656002)(5660300002)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+LsHkvEyCgIpL7VkhnUsMYlQfNWb1eniNuk/xoskjuxRSuQQC0OqCzXsWLmA?= =?us-ascii?Q?iiAS4DwhizfgllxIIdFaRUldkCfxYw/So0abuKRLLjJGFYILKgERf7u8nq1z?= =?us-ascii?Q?+LUElZiNCiBeWpSW8EPKa/0C10tQBpLLNVfwZ4xLeRBXwNGp8s9RF7lT8WtA?= =?us-ascii?Q?de8O/bjK6PdpZQq1CV7jm6Cdw9Kc9XK44mZthMmuOkOHSkRFRnYqR/jDf2eK?= =?us-ascii?Q?WfXfC1THg6P33hNHcW5jA+ZFzp1MTXn6ru1BzxqCH6osr7d3yPOGiEke+Sqe?= =?us-ascii?Q?xVp5viNkfU0lQuYhj2yroJ2G56dFtcDrLuHnVFmLe7gePGAtVUe2tNJhxIwX?= =?us-ascii?Q?VYXRkat7BbHU+9Eda2WD3G4kN1r/T5gpWVUhuvcMLsRpTElL91dl1fMuWaRp?= =?us-ascii?Q?ulmQhXeHeYC8a9Pl5uqGmYGMHfAoEG9vVVwVZGMbpszn9c7T/G0nG1YNIEM2?= =?us-ascii?Q?hFco05gSm5dnNs7BV6l5xYRP0VRdqBRA0p/VkG7PNKXuSbjdKXzIbIMD7ZVq?= =?us-ascii?Q?X96GQYmb4K6k6Nzyeqv75EoVkV95+5+5isidcK2S+Xhd5m6PHoQcNG4jWp3e?= =?us-ascii?Q?6ZJOTizTv0fuoO+0BVKx/dzJbLvX6aSUnZLjR0ODVBlcrKH4nTpxpMscaUTx?= =?us-ascii?Q?tUDm9TsANTGbcRwHF/yiXiCdh5zJEYy54TaZgzK8TqQL2X8RNyGlXeDwzWtH?= =?us-ascii?Q?uODJSy9y/mf9B4y5T9OgkEAQjqqaNlMExz7F4AVzudfgsllg8gH7nvNZvuIz?= =?us-ascii?Q?IlknzbjumYEyAlzovQdDzuMybdBiPYwS+R/JZkKixYBCKnVoHTlbk2ActOje?= =?us-ascii?Q?prmeQ7GjTgA7Kv2Bt/xB3+AQNL+LoiYGPq+rl1wOAAqNem8Mng3c7ojb3xz8?= =?us-ascii?Q?1rCuzoLtoK6Wjt3vbLRmAD8w97DEI6ecgVGtptkxaYebwZQQHun3zF6c0HM1?= =?us-ascii?Q?OHc6elFTEpxt4unAoavVBEDOEvCT4a26YvPa+njp3By8FTLqJq2l0ctUbPkH?= =?us-ascii?Q?Hm2ONN2ghvxWxI3jA+umLteLRnNOlhNZsqPNKTr+JyT3JXI3sloOdYdwQ7Xr?= =?us-ascii?Q?CI2toNcYyuXyp/5eyTNDOsP226gzzGXan+NqP6ZZanDMsHJSBqOxWodDqdRR?= =?us-ascii?Q?0HatzYCpwo8gH43hZtZ8Lgh9iLyvUNgIbH4Oa1KClQrglqrAyL77qveA2TD/?= =?us-ascii?Q?c4cJ7gw0fQ491jkcsfeLSlrtMw0FMIxNlF7OqGLtsvoSjHTji4gc48Ir8xsY?= =?us-ascii?Q?dQmG7q1B937tylVNUupKeLzyqDnv8mF3ex0ucQvLWK0Yug+DJKhmmkC+pln8?= =?us-ascii?Q?FEEQJUbfiCOAP6KC+u2f5y4x?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0f05f67-614f-4df9-1f33-08d979071b7b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2021 11:42:48.1272 (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: 4jawzOmzcFt6xlfgsYsqIN1HDixW8By8NJDccDqjjyMP7BPMM5MBa/q8H8l1lpH5aWpYpqHrZc5eXrkWqL14OQWO4eFeWlJlhLCxmePACro= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5437 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 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" > 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 > --- > lib/cryptodev/rte_crypto_sym.h | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sy= m.h > index dcc0bd5933..e5cef1fb72 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, u= int32_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; That doesn't look right. We should take into a count mbuf headroom and input offset. Something like: vec[0].tot_len =3D mb->buf_len - rte_pktmbuf_headroom(m) - ofs; Same in other places below. > return 1; > } >=20 > /* data spread across segments */ > vec[0].len =3D seglen; > left =3D len - seglen; > + vec[0].tot_len =3D mb->buf_len; > 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,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uin= t32_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; > left =3D 0; > break; > } > @@ -1002,6 +1007,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, u= int32_t ofs, uint32_t len, > /* use whole segment */ > vec[i].len =3D seglen; > left -=3D seglen; > + vec[i].tot_len =3D mb->buf_len; > } >=20 > RTE_ASSERT(left =3D=3D 0); > -- > 2.17.1