Received: from eggs.gnu.org ([2001:4830:134:3::10]:39346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9FMZ-0001DH-QL for qemu-devel@nongnu.org; Wed, 16 Dec 2015 11:55:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9FMT-0006AB-AO for qemu-devel@nongnu.org; Wed, 16 Dec 2015 11:55:39 -0500 Received: from mx0.arrikto.com ([212.71.252.59]:58931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9FMT-00069D-4K for qemu-devel@nongnu.org; Wed, 16 Dec 2015 11:55:33 -0500 From: Alex Pyrgiotis Date: Wed, 16 Dec 2015 18:55:08 +0200 Message-Id: <1450284917-10508-1-git-send-email-apyrgio@arrikto.com> Subject: [Qemu-devel] [PATCH 0/9] Add full scatter-gather support for SCSI generic devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Hi all, This patch is an attempt to boost the performance of "scsi-generic" and "scsi-block" device types, by removing an extra data copy and reducing their memory footprint. More specifically, the problem lies in the functions in the `scsi-generic_req_ops` struct of scsi-generic.c. These functions rely on an intermediate buffer to do the SG_IO ioctl request, without checking if the SCSI controller has provided a scatter-gather list with the request. In a nutshell, our proposal is to map the provided scatter-gather list (if any) to the address space of the QEMU process and use the resulting iovec as the buffer for the ioctl request. You'll find that the logic is quite similar to the one used in scsi-disk.c. Cheers, Alex Alex Pyrgiotis (9): dma-helpers: Expose the sg mapping logic dma-helpers: Add support for ioctl operations dma-helpers: Do not truncate small qiovs scsi-generic: Add common functions scsi-generic: Separate `sg_io_hdr' initializations scsi-generic: Make request execution buf-specific scsi-generic: Make data-copying logic clearer scsi-generic: Factor out response interception scsi-generic: Allow full scatter-gather support dma-helpers.c | 184 ++++++++++++++++++--- hw/scsi/scsi-generic.c | 422 +++++++++++++++++++++++++++++++++++++------------ include/sysemu/dma.h | 8 + trace-events | 4 +- 4 files changed, 488 insertions(+), 130 deletions(-) -- 2.6.2