[<prev] [next>] [day] [month] [year] [list]
Message-ID: <286AC319A985734F985F78AFA26841F7A12868@shsmsx102.ccr.corp.intel.com>
Date: Fri, 28 Aug 2015 05:25:41 +0000
From: "Wang, Wei W" <wei.w.wang@...el.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: RE: A question about vring operation
On 24/07/2015 21:36, Michael S. Tsirkin wrote:
>On Thu, Aug 27, 2015 at 01:18:47AM +0000, Wang, Wei W wrote:
> Hi all,
>
>
>
> I have a question about the vring_avail:
>
> It only includes an idx (equivalent to the ring tail), which is used
> by the frontend (virtio_net) to fill bufs. The backend (e.g.
> vhost_net) maintains the ring head (last_avail_idx) by itself. The
> frontend checks if the ring is full or empty via a counter (vq->num_free).
>
> My question is why can’t we include the ring head in the vring_avail
> struct, so that the vq->num_free is not needed, and the backend can
> directly use it without maintaining its own copy?
>
>
>
> Thanks,
>
> Wei
>
>
>
>I'm not sure I understand your proposal, and what it would accomplish. Write a patch, that'll make it easier to discuss.
>Also copy all relevant mailing lists, not just kvm.
Thanks Michael. I haven’t got the patch ready yet. I am just wondering if it is better to have "last_avail_idx" in vhost_virtqueue moved into vring_avail.
In other regular ring operations, we usually use *head and *tail to judge if the ring is full or empty, but it seems vring_avail does not use this method in virtio_net.c (it uses a counter).
Best,
Wei
Powered by blists - more mailing lists