[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACGkMEvM7mxtezJEqg8f==mLqoy9ZbVPb=vwQ6Ydvrtje-rjSQ@mail.gmail.com>
Date: Mon, 29 Dec 2025 15:16:30 +0800
From: Jason Wang <jasowang@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: xuanzhuo@...ux.alibaba.com, eperezma@...hat.com,
virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V11 13/19] virtio_ring: introduce virtqueue ops
On Sat, Dec 27, 2025 at 3:37 AM Michael S. Tsirkin <mst@...hat.com> wrote:
>
> On Thu, Dec 25, 2025 at 12:26:02PM +0800, Jason Wang wrote:
> > This patch introduces virtqueue ops which is a set of callbacks
> > that will be called for different queue layout or features. This would
> > help to avoid branches for split/packed and will ease the future
> > implementation like in order.
> >
> > Note that in order to eliminate the indirect calls this patch uses
> > global array of const ops to allow compiler to avoid indirect
> > branches.
> >
> > Tested with CONFIG_MITIGATION_RETPOLINE, no performance differences
> > were noticed.
> >
> > Acked-by: Eugenio Pérez <eperezma@...hat.com>
> > Suggested-by: Michael S. Tsirkin <mst@...hat.com>
> > Signed-off-by: Jason Wang <jasowang@...hat.com>
> > ---
> > drivers/virtio/virtio_ring.c | 173 ++++++++++++++++++++++++++---------
> > 1 file changed, 130 insertions(+), 43 deletions(-)
> >
> > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> > index f804c5c6975a..4e905dc7b6cb 100644
> > --- a/drivers/virtio/virtio_ring.c
> > +++ b/drivers/virtio/virtio_ring.c
> > @@ -67,6 +67,12 @@
> > #define LAST_ADD_TIME_INVALID(vq)
> > #endif
> >
> > +enum vq_layout {
> > + SPLIT = 0,
> > + PACKED,
> > + VQ_TYPE_MAX,
> > +};
> > +
>
> VQ_LAYOUT_SPLIT and VQ_LAYOUT_PACKED would be better.
>
> and VQ_LAYOUT_MAX for consistency.
>
>
Fixed.
Thanks
Powered by blists - more mailing lists