Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbdHKShG (ORCPT ); Fri, 11 Aug 2017 14:37:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52434 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526AbdHKShF (ORCPT ); Fri, 11 Aug 2017 14:37:05 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C962461E5F Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH 1/2] virtio: Reduce BUG if total_sg > virtqueue size to WARN. To: "Michael S. Tsirkin" Cc: "Richard W.M. Jones" , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, jasowang@redhat.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, hch@lst.de References: <20170810164035.19963-1-rjones@redhat.com> <20170810164035.19963-2-rjones@redhat.com> <20170811001447-mutt-send-email-mst@kernel.org> <20170810213038.GC20914@redhat.com> <20170811003107-mutt-send-email-mst@kernel.org> <20170810213511.GB10017@redhat.com> <20170811003621-mutt-send-email-mst@kernel.org> <64d3c483-076b-1362-b284-30dda704f80c@redhat.com> <20170811201843-mutt-send-email-mst@kernel.org> From: Paolo Bonzini Message-ID: Date: Fri, 11 Aug 2017 20:36:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170811201843-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 11 Aug 2017 18:37:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 989 Lines: 28 On 11/08/2017 19:23, Michael S. Tsirkin wrote: > On Fri, Aug 11, 2017 at 04:09:26PM +0200, Paolo Bonzini wrote: >> On 10/08/2017 23:41, Michael S. Tsirkin wrote: >>>>> Then we probably should fail probe if vq size is too small. >>>> What does this mean? >>> >>> We must prevent driver from submitting s/g lists > vq size to device. >> >> What is the rationale for the limit? > > So the host knows what it needs to support. > >> both virtio-blk and virtio-scsi transmit their own value for the >> maximum sg list size (max_seg in virtio-scsi, seg_max in virtio-blk). > > No other device has it, and it seemed like a good idea to > limit it generally at the time. > > we can fix the spec to relax the requirement for blk and scsi - > want to submit a proposal? Alternatively, add a generic field > for that. Yes, I can submit a proposal. blk and scsi are the ones that are most likely to have very long sg lists. When I was designing scsi I just copied that field from blk. :) Paolo