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 CD072A0547; Sun, 7 Feb 2021 07:52:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C06E1606BF; Sun, 7 Feb 2021 07:52:54 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mails.dpdk.org (Postfix) with ESMTP id CD15840147 for ; Sun, 7 Feb 2021 07:52:52 +0100 (CET) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sat, 06 Feb 2021 22:52:51 -0800 Received: from HQMAIL105.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Sat, 06 Feb 2021 22:52:51 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Sat, 06 Feb 2021 22:52:51 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 7 Feb 2021 06:52:51 +0000 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 7 Feb 2021 06:52:23 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.52) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 7 Feb 2021 06:52:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZLB6A0O9K+RUiTYepvyKntMAPRxvBRlKlU2wDQPVPwFGw1s3lDB+9h1RJV1WRUP1nP2w04XBAUHToaywb0yBhPKEKq7ZyRbKLwkyZzU1JlvTGWkjQyOkh+BP6jpnRbM5q184p9LRIq795esE+EFKy3FVuedQ3z4I6Hnkdpt0vb0mYam4YPyjCMsS4jcoL23n4TSuEbXBUDRy3Nq5YaRIStJyPaQkCJR3iindCpymXudn+ZjomBiuoW3KPR9OVImrU0TxFe7EW/ZVnq4DmonJ0qrUa38Ou0dBpmqXDIrqrYXwd+pmJLDy3QiOCfH0uKWFLLlGH7FCD70qZ+xjUbN6pw== 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-SenderADCheck; bh=HJvRDRdqbT+41WR4Grwp8veLSAxxF3oBeuBMcC2eEgs=; b=AEqgojHHXW7m53+i73UzIIwkefF0DyD90Ogm2e1+KzZuQQnkTUP6XpwWQ05g9e7Ev395BMTFkxTmpcrSBSA3F7+o/NwRIO3P6ZWYG3oAuw685SfJkbvGd8s7MD1qhRfLhbHWCSOOUKNEsgxcJySd0zO8YX9rEgeValcLeOE7OjrrLrPIcrKnoWAGOZI2f52N7MBmSNwXnEQRFQF1cuXZRK/ISM9M2EG8UkVABh+QlLbW+qy2/KA1AdwzVgaB/Ll15jOKgVb8enuQa++JQmvB3J9WXHdg8frU1izkJMMFDmNjx6wLuMVp0fpYW3VM43/nfFgVu6xqEvXZ0+Xe9sINkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MW2PR12MB2492.namprd12.prod.outlook.com (52.132.180.19) by MWHPR12MB1535.namprd12.prod.outlook.com (10.172.50.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.23; Sun, 7 Feb 2021 06:52:21 +0000 Received: from MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::680b:7b85:ef35:433b]) by MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::680b:7b85:ef35:433b%6]) with mapi id 15.20.3805.024; Sun, 7 Feb 2021 06:52:20 +0000 From: Matan Azrad To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "Doherty, Declan" , Somalapuram Amaranath , "Ruifeng Wang" , Ajit Khaparde , Anoob Joseph , "Griffin, John" , "De Lara Guarch, Pablo" , Michael Shamis , Nagadheeraj Rottela , Ankur Dwivedi , Gagandeep Singh , "Jay Zhou" Thread-Topic: [RFC] cryptodev: support multiple cipher block sizes Thread-Index: Adb9GivmnMR0qoPYRA6xoQvjXoPRkA== Date: Sun, 7 Feb 2021 06:52:20 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [109.65.8.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 024badab-3848-4bdb-01e9-08d8cb34eab1 x-ms-traffictypediagnostic: MWHPR12MB1535: x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: t8cOAvWcQ6N4yupXmiZqiJzZN+Q8CLgWhE7nn5Q3eSwru/vFQ7KG80rlLA2riGe+ww5DHt++8wldtO9xaAizuzYV09G3iC82cXJ5cPJUAsLptwCuU6Yo/fEX6H5PAFjSxHyA6W3BWLGdtigLYCxEqrymw3nXyqjU+qtR232JgMEnvg+kKhHNCaICYXuW7tQHaA2Qa9Mt7Jg9Z/0de4szcopdnOqgWDZjuGZ9HN51P0TWwmK28gn2S7dDIdnpSJE7XBTIZuEYuQ4HLAtF8i//HfvpdzCbPLWIpIm0UsQ4+uF7IMLbrS7ssvrJrw+v42v7dvnAT8wzP1eVlgkb9rMSTsK2gzmekQ51LVI7RojJH1NT3jWK+x0lyWHDCsK7CW7M5UTfeMaI4E8tWxFESEtNR5nJWWOsATlFF/p+jhQb6LHYJ6kMEnDtEgZv4+l/NiFj5O1vJxp3rEMXF2JwTFBkvZ3FARFCjMalWmiruHaHCbwD2JVHp8s+B/5V0suU+jPuhih8pVf+56GNOcav9jUNEg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2492.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(39850400004)(376002)(366004)(346002)(5660300002)(33656002)(7416002)(66946007)(66556008)(86362001)(316002)(7696005)(52536014)(53546011)(54906003)(55016002)(9686003)(8676002)(71200400001)(6506007)(76116006)(186003)(66476007)(8936002)(478600001)(66446008)(83380400001)(4326008)(26005)(64756008)(110136005)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?DPQGeFwc60xJ1BQPX25s2gk1RVloag/+QZJ0kpuHdBOhxHSigZm8Sq/+y3oL?= =?us-ascii?Q?4llRfZ/bAiBLIhDx4WofzuSVNUlj/7O/NedcJdD3HkyflVCay1XXTJn2tvY9?= =?us-ascii?Q?lElxxCbyCxbwkrQ8pJL/gsB6UcKP/VQ8tmib3a6sq4ye1nT86rOC+yW+eAd2?= =?us-ascii?Q?L8rCHzHOT4aEgdnkTL3wBKhkl9kwpyFHOkIJ9YhIyDBX1EyWDxpopW1CWmPe?= =?us-ascii?Q?09kRahi9ScD2TLURrHCkWT3ZmDlfi5LX7uIePyvkD00g3NC3Q7OegmuQu2Uk?= =?us-ascii?Q?dsXNZT7fC7A6RdbpmMENB0Rv70PZkIyWIbOOc15eTrNjzyTOYMM+cIj1KJA6?= =?us-ascii?Q?f53jt+Ls98+g5E1d60Wt/y2utUI0fFngh4qFs6IJM6EYf/ZldTVflKUVs+mG?= =?us-ascii?Q?dnEZUCpeKkjBQr0eKYPou4ehAVnTaokH5VEwe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= x-ms-exchange-transport-forked: True 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: MW2PR12MB2492.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 024badab-3848-4bdb-01e9-08d8cb34eab1 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2021 06:52:20.6593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: frpGuOJ2r1oHx6nHFp5uojc3UR5ZyrwB9Wm3ouvXgbmW0lRPinIV0NuLjTxQcmb+paEqo4Cyjw2S/RT6qMA8iQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1535 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612680771; bh=HJvRDRdqbT+41WR4Grwp8veLSAxxF3oBeuBMcC2eEgs=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:Accept-Language:Content-Language: X-MS-Has-Attach:X-MS-TNEF-Correlator:authentication-results: x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-header:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=qk0jLWSRvZp49pv9WHHqOSs9KWMQUg0m6xEFnAKiTvmXOkgTmPOlKSb7mgaF1+rUF iB9mcfGahHGhmG3uKSc6p4nCJYZMYqXQsiL2amffPe4CDJXLeHijS4WirdzhOeBf7E RBn4q98aPCU2//r/26qxnS7rbST5Bj6E4cBvwWd7oP182ThsoojG7uMFYS/pkSXqFJ 45ugN0pq9fvmeU25NNqqfvRx7hPPPzApX5OfcUluVy7rDHrYbrYCbMJ6/6HSxVGX5X gzqCGQJ5qL9+WtmhncbcQNpRLlvBUZ8s/djiZA86Jn/NdysFZ0JG0dreu+2IRJe1Fg yLiYqbpimwa2w== Subject: Re: [dpdk-dev] [RFC] cryptodev: support multiple cipher block sizes 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" Hi Zhang > Hi Matan, >=20 > It is a good idea to be able to show the varied block sizes of each PMD/a= lgo. Yes, this is important agreement. > > -----Original Message----- > > From: Matan Azrad > > Sent: Thursday, February 4, 2021 2:34 PM > > To: dev@dpdk.org > > Cc: akhil.goyal@nxp.com; Doherty, Declan ; > > Somalapuram Amaranath ; Ruifeng Wang > > ; Ajit Khaparde ; > > Anoob Joseph ; Zhang, Roy Fan > > ; Griffin, John ; De > > Lara Guarch, Pablo ; Michael Shamis > > ; Nagadheeraj Rottela > > ; Ankur Dwivedi ; > > Gagandeep Singh ; Jay Zhou > > Subject: [PATCH] cryptodev: support multiple cipher block sizes >=20 > [SNIP] >=20 > > +#define RTE_CRYPTO_CIPHER_BSF_ALL 0x1 > > +/* All the sizes from the algorithm standard */ #define > > +RTE_CRYPTO_CIPHER_BSF_512_BYTES 0x2 #define > > +RTE_CRYPTO_CIPHER_BSF_520_BYTES 0x4 #define > > +RTE_CRYPTO_CIPHER_BSF_4048_BYTES 0x8 #define > > +RTE_CRYPTO_CIPHER_BSF_4096_BYTES 0x10 #define > > +RTE_CRYPTO_CIPHER_BSF_4160_BYTES 0x20 #define > > +RTE_CRYPTO_CIPHER_BSF_1M_BYTES 0x40 > > + > > +/** > > * Symmetric Crypto Capability > > */ > > struct rte_cryptodev_symmetric_capability { @@ -122,11 +135,19 @@ > > struct rte_cryptodev_symmetric_capability { > > enum rte_crypto_cipher_algorithm algo; > > /**< cipher algorithm */ > > uint16_t block_size; > > - /**< algorithm block size */ > > + /**< > > + * algorithm block size > > + * For algorithms support more than single block = size, > > + * this is the default block size supported by th= e > > + * driver, all the supported sizes are reflected = in the > > + * bsf field. > > + */ > > struct rte_crypto_param_range key_size; > > /**< cipher key size range */ > > struct rte_crypto_param_range iv_size; > > /**< Initialisation vector data size range */ > > + uint32_t bsf; > > + /**< Block size flags */ >=20 > The doubt I have is limited block sizes 32-bit bsf can represents. Althou= gh it is > good enough now for AES-XTS but it already used 1/4 of all available > representation of the different block sizes. If we are to include more bl= ock sizes > for different algorithms we really don't have much room left. Yes, there are a lot of options for block size combinations, it can be any = combination of values from the standard minimum to the standard maximum. I don't think there is a type that can potentially include all the options = classically.=20 For example, using `struct rte_crypto_param_range` is not good for PMDs sup= ports values with different increment steps(mlx5). Do you have other suggestion? Using bitmap is not so classic but have good advantage: Any bit can represent one combination, current suggestion is to use any bit= as continuous range but actually it can represent any combination, so any = PMD can use only 1 bit to represent its own supported combination. Also, It looks like the values are common per algorithm, am I wrong here? Due to the fact that the supported combination is different per algorithm, We can define the bsf values to be different per algorithm. what do you think? I though also that a new pmd callback to check if a value \ set of values a= re supported is good option too. Here, the application can check if its wanted values are supported or not. For example:=20 The arguments will be a list of values \ a list of value ranges and algorit= hm and the PMD will return the first value supported for this algorithm in = the list. What do you think? > Also bsf seems to be a duplication to existing block_size. The existing block size defined to be the PMD default\preferred value for b= etter performance - can be good knowledge for applications. > There should be a better way to describe varied block sizes in capability= . >=20 > > } cipher; > > /**< Symmetric Cipher transform capabilities */ > > struct { > > -- > > 1.8.3.1 >=20 > Regards, > Fan