All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: linux-crypto@vger.kernel.org, weigang.li@intel.com
Subject: Re: [PATCH v7 4/9] crypto: acomp - add support for lzo via scomp
Date: Fri, 23 Sep 2016 23:05:18 +0800	[thread overview]
Message-ID: <20160923150518.GA20384@gondor.apana.org.au> (raw)
In-Reply-To: <20160922225425.GA25907@SILVIXA00369791-F22-1>

On Thu, Sep 22, 2016 at 11:54:25PM +0100, Giovanni Cabiddu wrote:
> > I think you may have misread my earlier message from June.  What
> > I'd like to see is for the acomp layer to allocate the output
> > memory, rather than have it provided by the user as is the case
> > with the current interface.  The user could provide a maximum to
> > prevent crazy cases consuming unlimited memory.
> Why would you prefer to have the output buffer allocated in the acomp
> layer? Is there a use case for this? Who would free that memory?

When I said acomp layer I'm referring specifically to the algorithm
or driver.  As to your last question it would be the caller's
responsibility to free that memory.

The use-case is our oldest user, IPcomp.  Most packets are 1500 bytes
max but we have to allocate 64K of memory to cover the worst case.
For an algorithm that can deal with SG lists it can easily allocate
pages of memory as it goes and place them in an SG list.

> We believe that the output buffer should be allocated by the user of the
> API. A caller might decide to allocate memory upfront or point the
> buffer list to pre-allocate buffers. This would happen in BTRFS where
> its block buffers are already allocated for submission to the
> compression API.

Sure if you already have memory allocated then we don't want to
force you to allocate it again in the algorithm/driver.  But our
interface should allow the memory to be allocated in the driver.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2016-09-23 15:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 12:49 [PATCH v7 0/9] crypto: asynchronous compression api Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 1/9] crypto: add " Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 2/9] crypto: add driver-side scomp interface Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 3/9] crypto: scomp - add scratch buffers allocator and deallocator Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 4/9] crypto: acomp - add support for lzo via scomp Giovanni Cabiddu
2016-09-20  9:26   ` Herbert Xu
2016-09-20 12:23     ` Giovanni Cabiddu
     [not found]     ` <20160920115140.GA12332@sivswdev01.ir.intel.com>
2016-09-22  9:22       ` Herbert Xu
2016-09-22 22:54         ` Giovanni Cabiddu
2016-09-23 15:05           ` Herbert Xu [this message]
2016-09-26 17:27             ` Giovanni Cabiddu
2016-09-27  3:07               ` Herbert Xu
2016-09-13 12:49 ` [PATCH v7 5/9] crypto: acomp - add support for lz4 " Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 6/9] crypto: acomp - add support for lz4hc " Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 7/9] crypto: acomp - add support for 842 " Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 8/9] crypto: acomp - add support for deflate " Giovanni Cabiddu
2016-09-13 12:49 ` [PATCH v7 9/9] crypto: acomp - update testmgr with support for acomp 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=20160923150518.GA20384@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=giovanni.cabiddu@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=weigang.li@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.