linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/2] crypto: aead AF_ALG - overhaul memory management
Date: Fri, 13 Jan 2017 12:16:27 +0100	[thread overview]
Message-ID: <2278925.gEXngSfgVI@positron.chronox.de> (raw)
In-Reply-To: <20170113111259.GA23800@gondor.apana.org.au>

Am Freitag, 13. Januar 2017, 19:12:59 CET schrieb Herbert Xu:

Hi Herbert,

> On Fri, Jan 13, 2017 at 12:10:02PM +0100, Stephan Müller wrote:
> > > Well if ordering is not guaranteed that I don't see how your code
> > > can work either.  Or am I missing something?
> > 
> > The patch simply stores all data it gets from sendmsg in the src SGL. In
> > addition it maintains an offset pointer into that src SGLs.
> > 
> > When the recvmsg call comes in and the dst SGL is prepared, it simply
> > takes as much data from the src SGL as needed to cover the request
> > defined by the dst SGL. After completing that operation, the offset
> > pointer is moved forward to point to a yet unused part of the src SGL. If
> > another recvmsg comes in without an intermediate sendmsg, it simply
> > starts using the data from the src SGL starting from the offset.
> > 
> > Therefore, the code should now be able to handle a write / write / read /
> > read scenario. Or it can handle, say, a write(32 bytes) / read (16 bytes)
> > / read (16 bytes). At least my tests covered a successful testing of that
> > scenario which always crashed the kernel before.
> 
> Are you making separate read calls or just a single one? If you're
> making separate calls, then this is no differnt to just doing
> write/read pairs.  You're not saving any overhead.

I make one read call.
> 
> If you're making a single call, what guarantees the ordering?

Technically, io_submit is the syscall that triggers the recvmsg. Are you 
saying that this syscall does not maintain ordering? At least the man page 
does not add any hints that it would not (unlike the lio_list man page).

Ciao
Stephan

  reply	other threads:[~2017-01-13 11:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-25 17:13 [PATCH 0/2] crypto: AF_ALG memory management fix Stephan Müller
2016-12-25 17:15 ` [PATCH 1/2] crypto: aead AF_ALG - overhaul memory management Stephan Müller
2017-01-12 15:51   ` Herbert Xu
2017-01-12 15:56     ` Stephan Müller
2017-01-12 16:05       ` Stephan Müller
2017-01-12 16:07         ` Herbert Xu
2017-01-12 16:10           ` Stephan Müller
2017-01-12 16:17             ` Herbert Xu
2017-01-12 16:19               ` Stephan Müller
2017-01-13 10:21                 ` Herbert Xu
2017-01-13 10:49                   ` Stephan Müller
2017-01-13 11:03                     ` Herbert Xu
2017-01-13 11:10                       ` Stephan Müller
2017-01-13 11:12                         ` Herbert Xu
2017-01-13 11:16                           ` Stephan Müller [this message]
2017-01-13 11:25                             ` Herbert Xu
2017-01-13 11:51                               ` Stephan Müller
2017-01-16 13:41                               ` Stephan Müller
2016-12-25 17:15 ` [PATCH 2/2] crypto: skcipher " Stephan Müller

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=2278925.gEXngSfgVI@positron.chronox.de \
    --to=smueller@chronox.de \
    --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).