From: Herbert Xu Subject: Re: [PATCH 09/11] crypto: remove LZO fallback from crypto 842 Date: Wed, 8 Apr 2015 22:38:31 +0800 Message-ID: <20150408143831.GA30762@gondor.apana.org.au> References: <1428428070-17803-1-git-send-email-ddstreet@ieee.org> <1428428070-17803-10-git-send-email-ddstreet@ieee.org> <20150408141600.GA30338@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "David S. Miller" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Seth Jennings , Robert Jennings , linux-crypto@vger.kernel.org, "linuxppc-dev@lists.ozlabs.org" , linux-kernel To: Dan Streetman Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Wed, Apr 08, 2015 at 10:28:23AM -0400, Dan Streetman wrote: > > So, the sw implementation is only for decompression; there's no sw > compression implementation in these patches. As a general rule we don't add any hardware implementation unless there is a software implementation. The reason is that every new algorithm creates an API (potentially a user-space API if the algorithm can be exported via algif). But sometimes things slip through. So I'm not going to immediately remove 842 but it would be nice if we had a reference implementation so that if ever there were another hardware 842 implmentation added then at least we have something that we can judge against. > The hw 842 driver is currently at drivers/crypto/nx, and the > crypto/842 driver just calls the hw driver (after correctly > aligning/sizing the provided buffers to what the hw driver expects), > and falls back to the sw decompression if the hw decompression fails > (there is no compression fallback, a failure is reported to the > caller). > > Is that setup ok? If users had to directly call the hw driver, > instead of using the generic crypto_comp interface, it would > complicate things, e.g. in zswap it only expects to call > crypto_comp_compress()/decompress(), not call the 842 hw driver > directly. I think the only thing that needs to happen for now is moving crypto/842.c over to drivers/crypto/nx (perhaps merge it into nx-842.c) so that it's obvious that this is not a generic implementation. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt