qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Anton Ivanov (antivano)" <antivano@cisco.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Qemu-devel@nongnu.org" <Qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Contribution - L2TPv3 transport
Date: Mon, 3 Mar 2014 14:01:00 +0000	[thread overview]
Message-ID: <53148B1A.3070008@cisco.com> (raw)
In-Reply-To: <20140303132746.GE21055@stefanha-thinkpad.redhat.com>

On 03/03/14 13:27, Stefan Hajnoczi wrote:
> On Fri, Feb 28, 2014 at 08:28:11AM +0000, Anton Ivanov (antivano) wrote:
>> 3. Qemu to communicate with the local host, remote vms, network devices,
>> etc at speeds which for a number of use cases exceed the speed of the
>> legacy tap driver.
> This surprises me.  It's odd that tap performs significantly worse.


Multipacket RX can go a very long way and it does not work on tap's 
emulation of a raw socket. At least in 3.2 :)

I could have put multipacket-TX in too, but that means breaking QoS for 
my use cases as well as using 2+ thread IO, improving current qemu timer 
API, etc. I have looked into it - it is doable. I would not try that in 
first instance at this point.

Tap at present can beat l2tpv3 on use cases where offloads have a 
significant contribution. Tap is slower on anything per-packet and it is 
slower end-to-end when combined with a bridge and/or OVS.

>
> I guess you have two options for using kernel L2TPv3 support:
>
> 1. Use a bridge and tap to forward between the L2TPv3 interface and the
>     QEMU.

Correct. It ends up being slower on per-packet use cases. Also, in a 
system it introduces one more touch point - the bridge. It needs to be 
configured and kept up to date. For our key use case (one which we will 
ship as a product) we have the following topology:

[Customer LAN] <-> [Physical CPE] <->... network... <-> [VM running a 
service]

An example of this would be putting a media server or a NAS on a VM and 
joining it to a customer network.

We can connect the VM via a switch. Nothing wrong with that and it may 
have the same performance end-to-end. However, it will introduce an 
extra touch point to deal with in terms control plane, orchestration and 
provisioning.

>
> 2. Use macvtap on top of the L2TPv3 interface (if possible).

Did not try that so cannot really say.

>
> Option #2 should be faster.
>
> Now about the tap userspace ABI, is the performance bottleneck that the
> read(2) system call only receives one packet at a time?  The tap file
> descriptor is not a socket so recvmmsg(2) cannot be used on it directly.

If I read the kernel source correctly the tap fd can emulate a socket 
for some calls. However, when I try recvmmsg I get an ENOTSOCKET.

>
> I have wondered in the past whether something like packet mmap would be
> possible on a tap device.

I have done it on raw. I have it approved for submission, mmap works 
fine on RX (once again). Packet mmap does not work on TX - you end up 
having to filter your own frames leading to an overall drop in 
efficiency. So TX still has to be a write to socket.

We will be contributing that one shortly after I clean it up to the 
required coding standards (in fact parts of the source sneaked into the 
original diff file by mistake).

Theoretically, it has very little advantages compared to recvmmsg as 
there is a copy involved in both cases. I am happy to rewrite that for 
recvmmsg instead of packet mmap so we can reuse the vector IO code 
across both drivers.

> At that point userspace just waits for
> notifications and the actual packets don't require any syscalls.

Indeed. That driver will be contributed shortly. We have done that one 
too :)

A.

>
>> Our suggestion would be that this over time obsoletes the UDP variety of
>> the "socket" driver.
> Yes, thank you!  L2TPv3 looks like a good replacement for the "socket"
> driver.
>
> Will review and respond to your patch in detail.
>
> Stefan

  reply	other threads:[~2014-03-03 14:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  8:28 [Qemu-devel] Contribution - L2TPv3 transport Anton Ivanov (antivano)
2014-02-28 10:02 ` Paolo Bonzini
2014-02-28 11:17   ` Anton Ivanov (antivano)
2014-02-28 11:36     ` Paolo Bonzini
2014-02-28 12:59       ` Anton Ivanov (antivano)
2014-02-28 13:55   ` Anton Ivanov (antivano)
2014-03-04 15:19   ` Anton Ivanov (antivano)
2014-03-04 15:22     ` Anton Ivanov (antivano)
2014-03-04 15:53       ` Eric Blake
2014-03-04 16:05         ` Anton Ivanov (antivano)
2014-03-05  8:49         ` Anton Ivanov (antivano)
2014-03-05 11:38           ` Peter Maydell
2014-03-04 15:41     ` Eric Blake
2014-03-04 15:58       ` Anton Ivanov (antivano)
2014-03-04 16:04         ` Paolo Bonzini
2014-03-04 16:33     ` Eric Blake
2014-03-04 16:48       ` Anton Ivanov (antivano)
2014-03-04 16:55         ` Paolo Bonzini
2014-03-04 17:28           ` Anton Ivanov (antivano)
2014-03-04 17:30             ` Paolo Bonzini
2014-02-28 13:40 ` Eric Blake
2014-02-28 13:52   ` Anton Ivanov (antivano)
2014-02-28 13:57     ` Eric Blake
2014-02-28 14:03       ` Anton Ivanov (antivano)
2014-02-28 14:00   ` Paolo Bonzini
2014-02-28 15:06     ` Eric Blake
2014-02-28 15:20       ` Paolo Bonzini
2014-03-03 13:27 ` Stefan Hajnoczi
2014-03-03 14:01   ` Anton Ivanov (antivano) [this message]
2014-03-04  9:36     ` Stefan Hajnoczi
2014-03-04  9:47       ` Anton Ivanov (antivano)
2014-03-05  8:59         ` Stefan Hajnoczi
2014-03-05  9:13           ` Vincenzo Maffione
2014-03-03 14:53 ` Stefan Hajnoczi
2014-03-04 11:32   ` Anton Ivanov (antivano)
2014-03-05  9:07     ` Stefan Hajnoczi

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=53148B1A.3070008@cisco.com \
    --to=antivano@cisco.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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).