Skip to contentSkip to conversation

vdpa_sim: use weak barriers

PATCH In review Jason Wang 3 participants 3 messages Dec 21, 2022 – Dec 23, 2022 virtio core

lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH 1/1 vdpa_sim: use weak barriers

vDPA simulators are software emulated device, so let's switch to use weak barriers to avoid extra overhead in the driver.

---
 drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/vdpa_sim/vdpa_sim.c +1 -1
index b071f0d842fb..eeaeaf43b476 100644
@@ -68,7 +68,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
 	struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
 
 	vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features,
-			  VDPASIM_QUEUE_MAX, false,
+			  VDPASIM_QUEUE_MAX, true,
 			  (struct vring_desc *)(uintptr_t)vq->desc_addr,
 			  (struct vring_avail *)
 			  (uintptr_t)vq->driver_addr,
Signature · 6 lines
2.25.1

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jason Wang

vDPA simulators are software emulated device, so let's switch to use weak barriers to avoid extra overhead in the driver.

---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

I was going to propose the same :-)

Quoted 17 lines
drivers/vdpa/vdpa_sim/vdpa_sim.c +1 -1
index b071f0d842fb..eeaeaf43b476 100644
@@ -68,7 +68,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
 	struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
 
 	vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features,
-			  VDPASIM_QUEUE_MAX, false,
+			  VDPASIM_QUEUE_MAX, true,
 			  (struct vring_desc *)(uintptr_t)vq->desc_addr,
 			  (struct vring_avail *)
 			  (uintptr_t)vq->driver_addr,
Signature · 1 line
2.25.1

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Jason Wang
Quoted 5 lines · Jason Wang

vDPA simulators are software emulated device, so let's switch to use weak barriers to avoid extra overhead in the driver.

Thanks!

Quoted 20 lines
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/vdpa_sim/vdpa_sim.c +1 -2
index b071f0d842fb..eeaeaf43b476 100644
@@ -68,7 +68,7 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, unsigned int idx)
        struct vdpasim_virtqueue *vq = &vdpasim->vqs[idx];
 
        vringh_init_iotlb(&vq->vring, vdpasim->dev_attr.supported_features,
-                         VDPASIM_QUEUE_MAX, false,
+                         VDPASIM_QUEUE_MAX, true,
                          (struct vring_desc *)(uintptr_t)vq->desc_addr,
                          (struct vring_avail *)
                          (uintptr_t)vq->driver_addr,
--

2.25.1