Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp62247pja; Fri, 22 Nov 2019 03:29:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyKdVRfK7JJ/M94WKd0igTuPXXQTeM0PGSUC5b1vn4vdn/Dsi8lAvPuWGKHCZcNg7zh1BaL X-Received: by 2002:a17:906:e289:: with SMTP id gg9mr21478910ejb.71.1574422145197; Fri, 22 Nov 2019 03:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574422145; cv=none; d=google.com; s=arc-20160816; b=D20o/LhWCgX6G/3049wLIjZdps27ty59T+SVHSnW4Xuw5m8Iuupg/njYynhFDd1JSZ wn1tZpmSj1cQXPl3ncdpHvbHCrLxu36DSp+94cv7BxTYRbH04KQDmcMqa9I1d5089L9Z qRRLKCG+SEUZPOSfVboujcUpWa/qnFg6kWnTKhaxgCrU+ohLgSq3LdzYFzSi0JCAeAem TyHkbGGbZkkUCXpx3nHtiiLaCboG6xCx+OZjW6mJlDU7b6bLIiQ4ZE1Vtz2HE5K+zSc1 1xkETECKm9aYNPUStkcsiq1+DWCJGrWhyqVyreW+YJ1khbGs2OrHrZVXtsijjsTeUieJ pi5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SP/z9R8xDg3H1l3VX6oUP+JQ5rn2iBApO0mYwsTMGq0=; b=CF4ERCaLqrvq6QhMIVG3Vm39tjQd6rrhN57HVGFSxlkzIeC+QFft8I//U/anMIP7TN //j2JeUR/gLSOCQ334ULRT37GRu4YLKdLkm6VUH3XVB7wSOzrzGOUNrrtgi0C5HKvRuM mxtBAhXxfK5aZ4N+UtyPXhaqh9Kqb4xD+DkFxLI1IHL8yQWigdaAE+0xgU4Uqxq3DcFL r5Ts9fl5Y3rgKHCkxolInrsxDkDHQCvV4vCc/FG+V6ZV/baCh6jC3EWFwMTHXHGxSSQP tzjZIEvCCT6FJv7QZE8tHxXh9a/VqAmidJEoBCk6Y1ps8dg6YLFBIwQ+89bSK3R2dUWd ybRw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z24si4632944edd.127.2019.11.22.03.28.37; Fri, 22 Nov 2019 03:29:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbfKVKdS (ORCPT + 99 others); Fri, 22 Nov 2019 05:33:18 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:51288 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfKVKdO (ORCPT ); Fri, 22 Nov 2019 05:33:14 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1iY6FT-0001nK-UT; Fri, 22 Nov 2019 18:33:11 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1iY6FR-000578-8W; Fri, 22 Nov 2019 18:33:09 +0800 Date: Fri, 22 Nov 2019 18:33:09 +0800 From: Herbert Xu To: Iuliana Prodan Cc: Horia Geanta , Aymen Sghaier , "David S. Miller" , Tom Lendacky , Gary Hook , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: Re: [PATCH 08/12] crypto: caam - support crypto_engine framework for SKCIPHER algorithms Message-ID: <20191122103309.wf2hg7km45ugzzhr@gondor.apana.org.au> References: <1574029845-22796-1-git-send-email-iuliana.prodan@nxp.com> <1574029845-22796-9-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1574029845-22796-9-git-send-email-iuliana.prodan@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Nov 18, 2019 at 12:30:41AM +0200, Iuliana Prodan wrote: > > +static int transfer_request_to_engine(struct crypto_engine *engine, > + struct crypto_async_request *req) > +{ > + switch (crypto_tfm_alg_type(req->tfm)) { > + case CRYPTO_ALG_TYPE_SKCIPHER: > + return crypto_transfer_skcipher_request_to_engine(engine, > + skcipher_request_cast(req)); > + default: > + return -EINVAL; > + } > +} Please don't do this. As you can see the crypto engine interface wants to you to use the correct type for the request object. That's what you should do to. In fact I don't understand why you're only using the crypto engine for the backlog case. Wouldn't it be much simpler if you used the engine unconditionally? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt