vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch()
authorJason Wang <jasowang@redhat.com>
Fri, 24 May 2019 08:12:15 +0000 (04:12 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 5 Jun 2019 20:23:52 +0000 (16:23 -0400)
Rename the function to be more accurate since it actually tries to
prefetch vq metadata address in IOTLB. And this will be used by
following patch to prefetch metadata virtual addresses.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h

index 2d9df786a9d31823e86e1e857c9f6670f61eca19..3beb401235c046cc5090a4ed7e5d219d9251146b 100644 (file)
@@ -957,7 +957,7 @@ static void handle_tx(struct vhost_net *net)
        if (!sock)
                goto out;
 
-       if (!vq_iotlb_prefetch(vq))
+       if (!vq_meta_prefetch(vq))
                goto out;
 
        vhost_disable_notify(&net->dev, vq);
@@ -1126,7 +1126,7 @@ static void handle_rx(struct vhost_net *net)
        if (!sock)
                goto out;
 
-       if (!vq_iotlb_prefetch(vq))
+       if (!vq_meta_prefetch(vq))
                goto out;
 
        vhost_disable_notify(&net->dev, vq);
index b89faedbb9bd145f4ba1609a4465a5e07a707ca9..a0f2fbf35a27d20c00f843c6ee0cb106e1328486 100644 (file)
@@ -1331,7 +1331,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq,
        return true;
 }
 
-int vq_iotlb_prefetch(struct vhost_virtqueue *vq)
+int vq_meta_prefetch(struct vhost_virtqueue *vq)
 {
        size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;
        unsigned int num = vq->num;
@@ -1350,7 +1350,7 @@ int vq_iotlb_prefetch(struct vhost_virtqueue *vq)
                               num * sizeof(*vq->used->ring) + s,
                               VHOST_ADDR_USED);
 }
-EXPORT_SYMBOL_GPL(vq_iotlb_prefetch);
+EXPORT_SYMBOL_GPL(vq_meta_prefetch);
 
 /* Can we log writes? */
 /* Caller should have device mutex but not vq mutex */
index 27a78a9b8cc7dc6e21626f1134d34055ca71dfe2..e9ed2722b63333404b444f55dd4638a5358c59fa 100644 (file)
@@ -212,7 +212,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
                    unsigned int log_num, u64 len,
                    struct iovec *iov, int count);
-int vq_iotlb_prefetch(struct vhost_virtqueue *vq);
+int vq_meta_prefetch(struct vhost_virtqueue *vq);
 
 struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type);
 void vhost_enqueue_msg(struct vhost_dev *dev,