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 66AD2A0C46; Mon, 20 Sep 2021 21:28:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA8DC40DF7; Mon, 20 Sep 2021 21:28:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2AFF240DF5 for ; Mon, 20 Sep 2021 21:28:29 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18KD9aTR016648; Mon, 20 Sep 2021 12:28:28 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-0016f401.pphosted.com with ESMTP id 3b6ascknd2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 12:28:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R0UHCE1llbMnG455c/kMt7kfI/6wsXT/AiHoJtG7iGyTqyR5jGrssCXEQF01+0W7tyyKyvR/Zb8JcSMenFNhORSyDTLzeMYqmDCSFk3vW0cn94OLNbgkjiSy6j+TUwasfznbYENHiV1kxcqNnysOCbCreevowVZYmSljfp6vp8YfX1Wcf2AY8sx56PwsX2Mff8Ob0TbsNxA5UBXEJ3RxXNn2KPVetThc2a2eUrIfDbdIVoB5BAJ4oyoQ2raKcB6w9NtCLgJmw9fb6y62g9iVsSR6qf15AnT584mbnk91OfiIkdnGq3WZ4vOEegAZdbUB8uDQKEtsdhpBJKbzlrPH8w== 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=fTAdNOvpZb03/KG2POgMXTNDly0D4ZmBO4QNunQcAsQ=; b=ECKOJ40LjL+/gOyH9Nd9ICkOkG6g3mscqG0YZTPDNFITazJOSo1CsrXJmBqcm8wbKClWN2a9xxMg3HymkIxQCe10PCbaushGYBRmCm4YqvQ8HmNqXXzNm7/YOwZMuBmSD0syxiE75PEBxHm9ZWTpsBkrNxXgF2+Ws4RTfqVeXzzN5Nm0ipHy5QJEAbP+BHVdMoB/sZPa7NqE7P76P6o2/NZK25xIfVEjY97tp1+by9dWV4yNCZb7tpqUphC8rN2bLXq9/XVLEEoU+z03Rt/QMHjGPMlu0e4hY5T7mIYR3c6z8JGZFcyCORQ7sLSztlXeYs4cQNnvDPPBdd+gW/yJvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fTAdNOvpZb03/KG2POgMXTNDly0D4ZmBO4QNunQcAsQ=; b=C6ePAq9qyrtEuQfA9Zv7ZiWrKflzFTpLksGBTLlPWKRqQAIBk636G6WKhy/VoDFDY+WRVJsOzYAXvgJTrN+e+RkVYMgu6XbB18Utc86E+d8A4Yk9ejWaQ8A3TGp41nN7I8DdnFJ/AFkEcw/L50RsW7ZgrBELvMf39GKizd9FXKE= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4516.namprd18.prod.outlook.com (2603:10b6:303:138::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Mon, 20 Sep 2021 19:28:24 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::f068:d9c5:99fe:31cf]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::f068:d9c5:99fe:31cf%9]) with mapi id 15.20.4523.018; Mon, 20 Sep 2021 19:28:24 +0000 From: Akhil Goyal To: "Ananyev, Konstantin" , Hemant Agrawal , "dev@dpdk.org" CC: "Zhang, Roy Fan" , Gagandeep Singh Thread-Topic: [PATCH v2 02/15] crypto: add total raw buffer length Thread-Index: AQHXqu/90QLGkmiDbUyTXeSKBZJb5KutVB0A Date: Mon, 20 Sep 2021 19:28:23 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: afcffb73-7a7f-4ac3-8458-08d97c6cd04a x-ms-traffictypediagnostic: CO6PR18MB4516: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XCCFSkIFI6wXi65YUzxADDnTZr3Z7yeyCoaJaKqCKIBFQSONqseHRtoRx56tfrRkgB8jzCBonUByLTAzMCBkQmJ5B+dY53KHrTn3r3cjR2dU5dHTYMGAlSyU+2QoKjfeCSQ7UihbZe0ueeeShMQD4THYAbaW/JEU2mlrJ11WuQSe/+O00L18IgK6vLq7TwUV+l9d0YMfNSCi9WR0BlPgKOuXwxJYZd2AuIW6aBKuSEuZ/nFIMig8+ggEiQvnjJDil/Qda+0n7Vkka6SuPnkIhoUk+fat6SOBsd/WYG2VrqIfMGauQldGJIYE5xibdvZwqYcICC4azDvG1qLw6pU3P6UD7la7D+e9kZxaAs3hGAnjtTd/Y/ZFHaNXWYmTd3B2H6+Sx/F1Tw3tHN+lFZqRBcOCWW+aTSxphQA1AMuN/iBoCzwqPJJg1eTr9jyNy6zczZ2uuP+iOcIjFf5Vxm3a8gNwlETqdkVs9W3awJZFMWnvADSHHCxnIwV52tK4HxScMwKtCqo7h1cZdUS2U4HSORmUioJepbK4QZXHDNpfFUkTn/iJIrWM6sG0RidWT+SKkQzCDY317/8zwrMAu9L9zh83m66cgvCKa3HmrwaCFh0LAz2x8hZDuwK/vhz/gSOGaIJKnw6UxCS/MLgU0xUJmeS9ZukkJOQCkYF4aj/EN6PNQzGMSduDuQPrMwfw9ffeBRzAPZ1WlnuA6lGUnKxUZA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(508600001)(66476007)(66556008)(64756008)(86362001)(76116006)(5660300002)(66446008)(52536014)(55236004)(54906003)(33656002)(110136005)(7696005)(38100700002)(122000001)(2906002)(71200400001)(186003)(55016002)(8676002)(26005)(9686003)(83380400001)(4326008)(8936002)(38070700005)(6506007)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EccX9fme2WkA4en/OgXVCF3t6TtJ97ICCugpqLbfNRWXbSwci1ircyHEb/N2?= =?us-ascii?Q?PWXBNVqU/z8G0iDkj5kgQiJfi766rRZdlJMdDeMnOzZ2N5ecE3ueu9aKGbDK?= =?us-ascii?Q?wr7jIN37jzrfXvLWelfIEOFoYCzWePQIZTtJCKFX2WtvbOutcA8+RQSgJE+g?= =?us-ascii?Q?+9e6EwLpI8aKYJ7BfAxQrBh7AJ62CEN1a0hOEBCL5pm1X5eHNbtnh0IKwCxG?= =?us-ascii?Q?ST5Pe093AqZS1WwxR+soIy3SiKAwKOT9AwLwKQtDAcOHq2Fr3SBKYOS0kEL0?= =?us-ascii?Q?yN29M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eukurcCIXVXqyZ?= =?us-ascii?Q?MDT6yoaGYOEOPBfes/Y7CJEOxSnPMTmzH1A+y6Cf0xRREZPTLm5jOJ1xBq8O?= =?us-ascii?Q?Hk40hJiTdsmOFJE+Ejj7u1HlsF3mS7bYY9coJzuxnOwHe8seiXR1cRlUbRZK?= =?us-ascii?Q?TdaoNpds2hVYUaeS2WL1BxGI?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: afcffb73-7a7f-4ac3-8458-08d97c6cd04a X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2021 19:28:23.9923 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YRXEWPwJvYk22O1Qafx0itxsCH/VY1KFkXmF5ertTK9lqLBwk4s/DhPSb1DncK61vK6fSqHhrL5SjYJR3rbHdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4516 X-Proofpoint-GUID: OS1KggFRz-SXZcVj_5vgicYOZgcUw4tp X-Proofpoint-ORIG-GUID: OS1KggFRz-SXZcVj_5vgicYOZgcUw4tp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-20_07,2021-09-20_01,2020-04-07_01 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" >=20 > > From: Gagandeep Singh > > > > 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. > > > > Signed-off-by: Gagandeep Singh > > Acked-by: Akhil Goyal > > --- > > lib/cryptodev/rte_crypto_sym.h | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/lib/cryptodev/rte_crypto_sym.h > b/lib/cryptodev/rte_crypto_sym.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; > > }; > > > > /** > > @@ -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; >=20 > 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. >=20 I believe the packet can expand into headroom based on the protocol support= .