netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Replace scatterlist with crypto_frag
@ 2005-06-03 23:46 Herbert Xu
  2005-06-04  0:02 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Herbert Xu @ 2005-06-03 23:46 UTC (permalink / raw)
  To: David S. Miller, James Morris, Linux Crypto Mailing List, netdev

Hi:

I was looking at how we can move the IPsec input/output processing out
of the critical section protected by the spin locks on the xfrm_state.
This is useful because it would allow concurrent processing of IPsec
packets for the same SA.  It is also necessary if we're ever going to
add support for asynchronous crypto to IPsec.

The first requirement for this is that we need to stop using data that
is shared across a single SA in the IPsec input/output routines.  The
biggest hurdle there as it stands is sgbuf in esp_data.  This was
introduced to reduce stack usage in esp_input/esp_output as sgbuf
would consume up to 64 bytes of space.

In order to move it back onto the stack (so we can run these things
in parallel), I'm thinking of reducing the size of the scatterlist
structure itself.

The Crypto API doesn't need all the data contained in a scatterlist
structure.  For instance, it has no need for anything to do with DMA.
When we implement hardware crypto (which might do DMA), they're going
to have their own lists of descriptors so they can't use the scatterlist
as is anyway.

The skb_frag_t structure on the other hand is much more suited for
our purpose.  It is only half the size of scatterlist on i386.

So what do you think about introducing a new crypto_frag structure
which looks like this:

struct crypto_frag {
	struct page *page;
	u16 offset;
	u16 length;
};

We could then move sgbuf back into esp_input/esp_output at the cost
of 32 bytes of stack.  Is this stack cost acceptable?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2005-06-06 23:20 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-03 23:46 [RFC] Replace scatterlist with crypto_frag Herbert Xu
2005-06-04  0:02 ` Jeff Garzik
2005-06-04  0:42   ` Herbert Xu
2005-06-04  4:39     ` James Morris
2005-06-04  4:51       ` Herbert Xu
2005-06-04  5:23         ` James Morris
2005-06-04  5:33           ` Herbert Xu
2005-06-04 10:00     ` Evgeniy Polyakov
2005-06-04  9:55 ` Evgeniy Polyakov
2005-06-04  9:58   ` Herbert Xu
2005-06-04 10:17     ` Evgeniy Polyakov
2005-06-04 10:22       ` Herbert Xu
2005-06-04 10:29         ` Evgeniy Polyakov
2005-06-04 10:32           ` Herbert Xu
2005-06-04 10:40             ` Evgeniy Polyakov
2005-06-06 22:36             ` David S. Miller
2005-06-04 11:23 ` Christoph Hellwig
2005-06-04 11:26   ` Herbert Xu
2005-06-04 11:58     ` Christoph Hellwig
2005-06-06 11:59       ` Herbert Xu
2005-06-06 12:09         ` Christoph Hellwig
2005-06-06 12:40           ` Herbert Xu
2005-06-06 13:30             ` Christoph Hellwig
2005-06-06 22:46             ` David S. Miller
2005-06-06 23:04               ` Herbert Xu
2005-06-06 23:09                 ` David S. Miller
2005-06-06 23:14                   ` Herbert Xu
2005-06-06 23:18                     ` David S. Miller
2005-06-06 23:20                       ` Herbert Xu
2005-06-06 23:05               ` Jeff Garzik

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).