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 F37A3A0032; Thu, 16 Dec 2021 16:06:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D721140DFD; Thu, 16 Dec 2021 16:06:18 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id DD80A40696 for ; Thu, 16 Dec 2021 16:06:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639667177; x=1671203177; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=LJNlCewOH8voH9Upu20/owhMrwrAHFHO9boeqwfgQGE=; b=lDnr49cVA5KcCc5wNNxqQYlZ6+boCJT8uDxifJUf4rdVp41z5t4u+LSB hglnczYgApObr23HjatEuRaixNgRwgmSDuFLu3gdgNVNqF1GSinvcW1C+ qSnm/j3QsmOvJXVqTRAkiYiFlgK5kkM+/HQzSULYhUAf/PeBSXbebC6Vg no8aUTHcBsOIcGe8uzzZ+e9cUBt5JM8OatLSgVyJhTO2knvcu94lkI6yz mz1LkpW+o5cUs5RUi+A2zpo4W/aTzVGnA2+N0Cgn0f+lmqSmlZ0ovue6/ 2+f21+Wlm/KeD8TEWQO9MuLZaFmQzlJCX/ph8LR718xsAD0qh1nZ2bZSR w==; X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="239327109" X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208,217";a="239327109" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 07:05:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208,217";a="611496381" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga002.fm.intel.com with ESMTP; 16 Dec 2021 07:05:30 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 16 Dec 2021 07:05:29 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 16 Dec 2021 07:05:29 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 16 Dec 2021 07:05:29 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) 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; Thu, 16 Dec 2021 07:05:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AoKq+iN+NWK+86dnRdHdDVhfUxRqZzpzQAdCJLq/r0Z3URVJCBZk7GBnb+zIzQumGsUc36FaCYgammyY2m7vJGcxBUfTPzHWkEcPiyHfW3aqsK2xVK2586oKb4pvW9LGcxA26EzBg9RwzvJWGlUMN9XHqJimYKB/wyMlyamE0hGb9X3ZeVqFSEmxCUEsJtObMAK6O05I52+Zv6itLaf+jcNQCF76YxZUIEls1YBhBZpPex2mSrtI2uLEPXLzLFrFDsKsO6+WWElS+Ugc/3pTMcLIkCTAlmfitmIusU1wpCEOGqqGaEjry+Q8QbZtkWtTyE7jerfjDMCBBX/twCT/JQ== 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=G1LRkxV172KXBDtiZf+5qK4InHrqsw7bpdifGTQdV38=; b=LuM81+s4zgGupJhMIkh7mFjUCAL1tZEpyFs2ucJ2IVs7ro5/RQTnErTwIWvMYiuhbAI3ECn4PGNQccJPMJiKLWe6K4dYl7KFZ5QBabyDGV7PGPcf6hCSFxLQiUwcwA/y2xF0YgKKIz6BI69scVRjaPThfjbq9Vv48L+L/MD74ATZW3761iO7LW4vqdUxSfSFTqzeMKifWVIptA1ezdTZFyafPRyVBWqIGSYBtHc1RO+6dP9+KfZ4slEHs/p6m+qjdix24Y5rlTgXTYt7wx5V1a4V3XAfBrTdsZyudQ82Z7Mz8SzV+kbSD9yMiHb/CdQTICnAKvfKSUrt9VA9WEMDUQ== 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 Received: from MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by MWHPR11MB1455.namprd11.prod.outlook.com (2603:10b6:301:9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Thu, 16 Dec 2021 15:05:27 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6044:ba49:2592:68c5]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6044:ba49:2592:68c5%2]) with mapi id 15.20.4778.017; Thu, 16 Dec 2021 15:05:27 +0000 From: "Zhang, Roy Fan" To: Akhil Goyal , "Kusztal, ArkadiuszX" , Anoob Joseph CC: "dev@dpdk.org" , Ramkumar Balu Subject: RE: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constraints Thread-Topic: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constraints Thread-Index: AdfoK7ceQgkAkP41RgO3JecgFn5yogH0pOlAAKP2+FA= Date: Thu, 16 Dec 2021 15:05:27 +0000 Message-ID: References: In-Reply-To: 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: 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: 9204c055-47bd-40fd-71a0-08d9c0a57e98 x-ms-traffictypediagnostic: MWHPR11MB1455:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: slCbOIBVOywqAPRAhg11QrleaSGfzHQJxtFIG289LR8JUZiIOcyi9I+9cb0HLzGTbUF1u8mRDuObHB3oANYriXOSbKnPKV5mG8qH/S+kFwLJBLP/m7uGEEeFC2b2UOx7VkCor1wf8AZ1UIq3sEsCR7Kest1bNA4e1iygKsPqH+i/1G6qovW83IcCF29pv58/2jWjCjFHpa38Z5aTcGPBALk41g1QS+5hWsDtFdGZN41d462Xh0v1fvF3ytKu80X3xU9IkaRcJoSc3OnLCt7yVGR4iHzFz0J6N0fi6Wh0yr2Xwe3SJlLI5tSDkC2PgDf8LjOY8ei1ACu0+QiC5PthptQsYxKSthI6XbPoBz+OiVLOoce5HT9GVbvH/GPlKJ+oSrJOPEejJUKEnSo6HYdP6iEQ1Jqh5pKU9vIVbvmwbM2K3Q5oyksQdCJVgBwaQrAwjrTghuJL2C3rLy2xgphvWIenQx2BxxkOJYy979mB0+gWWRVJlg0i88YjUgZtj5mh/1NlRLWb3Igs4rvsPhIzie1PZ1PyEjRedqnkrhj2rICj6xDVdilwkFeKVP2bPf6WlLsKCvbFlFjDHVWo1PHD7A37NrjgESogGuMceVJaiHa5gZoC40zBZzf3Kj40CPq6rpKeN4pIU+X/NSDbzxoydqyb+N+bsfDFqTZPLcsTV6IWC/55AssVp1dboCo+d7a8pvGlqZbDAoX7IvpDEfuH5w== 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)(2906002)(66946007)(38070700005)(6506007)(66476007)(186003)(26005)(66556008)(8676002)(508600001)(7696005)(55016003)(83380400001)(53546011)(66446008)(5660300002)(71200400001)(33656002)(9686003)(8936002)(76116006)(9326002)(52536014)(4326008)(122000001)(82960400001)(64756008)(316002)(86362001)(54906003)(110136005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?v0pkSG09kvQr58DNBM9LuPEHwvgxVXRDwQw+PHIN3SU9jRIV+TnlVAU2?= =?Windows-1252?Q?h4LnT8ZktS6jeh2zMo0qErj+dafK64RbwoRxyppm/8EVbHUIgQJ+WJ8H?= =?Windows-1252?Q?W447C584VY8yPr9ImhGLLtDYuKwXn0udiihzO/n84n057Db5IJu+qMPx?= =?Windows-1252?Q?s3VY+SWxbShBp2/lOfVmA6WL9EWcTe4iQy9MiTxT0ygPH+RnmN97QUgu?= =?Windows-1252?Q?uDQ4s+s6Ql7MMBbGUtOK8K88SXTYtvtmN6+hiAr5fCqn3Ej/3T0/9Tah?= =?Windows-1252?Q?Ks1JfUL0nktfBGjF5KEthazaWFHS3GP7f2J8za/04ZBXKdc6UUcRsKNX?= =?Windows-1252?Q?AOUom4CMTT3QdxEMG8W6etMnYAvItUAuBAvwNLH3w9LFIi4yTw8sANIE?= =?Windows-1252?Q?7jE8Ks2ZBzk3vpKqUoOG6jj2mrJFixVgAvKgCSAjkO5UqbUe534ESlyX?= =?Windows-1252?Q?dNYy+oEcD2lXE3JCadsqXlaianU2Wo9ui/9Z/7gTDL1NUmJxXs8JzAvt?= =?Windows-1252?Q?TnUlvigGZivwHlv8yFvBfP8ol/H1z5y+BbqwyzwNAneVfZsmXOlxiFKa?= =?Windows-1252?Q?S79crNQykOP2k7iYdeubs7i8F2HDu5YTTOuZLqL3GrNTzLtatyCzPFsQ?= =?Windows-1252?Q?csCSX92cwFy3gaHZ7lV2b5fmAzT6eMYBB3ecbaoospKxHlruwoPzVpJv?= =?Windows-1252?Q?FR+XpsfzkFUwRRsJG9FrphLa/Cn6F/ZWq3MH+VEB61o/l/XlFxGuefNe?= =?Windows-1252?Q?q+F8WpFljaAP7oA3a0fvq66JjopTPBKtamHCYY9zP1ldTEg0zaHIkg1T?= =?Windows-1252?Q?Cygr3Zl9iQrW2nKXbnlaQ9McEZRUDbclEarIGNz/pYxpor5hZXCvxgAc?= =?Windows-1252?Q?+qBuxynOvOgCXmFCaIN5APkRPRe/4Pu2lojMboCdbuPMpv3RoA/EzCTX?= =?Windows-1252?Q?zYFXlysHJJkmCMrHjMDSAP/9/FfjSHMhD8qZ3vU2y3yFyqX9Ao/OFIfj?= =?Windows-1252?Q?YUDM8N7XfvHPHiyUUxdcD4+NwX/MtwJqL2XFAwBlxAhvOQoLpUXHTMbI?= =?Windows-1252?Q?nWAwBhVe2Pt/5ZUOsI+d/4tu/CAiUBF9m11xJEwQlq1OEwOYrcZ+Cx/r?= =?Windows-1252?Q?Pu6MEyPCr1p6o8tuINnFmZe40A/K/9RcWY1T0pae/wpNZIWPYWRdEvpH?= =?Windows-1252?Q?k1R/6HLoitLy2QZ1nbT0OZZLhtUI+35EpBewslfh6vVABMrgE1a5Jm8U?= =?Windows-1252?Q?UGVu9+oha1nD1Hy0yBS5iW1NUHo130BZL/68JrUN7pLNFA+vV/YZ4iN7?= =?Windows-1252?Q?Fw+GtsH7bImpYzXc4IcGaHcRl+bV36tdshgzwv5s69Co6/Btp27aCmUX?= =?Windows-1252?Q?n9Ka+ygnRg3GA1+QG+jSWriT5mAbfJQSn9Hk2EuErbnLTUirPqDVOnRG?= =?Windows-1252?Q?BhlAWg3m5JfvHtEKDFH6SHgIkqpxaGYO+EFXkLm/xwdN47lscP8TRTzC?= =?Windows-1252?Q?sqC6y/KhP4BjW5JsUgsYVmNBj3uFsaxUwVfMiLajxdOJ29DZChWw4AIv?= =?Windows-1252?Q?ON09i9OkiMYtSIRUbBQVNY/QjnRq02L4CppYUsIWGc3aq8VUdrY94Laq?= =?Windows-1252?Q?UOLAexoQQWpI9iT1L7dJB7wE0kXMY/oQbHGGOqg6ckkA5gy1xkEK3qZ8?= =?Windows-1252?Q?dQ6RQ7KnOaIL2C54cKZ9+okUv2J2j4n5C39647An+O1YylzJeebKnHxk?= =?Windows-1252?Q?a9WvOfznp4j7Z1v70ao=3D?= Content-Type: multipart/alternative; boundary="_000_MW5PR11MB58091D714A6DEEB9AF3C27DAB8779MW5PR11MB5809namp_" 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: 9204c055-47bd-40fd-71a0-08d9c0a57e98 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2021 15:05:27.4755 (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: cPQ0Y1bRXE5BEn7RyulZ1dYREI8MFAvlGpzu7spgxsKJcSDu4dn3CzyByB845DnjM6CeJz9VMVHobuOdR77GGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1455 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 --_000_MW5PR11MB58091D714A6DEEB9AF3C27DAB8779MW5PR11MB5809namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, From: Akhil Goyal Sent: Monday, December 13, 2021 9:36 AM To: Kusztal, ArkadiuszX ; Anoob Joseph ; Zhang, Roy Fan Cc: dev@dpdk.org; Ramkumar Balu Subject: RE: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constrai= nts Hi, since DPDK 21.11 is out, we should start discussion to make asymmetric API = stable. - Struct rte_crypto_vec vs struct rte_crypto_param_t We have two almost identical functionally structs, one in _sym.h another in= asym.h so we probably should pick one of them. =93rte_crypto_vec=94 additionally contains total length which will be usefu= l information as PMD will overwrite =93len=94 in many cases. Unfortunately as =93rte_crypto.h=94 includes =93_sym.h=94 and =93_asym.h=94= not other way around we cannot move it to =93rte_crypto.h=94 but asymmetri= c will include symmetric anyway so it probably will not be that big of an i= ssue. [Akhil ] +1 [Fan] +1 - Network byte order rte_crypto_param dP; /**< /**< dP - Private CRT component * Private CRT component of RSA parameter required for CRT m= ethod * RSA private key operations in Octet-string network byte or= der * format. * dP =3D d mod ( p - 1 ) */ We have plenty of these (sometimes in places where should not be, and not i= n places where should). Every member that contains this comment here is a b= ig integer in big-endian format. We could simplify it to: /** Big integer in big-endian format */ typedef struct rte_crypto_vec rte_crypto_bigint; rte_crypto_bigint dP; /**< d mod ( p - 1 ) */ ED related algorithms like (EDDSA) will use little-endian bit integers so i= t will have to use different approach. [Akhil] Using different approaches for endianness may not be a good idea. W= hy can=92t we use rte_crypto_vec for LE? It has a void * data. Right? [Fan] Akhil, do you believe a comment before the param is enough? --_000_MW5PR11MB58091D714A6DEEB9AF3C27DAB8779MW5PR11MB5809namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hi,

 

From: Akhil Goyal <gakhil@marvell.com>
Sent: Monday, December 13, 2021 9:36 AM
To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; Anoob = Joseph <anoobj@marvell.com>; Zhang, Roy Fan <roy.fan.zhang@intel.c= om>
Cc: dev@dpdk.org; Ramkumar Balu <rbalu@marvell.com>
Subject: RE: [RFC] Cryptodev: use rte_crypto_vec, group big-endian c= onstraints

 

 

Hi,

since DPDK 21.11 is out, we sho= uld start discussion to make asymmetric API stable.

 

-     =          Struct rte_crypto_vec vs s= truct rte_crypto_param_t

 

We have two almost identical fu= nctionally structs, one in _sym.h another in asym.h so we probably should p= ick one of them.

=93rte_crypto_vec=94 additional= ly contains total length which will be useful information as PMD will overw= rite =93len=94 in many cases.

Unfortunately as =93rte_crypto.= h=94 includes =93_sym.h=94 and =93_asym.h=94 not other way around we cannot= move it to =93rte_crypto.h=94 but asymmetric will include symmetric anyway= so it probably will not be that big of an issue.

[Akhil ] +1

[Fan] +1 <= /b>

 

-     =          Network byte order

 

     &= nbsp;         rte_crypto_param dP; = /**<

     &= nbsp;         /**< dP - Private = CRT component

     &= nbsp;         * Private CRT compone= nt of RSA parameter  required for CRT method

     &= nbsp;         * RSA private key ope= rations in Octet-string network byte order

     &= nbsp;         * format.<= /span>

     &= nbsp;         * dP =3D d mod ( p - = 1 )

     &= nbsp;         */<= /p>

We have plenty of these (someti= mes in places where should not be, and not in places where should). Every m= ember that contains this comment here is a big integer in big-endian format= .

We could simplify it to:

 

/** Big integer in big-endian f= ormat */

typedef struct rte_crypto_vec r= te_crypto_bigint;

 

     &= nbsp;         rte_crypto_bigint dP;= /**< d mod ( p - 1 ) */

 

ED related algorithms like (EDD= SA) will use little-endian bit integers so it will have to use different ap= proach.

 

[Akhil] Using different appr= oaches for endianness may not be a good idea. Why can=92t we use rte_crypto= _vec for LE? It has a void * data. Right?

[Fan] Akhil, do you believe = a comment before the param is enough?<= /o:p>

--_000_MW5PR11MB58091D714A6DEEB9AF3C27DAB8779MW5PR11MB5809namp_--