Commit 9b5e830b authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin

vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch()

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: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 7b5d753e
...@@ -957,7 +957,7 @@ static void handle_tx(struct vhost_net *net) ...@@ -957,7 +957,7 @@ static void handle_tx(struct vhost_net *net)
if (!sock) if (!sock)
goto out; goto out;
if (!vq_iotlb_prefetch(vq)) if (!vq_meta_prefetch(vq))
goto out; goto out;
vhost_disable_notify(&net->dev, vq); vhost_disable_notify(&net->dev, vq);
...@@ -1126,7 +1126,7 @@ static void handle_rx(struct vhost_net *net) ...@@ -1126,7 +1126,7 @@ static void handle_rx(struct vhost_net *net)
if (!sock) if (!sock)
goto out; goto out;
if (!vq_iotlb_prefetch(vq)) if (!vq_meta_prefetch(vq))
goto out; goto out;
vhost_disable_notify(&net->dev, vq); vhost_disable_notify(&net->dev, vq);
......
...@@ -1331,7 +1331,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, ...@@ -1331,7 +1331,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq,
return true; 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; size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;
unsigned int num = vq->num; unsigned int num = vq->num;
...@@ -1350,7 +1350,7 @@ int vq_iotlb_prefetch(struct vhost_virtqueue *vq) ...@@ -1350,7 +1350,7 @@ int vq_iotlb_prefetch(struct vhost_virtqueue *vq)
num * sizeof(*vq->used->ring) + s, num * sizeof(*vq->used->ring) + s,
VHOST_ADDR_USED); VHOST_ADDR_USED);
} }
EXPORT_SYMBOL_GPL(vq_iotlb_prefetch); EXPORT_SYMBOL_GPL(vq_meta_prefetch);
/* Can we log writes? */ /* Can we log writes? */
/* Caller should have device mutex but not vq mutex */ /* Caller should have device mutex but not vq mutex */
......
...@@ -212,7 +212,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *); ...@@ -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, int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
unsigned int log_num, u64 len, unsigned int log_num, u64 len,
struct iovec *iov, int count); 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); struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type);
void vhost_enqueue_msg(struct vhost_dev *dev, void vhost_enqueue_msg(struct vhost_dev *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment