From patchwork Tue Jul 3 13:16:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1150971 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 93E193FE80 for ; Tue, 3 Jul 2012 13:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932936Ab2GCNRP (ORCPT ); Tue, 3 Jul 2012 09:17:15 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:39108 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932768Ab2GCNRO (ORCPT ); Tue, 3 Jul 2012 09:17:14 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so9233830pbb.19 for ; Tue, 03 Jul 2012 06:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=MDudZ771SRRBsXs2Yx66dpwTFzWthdUG4OR0nROyOBI=; b=sI9RGNiCow/ZlXmY75ntcS/RWzWpT8Nz+sL/4KbB+P699Quo8j+fuY41PmvCCdQF77 BNtV3WWkF9onUjMrwZY7QvbjMZn/8/ZudIcd+UgeKIiIdijGNh1+Nc/XMAiodybcNKXp wGRFSo76iXkfSxw2nFiFwkuX71jgbqfxzCGsh+dfytp5BLGz2HO7YCoy11b/UgTBCmQ7 eoVFoXJbpCtKEVl7f0gdFbX6QRnUMx0KNpCwtotkztoyVMEhMNIDfELBnN50OWBWdNXQ BK3wyjAIewIPiGt5pmTsQMO4UXAsAy9Yv6pI/R6uIHO2E62Pb09Lj49/4971A13X3Q9l CDNg== Received: by 10.68.233.193 with SMTP id ty1mr7041822pbc.47.1341321433785; Tue, 03 Jul 2012 06:17:13 -0700 (PDT) Received: from yakj.usersys.redhat.com (net-93-71-25-153.cust.dsl.vodafone.it. [93.71.25.153]) by mx.google.com with ESMTPS id iv8sm15564371pbc.53.2012.07.03.06.17.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 06:17:12 -0700 (PDT) From: Paolo Bonzini To: virtualization@lists.osdl.org, kvm@vger.kernel.org, rusty@rustcorp.com.au Subject: [PATCH 1/2] virtio-blk spec: document topology info Date: Tue, 3 Jul 2012 15:16:51 +0200 Message-Id: <1341321412-24214-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.10.2 In-Reply-To: <1341321412-24214-1-git-send-email-pbonzini@redhat.com> References: <1341321412-24214-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Current QEMU and Linux drivers can export queue parameters via the virtio-blk configuration space. Document this, since the next patch will have to add another configuration field after these. Signed-off-by: Paolo Bonzini --- virtio-spec.lyx | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index dd2d53b..859dbe7 100644 --- a/virtio-spec.lyx +++ b/virtio-spec.lyx @@ -5021,7 +5021,20 @@ VIRTIO_BLK_F_SCSI (7) Device supports scsi packet commands. \end_layout \begin_layout Description -VIRTIO_BLK_F_FLUSH (9) Cache flush command support.Device +VIRTIO_BLK_F_FLUSH (9) Cache flush command support. +\change_inserted 1531152142 1341305427 + +\end_layout + +\begin_layout Description + +\change_inserted 1531152142 1341301882 +VIRTIO_BLK_F_TOPOLOGY (10) Device exports information on optimal I/O alignment. +\end_layout + +\end_deeper +\begin_layout Description +Device \begin_inset space ~ \end_inset @@ -5090,6 +5103,48 @@ struct virtio_blk_config { \begin_layout Plain Layout +\change_inserted 1531152142 1341301807 + + struct virtio_blk_topology { +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1341301810 + + u8 physical_block_exp; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1341301817 + + u8 alignment_offset; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1341301822 + + u16 min_io_size; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1341301827 + + u32 opt_io_size; +\end_layout + +\begin_layout Plain Layout + +\change_inserted 1531152142 1341301911 + + } topology; +\end_layout + +\begin_layout Plain Layout + }; \end_layout @@ -5098,7 +5153,6 @@ struct virtio_blk_config { \end_layout -\end_deeper \begin_layout Section* Device Initialization \end_layout @@ -5119,15 +5173,36 @@ capacity \begin_layout Enumerate If the VIRTIO_BLK_F_BLK_SIZE feature is negotiated, the blk_size field can be read to determine the optimal sector size for the driver to use. - This does not effect the units used in the protocol (always 512 bytes), - but awareness of the correct value can effect performance. + This does not +\change_deleted 1531152142 1341301967 +e +\change_inserted 1531152142 1341301967 +a +\change_unchanged +ffect the units used in the protocol (always 512 bytes), but awareness of + the correct value can +\change_deleted 1531152142 1341301978 +e +\change_inserted 1531152142 1341301978 +a +\change_unchanged +ffect performance. \end_layout \begin_layout Enumerate If the VIRTIO_BLK_F_RO feature is set by the device, any write requests will fail. -\change_inserted 1531152142 1341301982 +\change_inserted 1531152142 1341301920 + +\end_layout +\begin_layout Enumerate + +\change_inserted 1531152142 1341301982 +If the VIRTIO_BLK_F_TOPOLOGY feature is negotiated, the fields in the topology + struct can be read to determine the physical block size and optimal I/O + lengths for the driver to use. + This also does not affect the units in the protocol, only performance. \end_layout \begin_layout Section*