From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHUBk-0005Gs-OE for qemu-devel@nongnu.org; Mon, 27 Jun 2016 06:54:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHUBh-0003vP-DX for qemu-devel@nongnu.org; Mon, 27 Jun 2016 06:54:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:35746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHUBe-0003v6-TW for qemu-devel@nongnu.org; Mon, 27 Jun 2016 06:54:45 -0400 References: <1466162096-4934-1-git-send-email-jgross@suse.com> From: Juergen Gross Message-ID: <577105EF.5060800@suse.com> Date: Mon, 27 Jun 2016 12:54:39 +0200 MIME-Version: 1.0 In-Reply-To: <1466162096-4934-1-git-send-email-jgross@suse.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] [PATCH] xen: use native disk xenbus protocol if possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com Cc: anthony.perard@citrix.com, sstabellini@kernel.org, kraxel@redhat.com On 17/06/16 13:14, Juergen Gross wrote: > The qdisk implementation is using the native xenbus protocol only in > case of no protocol specified at all. As using the explicit 32- or > 64-bit protocol is slower than the native one due to copying requests > not by memcpy but element for element, this is not optimal. > > Correct this by using the native protocol in case word sizes of > frontend and backend match. Ping? > > Signed-off-by: Juergen Gross > --- > hw/block/xen_disk.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c > index 2862b59..0961fcb 100644 > --- a/hw/block/xen_disk.c > +++ b/hw/block/xen_disk.c > @@ -976,14 +976,14 @@ static int blk_connect(struct XenDevice *xendev) > blkdev->feature_persistent = !!pers; > } > > - blkdev->protocol = BLKIF_PROTOCOL_NATIVE; > - if (blkdev->xendev.protocol) { > - if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_32) == 0) { > - blkdev->protocol = BLKIF_PROTOCOL_X86_32; > - } > - if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_64) == 0) { > - blkdev->protocol = BLKIF_PROTOCOL_X86_64; > - } > + if (!blkdev->xendev.protocol) { > + blkdev->protocol = BLKIF_PROTOCOL_NATIVE; > + } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_NATIVE) == 0) { > + blkdev->protocol = BLKIF_PROTOCOL_NATIVE; > + } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_32) == 0) { > + blkdev->protocol = BLKIF_PROTOCOL_X86_32; > + } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_64) == 0) { > + blkdev->protocol = BLKIF_PROTOCOL_X86_64; > } > > blkdev->sring = xengnttab_map_grant_ref(blkdev->xendev.gnttabdev, >