Re: [PATCH v2] virtio_ring: use shadow flags when detaching split descriptors

From: Michael S. Tsirkin

Date: Thu Oct 08 2026 - 02:21:41 EST


On Thu, Oct 08, 2026 at 09:21:38AM +0800, Xuan Zhuo wrote:
> On Tue, 6 Oct 2026 19:21:12 +0900, sungbyeongchan <tjdqudcks0424@xxxxxxxxx> wrote:
> > Fixes: 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra for split virtqueue")
> > Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> > Assisted-by: LLM
> > Signed-off-by: sungbyeongchan <tjdqudcks0424@xxxxxxxxx>
> > ---
> > Changes in v2:
> > - Drop the commit message paragraphs as requested by Michael S. Tsirkin.
>
> You misunderstood him.
>
> We can not accept a commit without commit message.


Indeed.
>
> > - Add Michael's Acked-by.
> >
> > drivers/virtio/virtio_ring.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> > index db678f5a80e03..b4cb433df1dec 100644
> > --- a/drivers/virtio/virtio_ring.c
> > +++ b/drivers/virtio/virtio_ring.c
> > @@ -905,7 +905,6 @@ static unsigned detach_buf_split_in_order(struct vring_virtqueue *vq,
> > {
> > struct vring_desc_extra *extra;
> > unsigned int i;
> > - __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
> >
> > /* Clear data ptr. */
> > vq->split.desc_state[head].data = NULL;
> > @@ -915,7 +914,7 @@ static unsigned detach_buf_split_in_order(struct vring_virtqueue *vq,
> > /* Put back on free list: unmap first-level descriptors and find end */
> > i = head;
> >
> > - while (vq->split.vring.desc[i].flags & nextflag) {
> > + while (extra[i].flags & VRING_DESC_F_NEXT) {
> > i = vring_unmap_one_split(vq, &extra[i]);
> > vq->vq.num_free++;
> > }
> > --
> > 2.43.0
> >