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 CC2CAA0032; Mon, 13 Dec 2021 10:36:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C5C4410F5; Mon, 13 Dec 2021 10:36:10 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A3EB340E09 for ; Mon, 13 Dec 2021 10:36:08 +0100 (CET) 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 ESMTP id 1BD7j4H7027709; Mon, 13 Dec 2021 01:36:08 -0800 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cx21kgbwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Dec 2021 01:36:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RGDmZkM9D2qIfOVgSddcSzCHFB/iGRJn8HmPk8WQmueESX8W7nEeA0Sn04C+Kun4vKUgxSs95LXtiVVxV3DIqE8IBG8jvIcQLO+6NPEmP1Iby4hdihiNfq0u41etOHdCsGWz+6mU6tBDpIMU3Wj7Nw5C1wDXVV9gt9/C05fjqD573LsJ+4FAODQ+XWOBERz9wLoo0hQc1/nqgBkCkTppn+JS2X4XqsAktVyf1HqgQFnu++vRs27vSMOzGO3rxsdioqeMvroW8bQpDsDPx65dW9eTGZB/2rxY1Sem+gJMnn65O+iweqw6WWJdBQf7xH7zUSkeY/JqOKQupiXgrHq9Cw== 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=o+/4UVjd61NdYEcOgP9sfTistzxtHOlEb4/QAeOqpD0=; b=PTeWf/OwZUfbqORkjv0Nriwj02qsYXEoHw0vNP0zVt6vb9BGOHu5Fmc1ivFGz2UwmnvgUnqRgwQ6a/pGUgsPUYhwa77huI6T8LTkwaHjU0GGqxn8dYKLj/FvfhBHKi2irejR9wqRivvYtmHFukfzKkTCkUcJ0ROgIV89h33Rp9pWyMX7ApiJ100b5eBQqO7aKf7FKR+bxgsQfvQCn/ASb8oRmeZBQswO6Wxj7f0+i1DlBuUPeNo6dGyk+EPD5oHU2NUipIrnVuu/eGujfJA3uA++rJoyOwy/Q3EplauBIv0UQSegJGAXlMEPKZXJGgU9P+xd+CrSLfowMISrRWHm2w== 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=o+/4UVjd61NdYEcOgP9sfTistzxtHOlEb4/QAeOqpD0=; b=VH6tkmGAe2XlOZzoQtfK3jioa9IJXTe0lEx2e1QjmHx7zbwTCE535/RWIQq1t9kw7XJOYD80OuYEisRG68Ic7ZZLwEmlhuD9bDTN/wnex/91W9X5uThZBOxiAdUA8cyqVULJlaMBgIB4YMbWV+mZSHi6Aj01stAQ3i6Y6ZYJIc0= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4777.namprd18.prod.outlook.com (2603:10b6:303:ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Mon, 13 Dec 2021 09:36:06 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c074:d988:9c2f:896d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c074:d988:9c2f:896d%6]) with mapi id 15.20.4778.017; Mon, 13 Dec 2021 09:36:06 +0000 From: Akhil Goyal 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 constraints Thread-Topic: [RFC] Cryptodev: use rte_crypto_vec, group big-endian constraints Thread-Index: AdfoK7ceQgkAkP41RgO3JecgFn5yogH0pOlA Date: Mon, 13 Dec 2021 09:36:06 +0000 Message-ID: References: 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: 3d52459d-f621-42c2-9ba6-08d9be1bfc9f x-ms-traffictypediagnostic: CO1PR18MB4777:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +agpdwXDOMu5BOC50/TLQjR+JkrEVJ3+vJmgxy6ni2H/7tkh5yqQ/Zm3AhkQqxdyS+dXzvDKKS6U3J1Hv557ApO1AkxSMh3zkfkj21Pkxv/jStiodpSQewoHfseTAYHGl459WwKSgdMGaJHNj2aLBOsKNXCcnKB/eZPelA3ofLW3MPN5Al+j3F6SSu7k4gCx9zWXftetYCxp2A+RGCw4ANJ27MfLZONARn8NFnYfIlQ4jIgxhPZKTEregTirs3iMip5CkmYWhbPqy/+mc30KeLnBC6ydP2ar8z3Sm2WznIf3T6MiNnLzhWp5TQLGe6uw3sdDnf0z9LNJck11Ov/8dWyBU/Vc2ZL04oCeUY95F5VxF5dEGazMXYGLCZ4KetaeNdJOcnN2XT9HqF1JRPZQtNNsv8COVrpLj2+ZoEW3R3CLglVLQ6u/lJyL3fiQDJ2Np821KaL//g0/B+uDhJgxv98+lve7djOii27+bfqrJ1VvNjnqC3dEgOfiRvPMtEVjqu1RM+qqljwe6eyFrWyUJF3I4aFNycQS6S4DyefAku/08kXdK9ZiM9VAjVDJUShbJEIcum3rWDZoncxLnoIRZWbYBECTxrqfsISRbqjlRLSkyciyI6d2R22Wjc0obAri8PShcXvAT0HNxNjXy/vxmQqYzRhOUL0aYLfD+slcTtXY2O0hlzmPIKMg1f5swrhIQtIL6vTeXe6eUSfJp2bxdA== 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)(52536014)(83380400001)(8676002)(26005)(38100700002)(9686003)(2906002)(7696005)(8936002)(86362001)(9326002)(107886003)(38070700005)(122000001)(55016003)(66476007)(76116006)(6506007)(316002)(66946007)(54906003)(66556008)(110136005)(66446008)(64756008)(33656002)(71200400001)(5660300002)(508600001)(4326008)(55236004)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zMS1j8a3xgSVifKFZVj2rlpwd1is7i2v2vyqzqAyRGE/Z0njMLz8MNM91SdT?= =?us-ascii?Q?3Z/v1thNihpYt90Jy027rEhTrmZVtzj3WAsk+2CuAKdr4AIc09B62I3Fq8mK?= =?us-ascii?Q?M/NbLotjB89J6c4Nl+iu/8nutDAUJjhxF7b8UMMI1XRGtrUoSf826iPL7qpr?= =?us-ascii?Q?BkwopGRKi7xCENiI7JLmrZ8fSWI6KGCrFcPYceUdulO/Pu+wj94W1YElyuSl?= =?us-ascii?Q?8HOvaIqT191lnJSiX4UIDznJNLPXqMbZm8gRaSUrk2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la10Vh1sCFhDkWSeaZTmK1n3Aw5o7XPIVWmroiwOjDhLtk3N?= =?us-ascii?Q?T4uTl71kEPmDZkgP4FvDpDyahVrfExG8zHgXvkJ476VwiB6DyM6rFeUc3cGD?= =?us-ascii?Q?IxfMJ11p5+njTYpo/StrIxuOg0iN30WWp85HzBfI70tUEXGgY7g8BhshyjVP?= =?us-ascii?Q?YNoUmQm/p+huJs1H6PgOtimgLgceCyJJ0uvMTRNfrdCtENIFWy+SzJswgz/b?= =?us-ascii?Q?dFImYARlVEU4Fi/k8WiTUAOxZHCWxyxmVsl81luF5Ne5QqbB+wIlX8Yc9NYm?= =?us-ascii?Q?EOcs46IKGyE71rbsuqkrBF9WPUNRCNvkIWFDlKBmRP8BmX5IOBkgKFQV37RH?= =?us-ascii?Q?bCaPZi5nPetIWBNe0mMvINVB4FTQD0N2DHan7fO87iLDrllXHcEfxxs2RL93?= =?us-ascii?Q?pejkzFCVBxymPY164OnI65D/9wK8zOO98sUWGzXp5a1v9Mxa1XtEtiGkV6wj?= =?us-ascii?Q?4E+PTRxbAhVvR+U11TJAETE=3D?= Content-Type: multipart/alternative; boundary="_000_CO6PR18MB44847ABE63F064A315E71D94D8749CO6PR18MB4484namp_" 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: 3d52459d-f621-42c2-9ba6-08d9be1bfc9f X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2021 09:36:06.0392 (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: tUVk3icc9LB6Z/yBYuWm0ZtM5S0ydfmIhZBxL5Ol26eyIXSyiPsXsmF6iO8kUF2jAqYZVF2qk/mGnwA12cyzSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4777 X-Proofpoint-GUID: nO-bc-VXNSWbbRi1D9C1_CpP2neXyLIz X-Proofpoint-ORIG-GUID: nO-bc-VXNSWbbRi1D9C1_CpP2neXyLIz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-13_03,2021-12-10_01,2021-12-02_01 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_CO6PR18MB44847ABE63F064A315E71D94D8749CO6PR18MB4484namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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. "rte_crypto_vec" additionally contains total length which will be useful in= formation as PMD will overwrite "len" in many cases. Unfortunately as "rte_crypto.h" includes "_sym.h" and "_asym.h" not other w= ay around we cannot move it to "rte_crypto.h" but asymmetric will include s= ymmetric anyway so it probably will not be that big of an issue. [Akhil ] +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't we use rte_crypto_vec for LE? It has a void * data. Right? --_000_CO6PR18MB44847ABE63F064A315E71D94D8749CO6PR18MB4484namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

Hi,

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

 

-        &nb= sp;     Struct rte_crypto_vec vs struct rte_crypto_para= m_t

 

We have two almost identical functionally structs, o= ne in _sym.h another in asym.h so we probably should pick one of them.=

“rte_crypto_vec” additionally contains t= otal length which will be useful information as PMD will overwrite “l= en” in many cases.

Unfortunately as “rte_crypto.h” includes= “_sym.h” and “_asym.h” not other way around we can= not move it to “rte_crypto.h” but asymmetric will include symme= tric anyway so it probably will not be that big of an issue.

[Akhil ] +1

 

-        &nb= sp;     Network byte order

 

        &nbs= p;      rte_crypto_param dP; /**<

        &nbs= p;      /**< dP - Private CRT component

        &nbs= p;      * Private CRT component of RSA parameter&n= bsp; required for CRT method

        &nbs= p;      * RSA private key operations in Octet-stri= ng network byte order

        &nbs= p;      * format.

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

        &nbs= p;      */

We have plenty of these (sometimes in places where s= hould not be, and not in places where should). Every member that contains t= his comment here is a big integer in big-endian format.

We could simplify it to:

 

/** Big integer in big-endian format */

typedef struct rte_crypto_vec rte_crypto_bigint;

 

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

 

ED related algorithms like (EDDSA) will use little-e= ndian bit integers so it will have to use different approach.

 

[Akhil] Using different approaches for endianness= may not be a good idea. Why can’t we use rte_crypto_vec for LE? It h= as a void * data. Right?

 

--_000_CO6PR18MB44847ABE63F064A315E71D94D8749CO6PR18MB4484namp_--