From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0Ad-0007GD-DR for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:42:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq0AU-0001gf-RS for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:42:43 -0500 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:62697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0AU-0001gb-Ks for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:42:34 -0500 Received: by mail-ee0-f43.google.com with SMTP id c13so1514954eek.16 for ; Mon, 09 Dec 2013 04:42:33 -0800 (PST) Date: Mon, 9 Dec 2013 13:42:30 +0100 From: Stefan Hajnoczi Message-ID: <20131209124230.GC9611@stefanha-thinkpad.redhat.com> References: <1386341073-6584-1-git-send-email-v.maffione@gmail.com> <20131208121117.GD6841@redhat.com> <20131209103026.GC15055@redhat.com> <20131209111431.GG15055@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20131209111431.GG15055@redhat.com> Subject: Re: [Qemu-devel] [PATCH] net: QEMU_NET_PACKET_FLAG_MORE introduced List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , Jason Wang , mjt@tls.msk.ru, qemu-devel@nongnu.org, Vincenzo Maffione , lcapitulino@redhat.com, peter.crosthwaite@petalogix.com, owasserm@redhat.com, Gerd Hoffmann , Yan Vugenfirer , "Edgar E. Iglesias" , akong@redhat.com, quintela@redhat.com, Alexander Graf , aliguori@amazon.com, marcel.a@redhat.com, sw@weilnetz.de, Stefan Hajnoczi , Giuseppe Lettieri , Luigi Rizzo , Dmitry Fleytman , mark.langsdorf@calxeda.com, Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= 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