From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsnaI-0001SA-1z for qemu-devel@nongnu.org; Tue, 17 Dec 2013 00:52:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsnaD-0004Ua-5y for qemu-devel@nongnu.org; Tue, 17 Dec 2013 00:52:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsnaC-0004TU-Td for qemu-devel@nongnu.org; Tue, 17 Dec 2013 00:52:41 -0500 Date: Tue, 17 Dec 2013 11:22:14 +0530 From: Amit Shah Message-ID: <20131217055214.GF6582@grmbl.mre> References: <1386598213-8156-1-git-send-email-akong@redhat.com> <1386598213-8156-2-git-send-email-akong@redhat.com> <20131216123540.GB6582@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performance List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Amos Kong , qemu-devel , varadgautam@gmail.com On (Mon) 16 Dec 2013 [15:19:31], Anthony Liguori wrote: > On Mon, Dec 16, 2013 at 8:36 AM, Amit Shah wrote: > > On (Mon) 09 Dec 2013 [22:10:12], Amos Kong wrote: > >> Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563 > >> > >> We have a requests queue to cache the random data, but the second > >> will come in when the first request is returned, so we always > >> only have one items in the queue. It effects the performance. > >> > >> This patch changes the IOthread to fill a fixed buffer with > >> random data from egd socket, request_entropy() will return > >> data to virtio queue if buffer has available data. > >> > >> (test with a fast source, disguised egd socket) > >> # cat /dev/urandom | nc -l localhost 8003 > >> # qemu .. -chardev socket,host=localhost,port=8003,id=chr0 \ > >> -object rng-egd,chardev=chr0,id=rng0,buf_size=1024 \ > >> -device virtio-rng-pci,rng=rng0 > > > > First thing I can think of is the egd protocol has a length field in > > the header, and if that isn't properly filled, the results are bound > > to be erratic. > > The test is bogus. > > egd is a protocol. You can't just pipe /dev/urandom into it. Can you suggest a way to test this the right way? Amit