Re: [PATCH 1/1 v8] Add CryptoAPI User Interface Support v8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 23, 2009 at 05:35:58PM +0800, Herbert Xu wrote:
>
> 4. Operate.
> 
> 	sendmsg(fd, msg, flags);
> 
> Here struct msghdr provides for both the IOV array and space for
> ancillary information.

In fact we should take this one step further.  Instead of having
write/send do both input as well as output, it should just do the
former.  That is, we should call read/recv to get the output.

This might seem a step backwards, but in fact it's the only sane
way to do zero-copy.  In order to get zero copy with this, you'd
use splice instead of write (the setup can be done with the usual
corking method), and the receive side would use vmsplice + splice.

You might argue that this is too much overhead.  However, it isn't
because

1) For the cases where you have less than a page of data, just
use send/recv as the overhead of the copy is dwarfed by the overhead
of the rest of the crypto operation.

2) Where zero-copy does matter the setup overhead is immaterial.

Of course to make vmsplice + splice work, we don't want to start
the operation until the first read request from the user is issued.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux