From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vincenzo Maffione <v.maffione@gmail.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Jason Wang" <jasowang@redhat.com>,
mjt@tls.msk.ru, qemu-devel@nongnu.org, lcapitulino@redhat.com,
peter.crosthwaite@petalogix.com, owasserm@redhat.com,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Yan Vugenfirer" <yan@daynix.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
akong@redhat.com, quintela@redhat.com,
"Alexander Graf" <agraf@suse.de>,
aliguori@amazon.com, marcel.a@redhat.com, sw@weilnetz.de,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Giuseppe Lettieri" <g.lettieri@iet.unipi.it>,
"Luigi Rizzo" <rizzo@iet.unipi.it>,
"Dmitry Fleytman" <dmitry@daynix.com>,
mark.langsdorf@calxeda.com, "Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] net: QEMU_NET_PACKET_FLAG_MORE introduced
Date: Mon, 9 Dec 2013 16:00:29 +0200 [thread overview]
Message-ID: <20131209140029.GC15574@redhat.com> (raw)
In-Reply-To: <CA+_eA9gaeuVb6DGDs6xAJEMW-P5kbD6uDpqY=CEnXFScP6gPLw@mail.gmail.com>
On Mon, Dec 09, 2013 at 02:25:46PM +0100, Vincenzo Maffione wrote:
>
>
>
> 2013/12/9 Stefan Hajnoczi <stefanha@gmail.com>
>
> On Mon, Dec 09, 2013 at 01:14:31PM +0200, Michael S. Tsirkin wrote:
> > On Mon, Dec 09, 2013 at 11:55:57AM +0100, Vincenzo Maffione wrote:
> > > If you don't think adding the new flag support for virtio-net is a good
> idea
> > > (though TAP performance is not affected in every case) we could also
> make it
> > > optional.
> > >
> > >
> > > Cheers
> > > Vincenzo
> > >
> >
> > I think it's too early to say whether this patch is benefitial for
> > netmap, too. It looks like something that trades off latency
> > for throughput, and this is a decision the endpoint (VM) should
> > make, not the network (host).
> > So you should measure with offloads on before you make conclusions about
> it.
>
> Just to check my understanding, we're talking about the following kind
> of batching:
>
> int num_packets = peek_available_packets(device);
> while (num_packets-- > 0) {
> int flags = MORE;
> if (num_packets == 0) {
> flags = NONE;
> }
> qemu_net_send_packet(..., flags);
> }
>
> In other words, this only batches up a single burst of packets. It
> doesn't introduce timers or blocking calls.
>
> So the effect of batching should be relatively small on latency. In
> fact, it's almost like sendmmsg(2)/recvmmsg(2) but using a
> one-packet-at-a-time interface.
>
> Does this sound right?
>
> Stefan
>
>
> Totally correct.
>
> In reply to Michael:
> - what you say is right with netmap used as a backend with typical TCP
> applications in the guests, and we have already an implementation that supports
> those offloadings
>
> - however, consider that the main use of netmap is fast packet processing in
> middleboxes, where packet aggregation is not always possible. Applications that
> use netmap **in the guest** typically use "packet batching" (i.e. send multiple
> packets with one system call), so batches originate in the guest. Without the
> MORE flag, those batches are split at the frontend-backend interface. This is
> just a different workload.
>
>
> Regards,
> --
> Vincenzo Maffione
Considering that you have measured performance regression under
netperf, I don't understand why do we keep arguing
about theory. Increasing latency is a problem and if it can already be
seen with netperf it will only get worse with real life workloads.
So my advice is, start by merging offload support for netmap, then check
whether this optimization adds enough performance to be worth it, if yes
it needs more heuristics to avoid hurting latency.
--
MST
next prev parent reply other threads:[~2013-12-09 13:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 14:44 [Qemu-devel] [PATCH] net: QEMU_NET_PACKET_FLAG_MORE introduced Vincenzo Maffione
2013-12-06 16:39 ` Stefan Weil
2013-12-08 12:11 ` Michael S. Tsirkin
2013-12-09 10:20 ` Vincenzo Maffione
2013-12-09 10:30 ` Michael S. Tsirkin
2013-12-09 10:55 ` Vincenzo Maffione
2013-12-09 11:14 ` Michael S. Tsirkin
2013-12-09 12:42 ` Stefan Hajnoczi
2013-12-09 13:25 ` Vincenzo Maffione
2013-12-09 14:00 ` Michael S. Tsirkin [this message]
2013-12-09 16:04 ` Vincenzo Maffione
2013-12-09 13:55 ` Michael S. Tsirkin
2013-12-10 9:16 ` Stefan Hajnoczi
2013-12-09 12:36 ` Stefan Hajnoczi
2013-12-09 14:02 ` Michael S. Tsirkin
2013-12-09 14:10 ` Luigi Rizzo
2013-12-10 8:53 ` 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=20131209140029.GC15574@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=dmitry@daynix.com \
--cc=edgar.iglesias@gmail.com \
--cc=g.lettieri@iet.unipi.it \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mark.langsdorf@calxeda.com \
--cc=mjt@tls.msk.ru \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@petalogix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rizzo@iet.unipi.it \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
--cc=v.maffione@gmail.com \
--cc=yan@daynix.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).