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 C0FA3A0C43; Fri, 15 Oct 2021 19:45:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87DAE40041; Fri, 15 Oct 2021 19:45:40 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 36C654003C for ; Fri, 15 Oct 2021 19:45:39 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10138"; a="215123044" X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="215123044" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 10:45:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="488515834" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga007.fm.intel.com with ESMTP; 15 Oct 2021 10:45:37 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Fri, 15 Oct 2021 10:45:37 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 15 Oct 2021 10:45:36 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 15 Oct 2021 10:45:36 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) 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; Fri, 15 Oct 2021 10:45:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bS7wq0LmLquTc44ZyGcSUsr4IiP2eDSrTxzerRSGdOYHLWkbPdpZE8rVuihWHnt7Wtb+i8Ats6VwZyRh9rrHb6Dm1j612HuGvg3cdmt1Eu11kMo6H5vIDm7YZ3lYFkRRoUllwelrNrsw1L08CbJwaCLqv4YF4zWfIt2Vd7pRGnvkuAf+r1EhpVRl2PsjgTHdEFpO4nrWrHLVTuZfKanfigTce0LfR0XzMMCN50SYE+OO4XvzQJv6fhZmyFVkpHNJcrLnC5U4OF78knJ/7oqt5LQ6XjR+l8fdfZ42y7BH3kcTnB4EIiF3/m8ImWnVEu+SvD5W3YsJLPPA+3uTsXhQhw== 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=U+VJemTr/VqCjM+mdZ6MkYaM5FhbdkGwfbJNlF/L6G0=; b=EKRGBXaG7iilkTg1lX1wQgUqDLJS5+jyNEFn+RkWjNHj8O+zikOL5vf4Ls2P/Bi8QGu2uIjctfQX32h0xbpyXXAea6eWlN2hfTxuiXSuMrFpcYLMzxvv+CthXVUUjNvtRPe/qfJebOgb+npaIXZ/cFD1DSBy33iG/husqVL9KeNSPyeXj8dcUQYQTmCkFCrdnuQPEa4qo3Nm9FPcu0/BM000gx9ozzYvewfi4TbfZiSDvZOwreLzxqXMsMRop83KolSWk1CyMCcVttfrUdnSbAVQ3kiFHuxUu0VfmJEbAx7oWsE9lu0zlTvkucB6gR6Z9n9TOGWkw3iPkjtP7w2BZQ== 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=U+VJemTr/VqCjM+mdZ6MkYaM5FhbdkGwfbJNlF/L6G0=; b=oAyy3u8tnyXyiEeb6/KHiHzbZuoyuJBbIOs9Yj1+IbXiYf1aNavoPNAQFGbRBUrvStfSzehjp4SM775PJd9LAm0xInKVd1X/N5ILsy9dMvwVxB8Uj1bckSll8v3oYqGooLjygeMsSn9pOdbzODGlnwKzFE7A+cnPv22xPbDlqXc= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB4547.namprd11.prod.outlook.com (2603:10b6:5:2a1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Fri, 15 Oct 2021 17:45:35 +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.4608.017; Fri, 15 Oct 2021 17:45:35 +0000 From: "Ananyev, Konstantin" To: Hemant Agrawal , "dev@dpdk.org" , "gakhil@marvell.com" CC: "Zhang, Roy Fan" , Gagandeep Singh Thread-Topic: [PATCH v4 02/15] crypto: add total raw buffer length Thread-Index: AQHXwGVEMUJ4ivyO+kinLMegcjsWQavUVp5A Date: Fri, 15 Oct 2021 17:45:35 +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: 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: 89fa7e81-5140-4635-a9e0-08d9900397bd x-ms-traffictypediagnostic: DM6PR11MB4547: 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: +sMrscb2c+XvG8yBuQh1br1fr8+ILefahU1JhSe1GikXt3dV9CN9QHok4x9g0zWu4u2ucEOhf2pwdzDaZI/uuN/XCgYukR2+y4wlGDRnKdnsSCYQfv88Jx7tnpC93iEwYoesUhvVFJBv4Z/Y99uoispaetHtr03bjSwe3no1dQuWLBQg+PJuj9vX75qmkPZs4xAYjoT/kqOb4RSGNcdPc3cLSs7B6Lx1l2LkIvlGu5UEwWZ/qwoabJX84lclllBqxwjYoB12yzn8pqZHhMPdV6L/nl0z0y8ZW8rSGr+GSRe8qTgReU4wsHMQXnP19/18F7f8GrLIuZWbL4ZxOtGgim1NK93VyVlHmVUGf7zod6xnxroD/D9Dj+6uC8ilIlOqWYsBWhrEH0o07krPwXlt/NCZ3KLvIon30S9lZgJwkbGh5rkd5YaXgOvxFj7+jDknQeFLLu/3sEbEK7+k18z6nHHlTccNHdl1lVw+B2XatOPV73lQFGa4RClI3aCcKbnrIuvZwO077fW+FhG1qpHVcjYD7uyMCnpjnpiA8l+yW5LJ3GX5OyhKkYlmLYCQh1eLSM/ew7Zjva1TZDPvLFnqdqTXY+JIYXqWixubVFL6RUpZXELykNDDPi493Zz/auMqU65gu2H+SJwx5R2QwWo2yEGnExBeX+yLEZUO8tycv5WSDetCCqm9QqUwIe9f9823zZ95Cjt9L+BUnwq/0TYO5w== 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:(366004)(76116006)(71200400001)(9686003)(83380400001)(508600001)(8676002)(64756008)(38100700002)(66946007)(55016002)(66476007)(66556008)(66446008)(52536014)(86362001)(54906003)(4326008)(8936002)(7696005)(33656002)(110136005)(82960400001)(5660300002)(122000001)(55236004)(38070700005)(26005)(186003)(2906002)(6506007)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hq4SKhKe1z9SCiyhCwpWAWBEk6OgQQLeNEPDeu46pgNUx3jpPQ3FszxBX8oq?= =?us-ascii?Q?ZPtvZDcNPuttmOrHk2CaZePqJwmVjnctyK5rSFJhF2Vm6Z8uzcqDsuO1YlYE?= =?us-ascii?Q?WyR4gzbdoSBvrQ5cF+kXnjxz29fLyuzzsFSvibyQyr//qkeqtG+hXSgC6FD4?= =?us-ascii?Q?Yf386T0ICHyiIt1ks26M0zupSXWPgK7Oho0I0Du2c6P7X73vNqzO1G/V93iJ?= =?us-ascii?Q?zP2qIJSYs3TfxUhi9dY5VCe7xYoqgky4SEyaHfUIHDpB+Sjtxg69CiTY+8HM?= =?us-ascii?Q?I8MaqUy48xf4utFHvDUEqrkUDNvr3cZ14BMyuJ8dk/n10DH7l94n5KPhFAN1?= =?us-ascii?Q?ZS4n9QZrCEZEzKJVqQmjMuF6sbB6xQrPz4aPo8A8NkGhVa/kchwhPdV3850K?= =?us-ascii?Q?8Fq1NqguPScjBDOFVwc01igKwBz1fdm3wU7k1XkxcwdaEZBAcLHuWEynls7W?= =?us-ascii?Q?N1Sj8eVr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: 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: 89fa7e81-5140-4635-a9e0-08d9900397bd X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 17:45:35.3367 (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: OImo1aWD17B74Hw039w+dJ0dfprQ31zXcFeHdJZvCsRWMpEAYeZdEL73US5TEVmeQB9ZdCf5ToLLGMY/yNjZRcH/vYPDHqB3Fm+8tKw6lJw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4547 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" > 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 encry= ption. > - This change is targeted for DPDK 21.11. > - > * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and > ``rte_cryptodev_asym_session`` to remove unnecessary indirection betwe= en > 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_sy= m.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, 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 - 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; As a nit this line and similar line above can be merged into one and put before 'if' statement above, i.e.: vec[0].base =3D rte_pktmbuf_mtod_offset(mb, void *, ofs); vec[0].iova =3D rte_pktmbuf_iova_offset(mb, ofs); 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, 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 - rte_pktmbuf_headroom(mb) > + - ofs; Same as above - these two lines can be put as one before 'if'. > left =3D 0; > break; > } > @@ -1002,6 +1008,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 - rte_pktmbuf_headroom(mb) - ofs; > } >=20 > RTE_ASSERT(left =3D=3D 0); > -- > 2.17.1 With nits above applied: Acked-by: Konstantin Ananyev