linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH v3 2/8] crypto: add driver-side scomp interface
Date: Fri, 18 Mar 2016 14:02:49 +0000	[thread overview]
Message-ID: <20160318140248.GA22461@sivswdev01.ir.intel.com> (raw)
In-Reply-To: <20160317110027.GA5378@gondor.apana.org.au>

Hi Herbert,

I would like to have some clarifications before submitting a v4.

On Thu, Mar 17, 2016 at 07:00:27PM +0800, Herbert Xu wrote:
> On Wed, Feb 24, 2016 at 05:51:44PM +0000, Giovanni Cabiddu wrote:
> >
> > +#define CRYPTO_SCOMP_DECOMP_NOCTX CRYPTO_ALG_PRIVATE
> 
> I don't think this should be an scomp-specific flag.  The point of
> noctx is that we don't need to do a request-specific vmalloc.
Are you suggesting to add to the struct acomp_req a pointer to a vmalloc
area and remove the request context (which is contiguous to acomp_req and
allocated in request_alloc)?

> Chances are that with hardware offload that you won't have to do
> such a vmalloc anyway.  IOW acomp implementations are much more
> likely to be of the noctx type than scomp.
Our HW offload will always need a context area in the acomp_req but
I agree, there might be other acomp implementations which won't.

> This is how I think it should work:
> 
> 1. There should be a single request_alloc function that allocates
> just the request without the vmalloc.
> 2. You then have to call an alloc_space function to allocate the
> vmalloc area (let's stop calling it ctx as it may lead to confusion
> with other contexts in the crypto API).
Will allocate_space require a parameter which indicates the direction
of the operation (compression or decompression) or are we relying on the
user of the crypto API to know if he needs to call this function or not?

> The second step can obviously be skipped for the noctx case.
> 
> Also instead of the private bit let's put this into the alg type:
> 
> #define CRYPTO_ALG_TYPE_ACOMP          0x00000008
> #define CRYPTO_ALG_TYPE_ACOMP_NOCTX    0x00000009
> #define CRYPTO_ALG_TYPE_SCOMP          0x0000000a
> #define CRYPTO_ALG_TYPE_SCOMP_NOCTX    0x0000000b
The reason why Joonsoo Kim proposed the concept of NOCTX was to avoid
allocating a decompression context.
Are you suggesting also to extend this concept to compression as well?
If yes we would need a way to indicate for which direction the driver
requires the context/space. How can we specify that?

> Now that we have killed crypto_hash we can shrink hash down to
> two types and move it to 0xe, freeing up the space for acomp/scomp.
Sounds good.

Thank you,

-- 
Giovanni

  reply	other threads:[~2016-03-18 14:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 16:10 [PATCH 0/2] crypto: asynchronous compression api Giovanni Cabiddu
2016-02-08 16:10 ` [PATCH 1/2] crypto: add " Giovanni Cabiddu
2016-02-09 10:53   ` Herbert Xu
2016-02-09 17:31     ` [PATCH v2 0/2] crypto: " Giovanni Cabiddu
2016-02-09 17:31       ` [PATCH v2 1/2] crypto: add " Giovanni Cabiddu
2016-02-09 17:31       ` [PATCH v2 2/2] crypto: extended acomp api for supporting deflate algorithm parameters Giovanni Cabiddu
2016-02-16 19:57       ` [PATCH v2 0/2] crypto: asynchronous compression api Herbert Xu
2016-02-24 17:47         ` Giovanni Cabiddu
2016-02-24 17:51         ` [PATCH v3 0/8] " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 1/8] crypto: add " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 2/8] crypto: add driver-side scomp interface Giovanni Cabiddu
2016-03-17 11:00             ` Herbert Xu
2016-03-18 14:02               ` Giovanni Cabiddu [this message]
2016-03-23 10:18                 ` Herbert Xu
2016-02-24 17:51           ` [PATCH v3 3/8] crypto: acomp - add support for lzo via scomp Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 4/8] crypto: acomp - add support for lz4 " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 5/8] crypto: acomp - add support for lz4hc " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 6/8] crypto: acomp - add support for 842 " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 7/8] crypto: acomp - add support for deflate " Giovanni Cabiddu
2016-02-24 17:51           ` [PATCH v3 8/8] crypto: acomp - update testmgr with support for acomp Giovanni Cabiddu
2016-02-08 16:10 ` [PATCH 2/2] crypto: extended acomp api for supporting deflate algorithm parameters Giovanni Cabiddu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160318140248.GA22461@sivswdev01.ir.intel.com \
    --to=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).