Prefer the ring reset approach against the late enable, as it is more
aligned with the standard.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 52415d7e0c..af83de92f8 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -840,8 +840,14 @@ static const VhostShadowVirtqueueOps vhost_vdpa_net_svq_ops = {
*/
static bool vhost_vdpa_should_enable(const struct vhost_vdpa *v)
{
+ VhostVDPAState *s = container_of(v, VhostVDPAState, vhost_vdpa);
struct vhost_dev *dev = v->dev;
+ if (dev->features & VIRTIO_F_RING_RESET && !s->always_svq) {
+ /* Preventing dataplane processing exposing fake SVQ vring */
+ return true;
+ }
+
if (!dev->vq_index_end % 2) {
/* vDPA device does not have CVQ */
return true;
--
2.39.3