netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] tun: fix aio
@ 2009-04-20 11:25 Michael S. Tsirkin
  2009-04-20 12:09 ` Herbert Xu
  2009-04-21 12:50 ` Michael S. Tsirkin
  0 siblings, 2 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2009-04-20 11:25 UTC (permalink / raw)
  To: David S. Miller, netdev, Herbert Xu, Rusty Russell

tun device currently fills in aio_read/aio_write, however the implementation
corrupts the input iovec through const struct iovec *. As a side effect,
attempts to use io_submit/io_getevents on a tun/tap device result in EINVAL
(after actually sending/consuming a packet).

The following patches make tun_chr_aio_read and tun_chr_aio_write not modify
the iovec so that io_submit/io_getevents succeed, becoming functionally
equivalent to write/read on the device.  I am working on another patch set
supporting zero-copy transmit over tun, which will rely on this functionality,
but I think the patches might be already useful by themself. What do you think?
Please review.

Note: I started out just allocating and copying the iovec rather than adding
yet another skb-iterating routine, but this turned out to add small but
measurable overhead on data path: tx time per packet jumped from 6500 to 6700 ns
(let me know if you want to see that version of the patch).

Michael S. Tsirkin (3):
  net: skb_copy_datagram_const_iovec()
  tun: fix tun_chr_aio_read so that aio works
  tun: fix tun_chr_aio_write so that aio works

 drivers/net/tun.c      |   24 ++++++----
 include/linux/skbuff.h |    8 +++-
 include/linux/socket.h |    6 ++-
 net/core/datagram.c    |  112 +++++++++++++++++++++++++++++++++++++++++++++---
 net/core/iovec.c       |   33 +++++++++++++-
 5 files changed, 161 insertions(+), 22 deletions(-)

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

end of thread, other threads:[~2009-05-05  8:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 11:25 [PATCH 0/3] tun: fix aio Michael S. Tsirkin
2009-04-20 12:09 ` Herbert Xu
2009-04-20 12:21   ` Michael S. Tsirkin
2009-04-27  1:18     ` Rusty Russell
2009-04-27  9:34       ` Michael S. Tsirkin
2009-05-05  3:18         ` Rusty Russell
2009-05-05  8:40           ` Michael S. Tsirkin
2009-04-21 12:50 ` Michael S. Tsirkin
2009-04-21 13:02   ` David Miller

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