A question about vring operation

From
Wang, Wei W <hidden>
Date
2015-08-27 01:03:33
Also in
kvm
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
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help