From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Liang, Cunming" Subject: RE: [virtio-dev] packed ring layout proposal v3 Date: Wed, 20 Sep 2017 09:11:57 +0000 Message-ID: References: <20160915223915.qjlnlvf2w7u37bu3@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160915223915.qjlnlvf2w7u37bu3@redhat.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: "Michael S. Tsirkin" , "virtio-dev@lists.oasis-open.org" Cc: "virtualization@lists.linux-foundation.org" List-Id: virtualization@lists.linuxfoundation.org Hi Michael, > -----Original Message----- > From: virtio-dev@lists.oasis-open.org [mailto:virtio-dev@lists.oasis-open.org] > On Behalf Of Michael S. Tsirkin > Sent: Sunday, September 10, 2017 1:06 PM > To: virtio-dev@lists.oasis-open.org > Cc: virtualization@lists.linux-foundation.org > Subject: [virtio-dev] packed ring layout proposal v3 > [...] > * Descriptor ring: > > Driver writes descriptors with unique index values and DESC_DRIVER set in > flags. > Descriptors are written in a ring order: from start to end of ring, wrapping > around to the beginning. > Device writes used descriptors with correct len, index, and DESC_HW clear. > Again descriptors are written in ring order. This might not be the same order > of driver descriptors, and not all descriptors have to be written out. > > Driver and device are expected to maintain (internally) a wrap-around bit, > starting at 0 and changing value each time they start writing out descriptors > at the beginning of the ring. This bit is passed as DESC_WRAP bit in the flags > field. One simple question there, trying to understand the usage of DESC_WRAP flag. DESC_WRAP bit is a new flag since v2. It's used to address 'non power-of-2 ring sizes' mentioned in v2? Being confused by the statement of wrap-around bit here, it's an internal wrap-around counter represented by single bit (0/1)? DESC_WRAP can appear on any descriptor entry in the ring, why it highlights changing value at the beginning of the ring? > > Flags are always set/cleared last. > > Note that driver can write descriptors out in any order, but device will not > execute descriptor X+1 until descriptor X has been read as valid. > > Driver operation: > [...] > > DESC_WRAP - device uses this field to detect descriptor change by driver. Device uses this field to detect change of wrap-around boundary by driver? [...] > > Device operation (using descriptors): > [...] > > DESC_WRAP - driver uses this field to detect descriptor change by device. Driver uses this field to detect change of wrap-around boundary by device? By using this, driver doesn't need to maintain any internal wrap-around count, but being aware of wrap-around by DESC_WRAP flag. Thanks, Steve > [...] > > --- > > Note: should this proposal be accepted and approved, one or more > claims disclosed to the TC admin and listed on the Virtio TC > IPR page https://www.oasis-open.org/committees/virtio/ipr.php > might become Essential Claims. > Note: the page above is unfortunately out of date and out of > my hands. I'm in the process of updating ipr disclosures > in github instead. Will make sure all is in place before > this proposal is put to vote. As usual this TC operates under the > Non-Assertion Mode of the OASIS IPR Policy, which protects > anyone implementing the virtio spec. > > -- > MST > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-2554-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [66.179.20.138]) by lists.oasis-open.org (Postfix) with ESMTP id EACAF58191F8 for ; Wed, 20 Sep 2017 02:12:02 -0700 (PDT) From: "Liang, Cunming" Date: Wed, 20 Sep 2017 09:11:57 +0000 Message-ID: References: <20160915223915.qjlnlvf2w7u37bu3@redhat.com> In-Reply-To: <20160915223915.qjlnlvf2w7u37bu3@redhat.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [virtio-dev] packed ring layout proposal v3 To: "Michael S. Tsirkin" , "virtio-dev@lists.oasis-open.org" Cc: "virtualization@lists.linux-foundation.org" List-ID: Hi Michael, > -----Original Message----- > From: virtio-dev@lists.oasis-open.org [mailto:virtio-dev@lists.oasis-open= .org] > On Behalf Of Michael S. Tsirkin > Sent: Sunday, September 10, 2017 1:06 PM > To: virtio-dev@lists.oasis-open.org > Cc: virtualization@lists.linux-foundation.org > Subject: [virtio-dev] packed ring layout proposal v3 >=20 [...] > * Descriptor ring: >=20 > Driver writes descriptors with unique index values and DESC_DRIVER set in > flags. > Descriptors are written in a ring order: from start to end of ring, wrapp= ing > around to the beginning. > Device writes used descriptors with correct len, index, and DESC_HW clear= . > Again descriptors are written in ring order. This might not be the same o= rder > of driver descriptors, and not all descriptors have to be written out. >=20 > Driver and device are expected to maintain (internally) a wrap-around bit= , > starting at 0 and changing value each time they start writing out descrip= tors > at the beginning of the ring. This bit is passed as DESC_WRAP bit in the = flags > field. One simple question there, trying to understand the usage of DESC_WRAP flag= . DESC_WRAP bit is a new flag since v2. It's used to address 'non power-of-2 = ring sizes' mentioned in v2? Being confused by the statement of wrap-around bit here, it's an internal w= rap-around counter represented by single bit (0/1)? DESC_WRAP can appear on any descriptor entry in the ring, why it highlights= changing value at the beginning of the ring? >=20 > Flags are always set/cleared last. >=20 > Note that driver can write descriptors out in any order, but device will = not > execute descriptor X+1 until descriptor X has been read as valid. >=20 > Driver operation: >=20 [...] >=20 > DESC_WRAP - device uses this field to detect descriptor change by driver. Device uses this field to detect change of wrap-around boundary by driver?= =20 [...] >=20 > Device operation (using descriptors): >=20 [...] >=20 > DESC_WRAP - driver uses this field to detect descriptor change by device. Driver uses this field to detect change of wrap-around boundary by device? By using this, driver doesn't need to maintain any internal wrap-around cou= nt, but being aware of wrap-around by DESC_WRAP flag. Thanks, Steve >=20 [...] >=20 > --- >=20 > Note: should this proposal be accepted and approved, one or more > claims disclosed to the TC admin and listed on the Virtio TC > IPR page https://www.oasis-open.org/committees/virtio/ipr.php > might become Essential Claims. > Note: the page above is unfortunately out of date and out of > my hands. I'm in the process of updating ipr disclosures > in github instead. Will make sure all is in place before > this proposal is put to vote. As usual this TC operates under the > Non-Assertion Mode of the OASIS IPR Policy, which protects > anyone implementing the virtio spec. >=20 > -- > MST >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org