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 CCD90A034F; Mon, 7 Feb 2022 15:22:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6A26410F3; Mon, 7 Feb 2022 15:22:36 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 839AE410EA for ; Mon, 7 Feb 2022 15:22:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644243755; x=1675779755; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ri7wquBeN2DPNPFGXNp+upjS6GhGNkhUIfUI61m+yOU=; b=N3YoE9j0NyA2Xa54BNY9tDuLw6u4svyUcLIBmhXkVSbcyKDdcoJWbQpy O2fpTd4VW6UtSTrLLMn6Fvmn5LmxbcjctWR+mi0z6kr7jRpEb+xBy2QlN ZjUq2vQBsnd7TNJuznCqNku4sEaP8DktHytn5cIzezknMB3AtjyGhBmEg P7wJ3z/w5AtBPExQOrhE36tiNCvBLXtEgObjLUZ0TkuWs2vQSxVK/+fVZ rsLfLJPL5PMW5Yfz8+yS9tFMlGGVGS57HPIrUAZEocnXJpT8XsW3otAvi XIxxX41VYCBhgzcAnPEavTpOis/cSOsusMTLR6Lid5FHxnsRmdh/t9SoB g==; X-IronPort-AV: E=McAfee;i="6200,9189,10250"; a="228694565" X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="228694565" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 06:22:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="770647573" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga006.fm.intel.com with ESMTP; 07 Feb 2022 06:22:34 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 7 Feb 2022 06:22:34 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 7 Feb 2022 06:22:33 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 7 Feb 2022 06:22:33 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 7 Feb 2022 06:22:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDVo+rQR4uqBFjpZr3HSp6sZXyVAGWROhS2tZBRR5ZHjPg4ZWcmjvZSGH8/t7PPHDzbp2+m2/BHoKDhpnq4gc5LMqTQEPMAJEt+7KA9a6QVsKfBIrWvM3kjxhUcvYrNOcRCRWzlfbmRY9AjNUixHhxrmGMEi/5/+0AaWSHC3ytr7b0F/gW9Ok8E1bfhRrAywyTcL5O34GKuTSdYekw1xundKH2RerB5lmxArasWsoi7vgBVetwn5i/ino1a0xs/o/xzqzaCGX8fS8JgoJQUo/dhFGz2VD5s5a8bpf3/uu8ldAQroUBLR5rJ8Gb9wV9ZGarEYur2uTLqp3Td/kqD7DQ== 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=ZJFCXnm2hLezlgWGyE0eEvdoCg9A3F3U05y3H/USftU=; b=TBNEvxDfUixXfRv+YY6Z5z99Tz9i6/F8ySWxo10F7cgQo94N2ImxuCkWIsrUKWGrbZCUOPyVbYiX2on2U1f6EnZ6MDBuyjrj3Kqh2XkgEONiBRODVAnrYVy7rneOhcBhYjdJDHtPKLNj7ZB4NMRwga7yxSXSjxtwWpY05qMShRPcJnV70yMisD3toQ/UAbRz0L8Few/hQG9DKHhX7SvkBEN0EtglDw6GC8RnNCkXtx7YzlUTjKWM/D5VWVY0/QcnqM8MSE+iQ9JgcuBQY0YQ5sEkh4xBUH16/q+FA+duOYWZfDBnRKJT76p8ZQjNrOecWQeGNxAjTepPqDolZCVr3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MN2PR11MB3821.namprd11.prod.outlook.com (2603:10b6:208:f7::24) 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.4951.12; Mon, 7 Feb 2022 14:22:31 +0000 Received: from MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::4fd:a9c7:1eda:c93d]) by MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::4fd:a9c7:1eda:c93d%6]) with mapi id 15.20.4951.019; Mon, 7 Feb 2022 14:22:31 +0000 From: "Power, Ciara" To: Akhil Goyal , "dev@dpdk.org" CC: "Zhang, Roy Fan" , Anoob Joseph , "mdr@ashroe.eu" , "Doherty, Declan" , Ankur Dwivedi , "Tejasree Kondoj" , "Griffin, John" , "Trahe, Fiona" , "Jain, Deepak K" Subject: RE: [EXT] [PATCH v3 1/4] crypto: use single buffer for asymmetric session Thread-Topic: [EXT] [PATCH v3 1/4] crypto: use single buffer for asymmetric session Thread-Index: AQHYGRfuEL808ODXWkqMWGcLXEKlo6yHxMKAgABiZDA= Date: Mon, 7 Feb 2022 14:22:31 +0000 Message-ID: References: <20220203160449.1638311-1-ciara.power@intel.com> <20220203160449.1638311-2-ciara.power@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ddbbf86c-b781-4740-c205-08d9ea454704 x-ms-traffictypediagnostic: MWHPR11MB1869:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AHXCgTsQzkW1z9SJmcVqV8K9MojLksiSRVbW7whtoYK2Q/I/dUQ6oUFdU+1y9pFBhADp9OitNxSFkxNE1aQbmQvsKjwjFtydVpqq6iNVnoiUs3ofniucIp99r0tpOZAAvjOhuwp1Ui6o/d4/y/iGVbywxKUAA46N90UAHFyyfmUeMI4iyaHec27Y2mp7ipLOMJT3AHvfO4RbRfaTTLO2F2VCy6A7wHYv3CQsApvha1uSrM2ohAbseFazBirAFPfDdTQ69SM7CX4l96iROltp08WCIAN9J1XvXrRq2BMuhV+yiIJVbk5vLyGIZWjxqBm2hOqBPdlzv6lf/rBs0p9+lPgCM9FeSZfHo53NgOGC/fXFqSwSRWCpoP7T6DBOAVdvCV4pIKeV32L2jxWxFY7rqGiWQXleXO4c9TYU8bIhYHzc2QdFIHuPtXi9HvaEtxLfS7XoyXBDrvTu9STW9nsrinDQGY9A3cMUK61DIkKH7kPiPQAJUouF/l/HFVJ9BXudpFfbI0UgcnUn55zjtg3WswBkS9g8dgud6NZPP/jU635uHEzVaN10Dctn8XQM28BlMk2OM3lIMNnEgQj7dYMFUJ4kC3E3Oz/xqgvAILs0/E7dQCVDakgx+2FshjzRq97wKpc5IQv20mIFu8R9AeX779If0DLuKa8R2+zSqXflV4R6njmLZiTunbROUqgIhqiRTAn9AdxtmPhEiI6jlzl69w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3821.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(107886003)(186003)(26005)(33656002)(82960400001)(38070700005)(122000001)(38100700002)(83380400001)(86362001)(66446008)(64756008)(52536014)(66476007)(66556008)(8676002)(4326008)(66946007)(2906002)(54906003)(316002)(110136005)(76116006)(8936002)(55016003)(5660300002)(6506007)(7696005)(508600001)(71200400001)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WJ2cPqqLvdzXdAW6dCN0e1OsJDG4LL2ZxHAfgByJkZbzqoGBuD638L45Gr+7?= =?us-ascii?Q?vJnL+DOOoMJrgzAMtZN/7DFrG0DDH+KoZBY9/9l9mNmkNS3Q8Y1qUAI2cJFf?= =?us-ascii?Q?zo+o/hFQzv7Oeak68lEpj/2GIW8CBhh+HCw95C56y7Lzp3uXc1/XIfPAEWbS?= =?us-ascii?Q?/1aKyP85CvxVuScuKZm5KS5HGrDMRi9v6+yFFgOOs8gtdkUoTtKL7PSVU0up?= =?us-ascii?Q?PlMo/1KTG09ZFi3hL//Z/ZNiHzOh18ay6OyH2D5CvwlY33fXZbmywiheW/O9?= =?us-ascii?Q?EJHly3ClamQJTmjBdT76NpiVaK46NihEVWoxCbf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5sTECrRzINsafvESsh5siCX+XKg0OZ4a2boA59rrFv9450KZnN?= =?us-ascii?Q?RciFZPnIINNX5W6sFRCK0t2MMPXtmq6yyY6dPMLqdkJgGoHbGhWi29VkhEyx?= =?us-ascii?Q?Vc2PKh1+W24+s92awmvcJNqs8mhiizqbNg5QktjE0GT7Cw40xuSqUGctZgk6?= =?us-ascii?Q?lJWKb3MOU1Wea1r4N14wzuUGBiGrIYnIoWZAnGgmEFIv4TT16v7Tan6y6JqC?= =?us-ascii?Q?6pjg+gCw0iz6IYelxEbriu4ZS2t/tMtiWKQF+em1+3w5kAmmaHIWWLEWOF6h?= =?us-ascii?Q?0AHTQG80WxRxpz9CRdbkCnfp9hc0gEjfifufbtCweRNsiOf1oMCtlBz8tXEE?= =?us-ascii?Q?p4l6Hu2H3SpYLPekuLFN6EpqehrUKo76N/uU1+6ng++30vWrfGdCmh/QNoG1?= =?us-ascii?Q?LgtOhOL3VkWLZQgf/dmFFDc=3D?= 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: MN2PR11MB3821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddbbf86c-b781-4740-c205-08d9ea454704 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2022 14:22:31.3835 (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: t4tttdYbuY+p1yH3svwF2gtOsXF/vPQDbTTx6PueiA/Bqo6VNPq996Dwvwd1HRQOW7sLYr65N6gEJV4lB/jCyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1869 X-OriginatorOrg: intel.com 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 Hi Akhil, Left some replies inline. I will address all other comments in v4. Thanks, Ciara >-----Original Message----- >From: Akhil Goyal >Sent: Monday 7 February 2022 08:20 >To: Power, Ciara ; dev@dpdk.org >Cc: Zhang, Roy Fan ; Anoob Joseph >; mdr@ashroe.eu; Doherty, Declan >; Ankur Dwivedi ; >Tejasree Kondoj ; Griffin, John >; Trahe, Fiona ; Jain, >Deepak K >Subject: RE: [EXT] [PATCH v3 1/4] crypto: use single buffer for asymmetric >session > >> Rather than using a session buffer that contains pointers to private >> session data elsewhere, have a single session buffer. >> This session is created for a driver ID, and the mempool element >> contains space for the max session private data needed for any driver. > >This means asymmetric ops are not allowed with scheduler PMD. > [CP] Yes, currently asymmetric isn't supported for scheduler PMD anyway so= this shouldn't be an issue for this patchset. For the approach to be applied to symmetric crypto also in future release, = the scheduler PMD would need to be reworked to align with the new session u= sage. return NULL; >> @@ -1919,10 +1957,27 @@ rte_cryptodev_asym_session_create(struct >> rte_mempool *mp) >> return NULL; >> } >> >> + sess->driver_id =3D dev->driver_id; >> + sess->max_priv_session_sz =3D pool_priv->max_priv_session_sz; >> + >> /* Clear device session pointer. >> * Include the flag indicating presence of private data >> */ >> - memset(sess, 0, session_size); >> + memset(sess->sess_private_data, 0, session_priv_data_sz); >> + >> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops- >> >asym_session_configure, NULL); >> + >> + if (sess->sess_private_data[0] =3D=3D 0) { >> + ret =3D dev->dev_ops->asym_session_configure(dev, >> + xforms, >> + sess, mp); > >The mempool object is allocated in the library layer, so why is it need to= be >passed to PMD? PMD cannot get mempool object. Right? [CP] Yes true, I don't think the mempool needs to be passed to the configur= e function anymore, same with dev, these were just used to allocate private session data before I believe. Wil= l remove these parameters altogether instead of leaving as rte_unused. >> -/** >> - * Initialize asymmetric session on a device with specific asymmetric >> xform >> - * >> - * @param dev_id ID of device that we want the session to be used o= n >> - * @param sess Session to be set up on a device >> - * @param xforms Asymmetric crypto transform operations to apply on >flow >> - * processed with this session >> - * @param mempool Mempool to be used for internal allocation. >> - * >> - * @return >> - * - On success, zero. >> - * - -EINVAL if input parameters are invalid. >> - * - -ENOTSUP if crypto device does not support the crypto transform. >> - * - -ENOMEM if the private session could not be allocated. >> - */ > >These error numbers should be added in the create() API. >I guess your subsequent patch is doing that. [CP] Correct, the 4th patch changes the return values of the create() funct= ion and adds these errors numbers.=20