]> git.ipfire.org Git - thirdparty/linux.git/commit
virtio_ring: introduce virtqueue ops
authorJason Wang <jasowang@redhat.com>
Tue, 30 Dec 2025 06:46:43 +0000 (14:46 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 31 Dec 2025 10:39:18 +0000 (05:39 -0500)
commit1208473f9b5eb273e787bb1b07a4b2a323692a10
treec2f5271fb8bb2d8112ae4ee878860e47a452c90d
parenteff8b47d2832150f96ab706562cef5a754a0d625
virtio_ring: introduce virtqueue ops

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@redhat.com>
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251230064649.55597-14-jasowang@redhat.com>
drivers/virtio/virtio_ring.c