From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq1FT-0004V7-12 for qemu-devel@nongnu.org; Mon, 09 Dec 2013 08:51:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq1FM-00060x-Ud for qemu-devel@nongnu.org; Mon, 09 Dec 2013 08:51:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq1FM-00060c-No for qemu-devel@nongnu.org; Mon, 09 Dec 2013 08:51:40 -0500 Date: Mon, 9 Dec 2013 15:55:00 +0200 From: "Michael S. Tsirkin" Message-ID: <20131209135500.GB15574@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> <20131209124230.GC9611@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20131209124230.GC9611@stefanha-thinkpad.redhat.com> Content-Transfer-Encoding: quoted-printable 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: Stefan Hajnoczi 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:42:30PM +0100, Stefan Hajnoczi wrote: > 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 als= o make it > > > optional. > > >=20 > > >=20 > > > Cheers > > > =A0 Vincenzo > > >=20 > >=20 > > 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 ab= out it. >=20 > Just to check my understanding, we're talking about the following kind > of batching: >=20 > int num_packets =3D peek_available_packets(device); > while (num_packets-- > 0) { > int flags =3D MORE; > if (num_packets =3D=3D 0) { > flags =3D NONE; > } > qemu_net_send_packet(..., flags); > } >=20 > In other words, this only batches up a single burst of packets. It > doesn't introduce timers or blocking calls. Yes. > 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. >=20 > Does this sound right? >=20 > Stefan Why would it be small? Consider a queue of 256 packets. You are sending out a single short packet, followed by a burst of 255 larger packets. the single packet is not transmitted until qemu completes processing 255 larger ones. --=20 MST