[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251014050901-mutt-send-email-mst@kernel.org>
Date: Tue, 14 Oct 2025 05:13:38 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: xuanzhuo@...ux.alibaba.com, eperezma@...hat.com,
virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V7 19/19] virtio_ring: add in order support
On Thu, Sep 25, 2025 at 06:37:08PM +0800, Jason Wang wrote:
> @@ -683,7 +707,12 @@ static inline int virtqueue_add_split(struct vring_virtqueue *vq,
> vq->vq.num_free -= descs_used;
>
> /* Update free pointer */
> - if (indirect)
> + if (virtqueue_is_in_order(vq)) {
> + vq->free_head += descs_used;
> + if (vq->free_head >= vq->split.vring.num)
> + vq->free_head -= vq->split.vring.num;
> + vq->split.desc_state[head].total_len = total_len;;
> + } else if (indirect)
> vq->free_head = vq->split.desc_extra[head].next;
> else
> vq->free_head = i;
So in order is clearly doing something funky with the free_head.
It's no longer a head of a linked list of free descriptors, is it?
what is it doing and why? Please add code comments to explain
both where free_list is defined and where it's used.
For example, virtqueue_vring_attach_packed only inits free_list
if not in order. So who will init it for in order? And so on.
--
MST
Powered by blists - more mailing lists