From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55387 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZeV8-0002nY-2y for qemu-devel@nongnu.org; Fri, 16 Jul 2010 02:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZeV6-0005sX-3i for qemu-devel@nongnu.org; Fri, 16 Jul 2010 02:34:25 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:56866) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZeV5-0005s3-My for qemu-devel@nongnu.org; Fri, 16 Jul 2010 02:34:24 -0400 Message-ID: <4C3FFD88.5020305@web.de> Date: Fri, 16 Jul 2010 08:34:48 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1279225380-28790-1-git-send-email-miguel.filho@gmail.com> In-Reply-To: <1279225380-28790-1-git-send-email-miguel.filho@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig35B4B6211808081E9C02A25C" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH RFC 0/4] Dumping traffic when using netdev devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miguel Di Ciurcio Filho Cc: avi@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig35B4B6211808081E9C02A25C Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Miguel Di Ciurcio Filho wrote: > Hello, >=20 > This is a prototype suggestion. I mostly copied and pasted the code fro= m > net/dump.c into net.c and made some adjustments. There is no command li= ne > parsing involved yet, just the internals and small changes in net/tap.c= and > net/slirp.c do make the thing work. >=20 > In my tests, using tap as backend, e1000 as a guest device and running = iperf from > guest to host, the overhead of dumping the traffic caused a loss of aro= und 30% > of performance. No surprise, dump writes are synchronous. The day this is actually hurting someone, we may see asynchronous patches. >=20 > I opened the dumped files in wireshark and they looked fine. When using= slirp > all requests were dumped fine too. >=20 > Bugs/limitations: > - I have no clue on how to deal with tap+vhost, is it necessary? I don't think so. Do you can still do "tcpdump -i tap0" in that scenario, don't you? Then definitely not. > - When using virtio-net, I'm not sure how to handle iovec when vnet_hdr= =3Don Let the sending peer report (offset field or callback) where to find the payload in a frame. That channel - or a separate one - could also be used to detect if a peer supports dumping at all (vhost...). Then no peer code need to be extended with dump management code, all could be moved into net.c > - Create a function to add dump to a netdev on the fly, is it necessary= ? Yes. That way you don't need to shutdown&restart your VM just to enable or disable dumping - quite important in certain tests. > - Handle cleanups >=20 > Miguel Di Ciurcio Filho (4): > net/dump: Make pcap structures public > net: Introduce NetClientDump and auxiliary functions > net/tap: Suggested support for NetClientDump > net/slirp: Suggested support for NetClientDump >=20 > net.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > net.h | 8 +++++ > net/dump.c | 21 ------------- > net/dump.h | 21 +++++++++++++ > net/slirp.c | 3 ++ > net/tap.c | 3 ++ > qemu-common.h | 1 + > 7 files changed, 126 insertions(+), 21 deletions(-) >=20 Thanks for picking this up! Jan --------------enig35B4B6211808081E9C02A25C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkw//YwACgkQitSsb3rl5xSkOQCeLqjT7fOJslezPcXC+gKqksza MF8AoItOnnf26hsgKd+aPdrA6FdZRqVf =8k5H -----END PGP SIGNATURE----- --------------enig35B4B6211808081E9C02A25C--