Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp684728ybz; Fri, 24 Apr 2020 07:35:58 -0700 (PDT) X-Google-Smtp-Source: APiQypJxeBVaRUXkHowcPFHVDwDyAYwEG6KxiD4fHNllN9i6c2hCghzwLAQUgT9gbxZ2F1XWdBao X-Received: by 2002:a05:6402:b03:: with SMTP id bm3mr7207849edb.299.1587738958339; Fri, 24 Apr 2020 07:35:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587738958; cv=pass; d=google.com; s=arc-20160816; b=aupXjbfLJI5jMSmh7aY78AvXiIRpLhnK2hFI5GbJCGi2CmWyH5E2izDY00JKxuLktR k90MfzyabmMx0XSkp3bWZ965Gzgk0aBhs/ViuRECNG0ZxDfji9rVBjiTndkCQ2SN/imE Bog1ESbscNgJjCqxVCKbx6jbVsGt7KSK3nS41kWU54mQx0+Q/l5hcarqGP4vcSYVFmo3 VERwSZLvTQpT7nwZPYYnOvvJPQtxLo7g4yEtPIC6Kqo1yK2+PtkjqvoJGQo3TB3AOFP9 pWchD7eUW1Y4NhfVEJejbP162oKb5uHDosPhl48XllgQRQg5jIU/deO/YswjADcwfoar ApWA== 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=FKHp6yD/yG6XY+x6f2fDDlHCKv3M0iULGlnuN6GjnAI=; b=c9Jtnx+xh22U7wnCVHPpSB1oXDBsk/XHySp2RwONxwMpDiWE4OtuVZLF/etpeVi35U T5tBmWqGJ4JRsSRuHeBYwgDqBX5dYMqfx6fq9X92unj8r7TlzEO9LgulEWqkTw+gwZZz dG7AYqk6D89fF322cHBQ1/TRKnvJkRd4DI1SQj4L9Fho/Gsvbsa5JjxDstdakNViboWw Np99J7H8FIsEaozVHHv2KdCwY21Twzf8MTam8ndDLKAV+hG0W9YzEujcsIuNUeX48MOD zW2ln0oev/iPaPxR2cvETyKVGHZqhHy18Sum3FgP/J2O3NThspg5siYqmRmIdPnumyJG ScEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=d62+MBKQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h14si3578748ejd.424.2020.04.24.07.35.25; Fri, 24 Apr 2020 07:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=d62+MBKQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S1726908AbgDXOfC (ORCPT + 99 others); Fri, 24 Apr 2020 10:35:02 -0400 Received: from mail-eopbgr60088.outbound.protection.outlook.com ([40.107.6.88]:14336 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727123AbgDXOfA (ORCPT ); Fri, 24 Apr 2020 10:35:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNYONhvfq+/yhEd4q1kkywIldPEMxQtBgK/tJH6knaUg7VEiVTsRXo4HqiTbTpFD8eig1SVd4+j14G6ayKusp08WVesVG6XWy7CszYr7289Ee/MBSX9Kn3kqxaxi+n9Br82hQ+cUJWwGzxuX+G3E+MNuli/RLhZ23r2pgcnTNz4b+q6a2/yKMK2P9bHH/6H83OnKwUVmqSgwG7GYKxpAWwgFTYmPoUUBIgZUdVsk2ADh8XI2JmoWkiskIrqGfqVXR2TJ/cjjkshW7nH+zcK+JBnENZDhSCX5Z2whuCKOF+3RrIqKb6foVtk1naL5t3jQq4rgbf3mnAeXwHQV1l7LWQ== 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=FKHp6yD/yG6XY+x6f2fDDlHCKv3M0iULGlnuN6GjnAI=; b=YaTz3elnrSSCxw8EnbiDc9/WhGjBQ/4zfn5b6cOk3fdY+ODz5VNhXuFjgbtkuwf3YK9l64Vk+3vPMv7A+1n4dqslxvbBTTrRzcqn7N/Dcx0CuZJVbnGqJWX3dm+Fc2cnSKOhLI62jzWEU/Bx0MaR5rKpcAONHcoYe1G9ieZ82TmJyUm4PhsTqLoQkTuGQ0tHgDordb2mcdvsBwmwsh1RQVZclyTr9vviK87sau50z7iUHluRy2IcOkGeW5oERoluDJ4e+LsTOG2Uc5yCboOMa0Drk8b2OHiX/tEmO+Xov/PSJENhW+poGbLFA/bsUMF5cqvJl7jUZZlKmVotoFH7ew== 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=FKHp6yD/yG6XY+x6f2fDDlHCKv3M0iULGlnuN6GjnAI=; b=d62+MBKQ7vBCi87sCPAO2BlGuDKu1P4RC992HNp6jjwQZVPeBEDX7QkfpiTzsU3IQFNh5F3QUUT4iCRL1bhVKy5rE4y57xFIepu5MSVkwlEbNav8Pu5g3eaQjtiMyL9GAIzjmgVouzr7+z6LKvqJPPAHJ5Km38eQWH0IxpNR0dg= Received: from VI1PR0402MB3712.eurprd04.prod.outlook.com (2603:10a6:803:1c::25) by VI1PR0402MB2893.eurprd04.prod.outlook.com (2603:10a6:800:ba::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Fri, 24 Apr 2020 14:34:57 +0000 Received: from VI1PR0402MB3712.eurprd04.prod.outlook.com ([fe80::c465:f38f:6be3:5d97]) by VI1PR0402MB3712.eurprd04.prod.outlook.com ([fe80::c465:f38f:6be3:5d97%7]) with mapi id 15.20.2921.030; Fri, 24 Apr 2020 14:34:57 +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: [PATCH v5 2/3] crypto: engine - support for parallel requests based on retry mechanism Thread-Topic: [PATCH v5 2/3] crypto: engine - support for parallel requests based on retry mechanism Thread-Index: AQHWE2Qot8PxFDaTpUuNLpWYBZnAxA== Date: Fri, 24 Apr 2020 14:34:57 +0000 Message-ID: References: <1586982375-18710-1-git-send-email-iuliana.prodan@nxp.com> <1586982375-18710-3-git-send-email-iuliana.prodan@nxp.com> <20200423114640.GA14399@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: [86.121.160.118] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1ea1808f-10d0-4042-215d-08d7e85ca998 x-ms-traffictypediagnostic: VI1PR0402MB2893:|VI1PR0402MB2893: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 03838E948C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0402MB3712.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(136003)(376002)(396003)(366004)(39860400002)(346002)(8676002)(2906002)(8936002)(186003)(55016002)(9686003)(66446008)(6506007)(6916009)(66556008)(66476007)(7416002)(91956017)(478600001)(76116006)(64756008)(26005)(81156014)(53546011)(66946007)(5660300002)(44832011)(86362001)(33656002)(7696005)(54906003)(71200400001)(52536014)(4326008)(316002);DIR:OUT;SFP:1101; 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: Ery8rdRWfvn7rMZHpG4hlFNn4l4b/sumGjU8GJU/5xMddVg64FW9X1RZolfcRp9riZMX4ZawvwhgzYq+AHs9G/4jy4yKnnqGa586c92Zp67ftCENvGLgkUSKTnAOCh4t2mPdRr016lzJXyvCqU7/FcBnZ831Dbx2t9JufyRiCgCuLm0QeWvBnQTLAV7ZaCBiLpEcWUE1XSbb1Zq/8p3DvhacCr8ctQk6WrRKIW43cWOL8G0Wiy0UC4o31unLF/nLngApfbnT869k0BUTJ+iji0B/7h33DF/XnvUVXGCFtqlWHDpRR1p8rb03+9PMxaAATuXRKqg0a4b9Zc2nQ/1vhEQmvCNW/HGRzxto5sUOkFmyolKWIzth8L6iyJUEp6YVV9MUxaDGBO4tZtHWiEQd8vnIO1GaJZhqGyk9rYSUq2RJe1XD/ZotAoXDbYVfF5sr x-ms-exchange-antispam-messagedata: gt2Ngd6aQlu3Gf83v6J9RB68UWXUXHOhZqo9leM5Q/jrHoo6hxy80KK9iyDR2OQzb0ba99m5K+424CmuOEbfdEwyuMXamI85N52AlcUYIffAf8WQ6HZ6uquLSCph2ohoW9NZ6f1MsJ319MH/8hru/Q== 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: 1ea1808f-10d0-4042-215d-08d7e85ca998 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2020 14:34:57.5101 (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: v4ifUf9S6go6yQacbJpnnJn/kX6wBMehWGuq+72rZAEh7Mtl7TjyL/Xskr/wUsyN8VfgQZsnOsdPGHJjL11ebw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2893 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 4/23/2020 2:47 PM, Herbert Xu wrote:=0A= > On Wed, Apr 15, 2020 at 11:26:14PM +0300, Iuliana Prodan wrote:=0A= >> Added support for executing multiple requests, in parallel,=0A= >> for crypto engine based on a retry mechanism.=0A= >> If hardware was unable to execute a backlog request, enqueue it=0A= >> back in front of crypto-engine queue, to keep the order=0A= >> of requests.=0A= >>=0A= >> A new variable is added, retry_support (this is to keep the=0A= >> backward compatibility of crypto-engine) , which keeps track=0A= >> whether the hardware has support for retry mechanism and,=0A= >> also, if can run multiple requests.=0A= >>=0A= >> If do_one_request() returns:=0A= >>> =3D 0: hardware executed the request successfully;=0A= >> < 0: this is the old error path. If hardware has support for retry=0A= >> mechanism, the request is put back in front of crypto-engine queue.=0A= >> For backwards compatibility, if the retry support is not available,=0A= >> the crypto-engine will work as before.=0A= >> Only MAY_BACKLOG requests are enqueued back into=0A= >> crypto-engine's queue, since the others can be dropped.=0A= > =0A= > This looks a lot nicer!=0A= > =0A= > However, I do have one little issue with the error case. I think=0A= > we should not lump all errors together. For queueing errors, we=0A= > should requeue regardless of MAY_BACKLOG. After all, we don't=0A= > want to have random packet loss just becayse the queue was full.=0A= > =0A= > For other errors (e.g., a kmalloc error), we should requeue the=0A= > MAY_BACKLOG requests and drop everythin else.=0A= > =0A= =0A= Do you refer to the error codes returned by do_one_request (which sends =0A= the req to hw for execution)?=0A= =0A= If this returns:=0A= 1. 0, success;=0A= 2. -ENOSPC, I'll requeue it regardless of MAY_BACKLOG;=0A= 3. any other error (-EIO, -EINVAL, -ENOMEM, etc), I'll requeue only =0A= MAY_BACKLOG requests.=0A= =0A= Thanks,=0A= Iulia=0A=