Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1298959imu; Wed, 23 Jan 2019 14:27:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5jS074qZujPvunxZepnbQz4Apj/wzIPqrg7dREH3bYM0sijNmnxcc1t/W6O482G033QWTi X-Received: by 2002:a62:6f88:: with SMTP id k130mr3859288pfc.234.1548282423489; Wed, 23 Jan 2019 14:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548282423; cv=none; d=google.com; s=arc-20160816; b=d2skZEYV77Qjzmfn+GsgFyIy94YX0KZNyTh0/5kTRPoPFFnyC6U99llXbeYAkgyFfj LPzMMfp7Tl18+S6165VklvKlN7vTTYgJ+L+JcJc5xeIXdYU1rZ+WU6iUf925/T+a4/F2 A8VetjYgj2/RM5j0vlD0LE5x9ZW7sxDu6ZOFDymbff6nm5rpKYHvnwngs+clycPVsgNr JvGvNy0ABxCrFEZNuw0bU+GcQ1zKjkB3PxJxz1wanqOMALYpKoBczZTfjZpM58IahMZ2 vr+PNDm1ohSmGv0lvBpj2X1562ppSo3nwUS3p50KC0mc71KlWRy4jMa6J/psxE5jVf+D FlRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AwtGHbaFqYmF7audjW1uipcnOs8+nCU1X6eQnIuVa70=; b=ebwp7Up4OY8QOVdwxenje/N3SiMp3S+G5gmyH85lbzLZ2uGP2ycpYZWUWFu+sH59M6 9HNeltQDPwZXEN1bJBBZQy4vsz2tl2nl/tzDB8PP7thuzFCxiQhhhzShjEjyDIo7/mhV A62E+WU34YYjkdwyp2tQzLG3qkemEJrIFPJgHoyYxbvYZrBc7J9zUv9heSMS4+3hkDRS h/MgTpJglkpDWEtrqN/GIDpLRZhej3Gp3KY0qYysAuuNVQACg7dClTzG7JMhLCqH9lDy /q5ziWUEVevs63gdo0CBEatB5mHr0WrQIvlLYOQFWBQneglq53vKuO9FHI0Z2b0LQCeZ NVng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b186si20486335pfb.24.2019.01.23.14.26.48; Wed, 23 Jan 2019 14:27:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727132AbfAWWZJ (ORCPT + 99 others); Wed, 23 Jan 2019 17:25:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56420 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbfAWWZJ (ORCPT ); Wed, 23 Jan 2019 17:25:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07D8EC0C2723; Wed, 23 Jan 2019 22:25:09 +0000 (UTC) Received: from redhat.com (ovpn-120-183.rdu2.redhat.com [10.10.120.183]) by smtp.corp.redhat.com (Postfix) with SMTP id 169E46013C; Wed, 23 Jan 2019 22:25:00 +0000 (UTC) Date: Wed, 23 Jan 2019 17:25:00 -0500 From: "Michael S. Tsirkin" To: Christoph Hellwig Cc: Joerg Roedel , Jason Wang , Konrad Rzeszutek Wilk , Jens Axboe , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jfehlig@suse.com, jon.grimm@amd.com, brijesh.singh@amd.com, jroedel@suse.de, pbonzini@redhat.com, jsnow@redhat.com Subject: Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size Message-ID: <20190123170850-mutt-send-email-mst@kernel.org> References: <20190123163049.24863-1-joro@8bytes.org> <20190123163049.24863-6-joro@8bytes.org> <20190123213139.GD9032@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123213139.GD9032@lst.de> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 23 Jan 2019 22:25:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 23, 2019 at 10:31:39PM +0100, Christoph Hellwig wrote: > On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > > + max_size = virtio_max_dma_size(vdev); > > + > > /* Host can optionally specify maximum segment size and number of > > * segments. */ > > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, > > struct virtio_blk_config, size_max, &v); > > if (!err) > > - blk_queue_max_segment_size(q, v); > > - else > > - blk_queue_max_segment_size(q, -1U); > > + max_size = min(max_size, v); > > + > > + blk_queue_max_segment_size(q, max_size); > > I wonder if we should just move the dma max segment size check > into blk_queue_max_segment_size so that all block drivers benefit > from it. Even if not I think at least the SCSI midlayer should > be updated to support it. > > Btw, I wonder why virtio-scsi sticks to the default segment size, > unlike virtio-blk. Well no one bothered exposing that through that device. Why does virtio block have it? Hard for me to say. First driver version had it already but QEMU does not seem to use it and it seems that it never did. -- MST