]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check
authorEugenio Pérez <eperezma@redhat.com>
Tue, 17 Jan 2023 10:53:08 +0000 (11:53 +0100)
committerJason Wang <jasowang@redhat.com>
Fri, 17 Feb 2023 05:31:33 +0000 (13:31 +0800)
VHOST_BACKEND_F_IOTLB_ASID is the feature bit, not the bitmask. Since
the device under test also provided VHOST_BACKEND_F_IOTLB_MSG_V2 and
VHOST_BACKEND_F_IOTLB_BATCH, this went unnoticed.

Fixes: c1a1008685 ("vdpa: always start CVQ in SVQ mode if possible")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/vhost-vdpa.c

index 1a13a34d35c0577bf0efb221c8b800decfcd144f..de5ed8ff22ca6a744b1ef2c89377193a8238c84a 100644 (file)
@@ -384,7 +384,7 @@ static int vhost_vdpa_net_cvq_start(NetClientState *nc)
             g_strerror(errno), errno);
         return -1;
     }
-    if (!(backend_features & VHOST_BACKEND_F_IOTLB_ASID) ||
+    if (!(backend_features & BIT_ULL(VHOST_BACKEND_F_IOTLB_ASID)) ||
         !vhost_vdpa_net_valid_svq_features(v->dev->features, NULL)) {
         return 0;
     }