From patchwork Tue Apr 23 04:05:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 2475331 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4D8E0DF2E5 for ; Tue, 23 Apr 2013 04:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332Ab3DWEWJ (ORCPT ); Tue, 23 Apr 2013 00:22:09 -0400 Received: from ozlabs.org ([203.10.76.45]:52574 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672Ab3DWEWG convert rfc822-to-8bit (ORCPT ); Tue, 23 Apr 2013 00:22:06 -0400 Received: by ozlabs.org (Postfix, from userid 1011) id 007152C016B; Tue, 23 Apr 2013 14:22:04 +1000 (EST) From: Rusty Russell To: Laszlo Ersek Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Paolo Bonzini , "Michael S. Tsirkin" , Stefan Hajnoczi Subject: Re: suggesting wording fixes for virtio-spec 0.9.5 In-Reply-To: <517579AC.2050400@redhat.com> References: <517579AC.2050400@redhat.com> User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Tue, 23 Apr 2013 13:35:00 +0930 Message-ID: <87r4i1gadv.fsf@rustcorp.com.au> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Laszlo Ersek writes: > Hi, > > (I'm not subscribed to either list,) > > using the word "descriptor" is misleading in the following sections: Yes, I like the use of 'descriptor chains'. This is a definite improvement. Here's the diff I ended up with (massaged to minimize it). Thanks! Rusty. Reviewed-by: Laszlo Ersek --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- virtio-spec.txt-old 2013-04-23 13:22:21.339158214 +0930 +++ virtio-spec.txt 2013-04-23 13:34:14.055176464 +0930 @@ -482,10 +482,10 @@ 2.3.4 Available Ring -The available ring refers to what descriptors we are offering the -device: it refers to the head of a descriptor chain. The “flags” +The available ring refers to what descriptor chains we are offering the +device: each entry refers to the head of a descriptor chain. The “flags” field is currently 0 or 1: 1 indicating that we do not need an -interrupt when the device consumes a descriptor from the +interrupt when the device consumes a descriptor chain from the available ring. Alternatively, the guest can ask the device to delay interrupts until an entry with an index specified by the “ used_event” field is written in the used ring (equivalently, @@ -671,16 +671,16 @@ avail->ring[avail->idx % qsz] = head; -However, in general we can add many descriptors before we update -the “idx” field (at which point they become visible to the -device), so we keep a counter of how many we've added: +However, in general we can add many separate descriptor chains before we update +the “idx” field (at which point they become visible to the device), +so we keep a counter of how many we've added: avail->ring[(avail->idx + added++) % qsz] = head; 2.4.1.3 Updating The Index Field Once the idx field of the virtqueue is updated, the device will -be able to access the descriptor entries we've created and the +be able to access the descriptor chains we've created and the memory they refer to. This is why a memory barrier is generally used before the idx update, to ensure it sees the most up-to-date copy.