Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3514938ybl; Tue, 21 Jan 2020 02:09:17 -0800 (PST) X-Google-Smtp-Source: APXvYqyZT4duMfV9NdK2cjRc5XgEdO84XlBAEVJ4w/H5I5dbUa+2ScaQtB/YyhIi8p8JRs1Am8VJ X-Received: by 2002:a9d:6251:: with SMTP id i17mr3099824otk.14.1579601357676; Tue, 21 Jan 2020 02:09:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1579601357; cv=pass; d=google.com; s=arc-20160816; b=ZHJAjvtX2ei3LivIXzOenkzh+TrB5SYe3XgQ4xkBsjj6YN4Vie1KmjdaXO6MUX272l i2rBpULmAwVo8fr5Pc4W6kx/9vnwqQYDkYcECYWFT6LYRe+Rp8g/8NOwA+j1Fp+QY6kU FvKyemkVIEh5tMSimwknlPGNwSyiCmcaLI9wAnGCkPH3umObCtV09HE018c32MT/tIel uNaKxBbBG5dxDi1KpnImMk8Lc5tnQyw3XwqA21273euK6zxpVpJVqR2STp4QrUR4gIi9 UaRhB8HWf5I3rImhPhTexXNTKI4GA4hHGTwe93dfHU7+N2VH/VSM9O3UiXDwFCMIPtVd xQXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=Vw4JK3ECOBOqOQS6fl1HZ3Z+jP0Bujttb3n8t1cuqN8=; b=OcWlJjk2C+ges1gFIvsUAA4lTBt7Z5RlvburMKo6WpB9X1svTVQC2lmXvISm8N4TJG H++nLItQZ6EkBLVvvIAO190spmkHUF94fCoPDKGTA8ZH9/t9PPXyCBYy62ycOBjA0xUe yLk9fV8MdNVfzNv95pXK/5Ch3mf++gE4qf50N6sxxnCBbTcK/tDUYDhzaknkH3uPufCh XvDvKJ/Ag0ms5Nj/dpRUmoZnqnuUR9Imw9Rx2DQ0lK8LCDhvOtBgcyFft7gWtY7zncJa gdLEvwsBu8/fSzCM4CUZXSdKsKLSA8U2D6JzEODtjmEIB+KwwHkdiCaSTyOUfgWB6WLO V9pA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=A+YazgyR; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si21249900otr.265.2020.01.21.02.08.59; Tue, 21 Jan 2020 02:09:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=A+YazgyR; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728792AbgAUKI5 (ORCPT + 99 others); Tue, 21 Jan 2020 05:08:57 -0500 Received: from mail-vi1eur05on2050.outbound.protection.outlook.com ([40.107.21.50]:17006 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728512AbgAUKI5 (ORCPT ); Tue, 21 Jan 2020 05:08:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FJJKCVdPg4IXv8PQnCbnptqP+ah3xtx/4FLjG5xj9XwQGZSy3BYjtFwhieupzXFvp9dJH4XoWxxBQhkm7DvFnhjuCZwHK+B/3KPT3Pm0XgVC0NTrERw4le1Q1/BPbrrrPFnFoNVSPY3n7Ty8BF5BCbDNOuBYlDwbS9vQJKd95e9vonD1bl801nFnIHmxYFxYtOx8Wq8Bgr+kl23RS9ETo5fHa6v6P1Yt1/eC1eAaWwGr/U92Zv3xE74qSa3M8uT++xhtsbnK2YNl0snarlpimJy+Jd8cacQI2JlypvF0Zwvb+dT5f4TDleiKPLVXk/9VrYx++p0bWdkez88/SiJliw== 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=Vw4JK3ECOBOqOQS6fl1HZ3Z+jP0Bujttb3n8t1cuqN8=; b=fXdMdAg51TZgem4bBY2yxCEPKWTLH84mpysNoDNaX3HCspPW/8bmrM0jhMni6grWtV9koWE7zCxmONv8Kwo+f83z1CJj7bMbejQdSJELyJQHNGD1nfi7wf8HEwa3znOokT/GogLBNSNM7f7B1oSzaQpVPzFsA68LW61rZzhIcF+RX6sESpSAE8AmuUoHvEodyaywfh47E6nGs9RgPXmKYdkSwNEZwsVCXvqzaQ3/iGTlPl9Fqin5gM74/D9UVQ1rnbxb6i3elwpxmyH9j8Y0ivCEXsNlOIx4DrFPrTZhrNMvSeDNb+LTe3GE/6ZBlUfK9FIoMUeZubvE2Z3huD26Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vw4JK3ECOBOqOQS6fl1HZ3Z+jP0Bujttb3n8t1cuqN8=; b=A+YazgyRgfZTybvUC0tHfEK9QWuLUWbwc2KL1RveUp2yy9CcVMZiktXia4VkFP5BNVItkUZAiuw1ovIPDdINB4VFoNGPwSEor4UGtFqcWXziPz3gYr7X//OQosx4dLPeS0Xtkzze2HLUF7TFVaAWbIrOmic/vuQqtwEunEIAX7I= Received: from VI1PR04MB4445.eurprd04.prod.outlook.com (20.177.55.161) by VI1PR04MB4606.eurprd04.prod.outlook.com (20.177.56.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Tue, 21 Jan 2020 10:08:53 +0000 Received: from VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::304d:b7d8:1233:2ae0]) by VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::304d:b7d8:1233:2ae0%6]) with mapi id 15.20.2644.027; Tue, 21 Jan 2020 10:08:53 +0000 From: Iuliana Prodan To: Herbert Xu CC: Baolin Wang , Ard Biesheuvel , Corentin Labbe , Horia Geanta , Maxime Coquelin , Alexandre Torgue , Maxime Ripard , Aymen Sghaier , "David S. Miller" , Silvano Di Ninno , Franck Lenormand , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [RFC PATCH] Crypto-engine support for parallel requests Thread-Topic: [RFC PATCH] Crypto-engine support for parallel requests Thread-Index: AQHVz+nyH19jpegvq0OzoQlSx1aIPw== Date: Tue, 21 Jan 2020 10:08:53 +0000 Message-ID: References: <1579563149-3678-1-git-send-email-iuliana.prodan@nxp.com> <20200121091102.magzogr7tnj6joqm@gondor.apana.org.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=iuliana.prodan@nxp.com; x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7df4c1a5-3303-4ee7-8fbe-08d79e59eb79 x-ms-traffictypediagnostic: VI1PR04MB4606:|VI1PR04MB4606: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(39860400002)(376002)(136003)(396003)(366004)(189003)(199004)(7696005)(55016002)(4326008)(76116006)(2906002)(316002)(86362001)(66556008)(64756008)(91956017)(44832011)(66946007)(7416002)(66476007)(66446008)(478600001)(54906003)(186003)(6916009)(5660300002)(53546011)(52536014)(6506007)(33656002)(8676002)(9686003)(71200400001)(81166006)(26005)(81156014)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4606;H:VI1PR04MB4445.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7K6NTZ0hbCFfnll2mBADtGoPLAjGnCHtkrFrVAMxtxQpLx41xZhUJqYSQnsPCvW5thrHAqWqqCMZfYFtxPJTfqZdSV0qnqI+qyy+G2WePfWavYUGVEsH0WuONpnQnO5McmdeVrBpDRwjGgeBBIzVtpXYSGlG3tFgpR6KZp7+h94bweWL+Z4Cx0v2+eqHeQVHndpvyO4r6ocpz5n6ezLCpbsHATfev766RoUzzKIP5PgxpfaEm6mhRn0Tg6T+niutXzBm6Y/iPzFqDnG+v2ZOWDEMY1aMcNMs4fFMiRLSLfUMgDTXfMRFxbB6IgQaf/MECLYkB4ghCQi1PnLhSPrXu4ZzGQ2+pr04GNJ0RaqH9V0fJKBNVIrZ7l7mlaE94Bzrt3Jn9t5pvVtdZWoRXtNK25XWp7q58E8CXfcKhm3zTxudHoipeV7U5NZmOmYvYLSo Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7df4c1a5-3303-4ee7-8fbe-08d79e59eb79 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:08:53.4742 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: S5s5BcNcYQPNBhEyz0ReyGTPvBwFHoZZpz7S2St04TLLknBggMzrL1RQSw8jsNIsOF6jGmLCfRi5UHvY2Pq/9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4606 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 1/21/2020 11:11 AM, Herbert Xu wrote:=0A= > On Tue, Jan 21, 2020 at 01:32:29AM +0200, Iuliana Prodan wrote:=0A= >>=0A= >> + if (engine->no_reqs < engine->max_no_reqs)=0A= >> + goto retry;=0A= > =0A= > We should not hard-code this number into the engine. Instead,=0A= > we should just let the driver tell us when it is ready to accept=0A= > more requests.=0A= > =0A= This is not hardcoded in crypto-engine.=0A= I've added the crypto_engine_alloc_init_and_set function to configure =0A= how crypto-engine works.=0A= The max_no_req means how many request the driver can process in parallel.= =0A= If this doesn't apply on some drivers they can call =0A= crypto_engine_alloc_init, which has max_no_req =3D 1 - this is the current = =0A= behavior. That is serialization of requests by crypto-engine which is a =0A= bottleneck.=0A= =0A= > Perhaps we should add a new function for drivers that wish to=0A= > support this that would accept a list of requests instead of=0A= > a single one. It would then process as many requests as it=0A= > can from that list and only return either when the list is=0A= > exhausted or when it can't process any more requests.=0A= > =0A= =0A= Linking requests is something different that is not addressed by my =0A= proposal.=0A= I want to remove this serialization, done by crypto-engine, of unrelated = =0A= requests.=0A=