From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Oo7-0004Q6-Qp for qemu-devel@nongnu.org; Wed, 26 Apr 2017 11:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Oo4-0001Bk-IQ for qemu-devel@nongnu.org; Wed, 26 Apr 2017 11:24:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36573 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Oo4-0001BA-Bk for qemu-devel@nongnu.org; Wed, 26 Apr 2017 11:24:40 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3QFOXs5073142 for ; Wed, 26 Apr 2017 11:24:38 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2a2q99p08k-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 26 Apr 2017 11:24:34 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Apr 2017 11:24:20 -0400 References: <20170426144645.12476-1-farman@linux.vnet.ibm.com> <20170426144645.12476-5-farman@linux.vnet.ibm.com> From: Eric Farman Date: Wed, 26 Apr 2017 11:24:15 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-Id: <0e9eb169-73d8-9afc-fd8d-bed492046110@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v1 4/5] pc-bios/s390-ccw: Break up virtio-scsi read into multiples List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: Cornelia Huck , Christian Borntraeger , Paolo Bonzini , Alexander Graf , "Michael S . Tsirkin" On 04/26/2017 11:17 AM, Eric Blake wrote: > On 04/26/2017 09:46 AM, Eric Farman wrote: >> A virtio-scsi request that goes through the host sd driver and >> exceeds the maximum transfer size is automatically broken up >> for us. But the equivalent request going to the sg driver >> presumes that any length requirements have already been honored. >> Let's use the max_sectors field from the device and break up >> all virtio-scsi requests (both sd and sg) to avoid problem from >> the host drivers. >> >> Signed-off-by: Eric Farman >> --- >> pc-bios/s390-ccw/s390-ccw.h | 4 ++++ >> pc-bios/s390-ccw/virtio-scsi.c | 19 ++++++++++++++----- >> 2 files changed, 18 insertions(+), 5 deletions(-) >> >> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h >> index ded67bc..e1f3751 100644 >> --- a/pc-bios/s390-ccw/s390-ccw.h >> +++ b/pc-bios/s390-ccw/s390-ccw.h >> @@ -42,6 +42,10 @@ typedef unsigned long long __u64; >> #ifndef NULL >> #define NULL 0 >> #endif >> +#ifndef MIN >> +#define MIN(a, b) (((a) < (b)) ? (a) : (b)); >> +#endif > > osdep.h defines MIN() for ALL files, so this hunk is spurious. Ah, so it does. Okay, removed. Thanks! I guess it would make sense for the hunk that uses it to use MIN_NON_ZERO instead, which is also defined there. >