linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: abed mohammad kamaluddin <abedamu@gmail.com>
To: "Stephan Müller" <smueller@chronox.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>, linux-crypto@vger.kernel.org
Subject: Re: algif for compression?
Date: Mon, 3 Apr 2017 14:11:45 +0530	[thread overview]
Message-ID: <CACVarETH7y0GAvDZT_cR=z4Zz-2jVW2-HCzEAb97RaQaSRDr8Q@mail.gmail.com> (raw)
In-Reply-To: <12030384.uXSX3S3VSk@tauon.chronox.de>

Hi Stephen,

> If you follow the AF_ALG implementations that are currently in the kernel, a
> calling application receives two file descriptors. The first file descriptor
> is the reference to a tfm, the second is the reference to a particular
> request.
>
> Wouldn't those file descriptors be the reference you are looking for?

Those descriptors are sufficient to pass data from userspace
applications to the algif interface.
However the issue is passing those from the interface to the driver
using the current acomp API's.
This is the currently exposed interface to the comp framework. Am I
missing something here?

int (*compress)(struct acomp_req *req);
int (*decompress)(struct acomp_req *req);

struct acomp_req {
        struct crypto_async_request base;
        struct scatterlist *src;
        struct scatterlist *dst;
        unsigned int slen;
        unsigned int dlen;
        u32 flags;
        void *__ctx[] CRYPTO_MINALIGN_ATTR;
};


Thanks
Abed



On Mon, Apr 3, 2017 at 12:56 PM, Stephan Müller <smueller@chronox.de> wrote:
> Am Montag, 3. April 2017, 08:10:19 CEST schrieb abed mohammad kamaluddin:
>
> Hi abed,
>
>> Hi Herbert,
>>
>> We have implemented algif acomp interface for user space applications
>> to utilize the kernel compression framework and the hardware drivers
>> using it and have been testing it using userspace zlib library.
>>
>> However, what we find lacking in the existing acomp implementation is
>> the ability to pass context data between the applications and the
>> drivers using the acomp interface. Currently the interface only allows
>> src/dest data  and a flag argument with each request. There are two
>> context pointers, one in acomp_req and another in crypto_tfm but they
>> are for internal use and not available to applications through the
>> api's. Would it be acceptable to add fields that need to be
>> communicated b/w the driver and applications like history,
>> csum/adler32, EOF, stream ctx  to acomp_req.
>>
>> Or is there any other way, which I may have missed, through which we
>> can pass ctx data between applications and drivers while using the
>> kernel compression framework?
>
> If you follow the AF_ALG implementations that are currently in the kernel, a
> calling application receives two file descriptors. The first file descriptor
> is the reference to a tfm, the second is the reference to a particular
> request.
>
> Wouldn't those file descriptors be the reference you are looking for?
>
> Ciao
> Stephan

  reply	other threads:[~2017-04-03  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 19:57 algif for compression? abed mohammad kamaluddin
2016-12-10  8:10 ` Herbert Xu
2016-12-16 14:11   ` abed mohammad kamaluddin
2016-12-21  8:52     ` Herbert Xu
2017-04-03  6:10   ` abed mohammad kamaluddin
2017-04-03  7:26     ` Stephan Müller
2017-04-03  8:41       ` abed mohammad kamaluddin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-14 18:05 Dan Streetman
2014-04-03 12:41 ` Herbert Xu
2014-04-03 18:03   ` Dan Streetman

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='CACVarETH7y0GAvDZT_cR=z4Zz-2jVW2-HCzEAb97RaQaSRDr8Q@mail.gmail.com' \
    --to=abedamu@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=smueller@chronox.de \
    /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).