All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Guus Sliepen <guus@tinc-vpn.org>
Cc: David Miller <davem@davemloft.net>,
	tom@herbertland.com, netdev@vger.kernel.org
Subject: Re: Best way to reduce system call overhead for tun device I/O?
Date: Thu, 31 Mar 2016 16:39:32 -0700	[thread overview]
Message-ID: <20160331163932.3617e7cd@xeon-e3> (raw)
In-Reply-To: <20160331222857.GH3771@sliepen.org>

On Fri, 1 Apr 2016 00:28:57 +0200
Guus Sliepen <guus@tinc-vpn.org> wrote:

> On Thu, Mar 31, 2016 at 05:20:50PM -0400, David Miller wrote:
> 
> > >> I'm trying to reduce system call overhead when reading/writing to/from a
> > >> tun device in userspace. [...] What would be the right way to do this?
> > >>
> > > Personally I think tun could benefit greatly if it were implemented as
> > > a socket instead of character interface. One thing that could be much
> > > better is sending/receiving of meta data attached to skbuf. For
> > > instance GSO data could be in ancillary data in a socket instead of
> > > inline with packet data as tun seems to be doing now.
> > 
> > Agreed.
> 
> Ok. So how should the userspace API work? Creating an AF_PACKET socket
> and then using a tun ioctl to create a tun interface and bind it to the
> socket?
> 
> int fd = socket(AF_PACKET, ...)
> struct ifreq ifr = {...};
> ioctl(fd, TUNSETIFF, &ifr);
> 

Rather than bodge AF_PACKET onto TUN, why not just create a new device type
and control it from something modern like netlink.

  reply	other threads:[~2016-03-31 23:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 22:40 Best way to reduce system call overhead for tun device I/O? Guus Sliepen
2016-03-31 21:18 ` Tom Herbert
2016-03-31 21:20   ` David Miller
2016-03-31 22:28     ` Guus Sliepen
2016-03-31 23:39       ` Stephen Hemminger [this message]
2016-04-03 23:03         ` Willem de Bruijn
2016-04-04 14:40           ` Guus Sliepen
  -- strict thread matches above, loose matches on Subject: below --
2016-04-04 13:35 ValdikSS
2016-04-04 17:28 ` Stephen Hemminger
     [not found] <57026C8F.8050406@valdikss.org.ru>
2016-04-04 14:31 ` Guus Sliepen

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=20160331163932.3617e7cd@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=guus@tinc-vpn.org \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.