Skip to content

Commit 9b5e830

Browse files
jasowangmstsirkin
authored andcommitted
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: Jason Wang <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 7b5d753 commit 9b5e830

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/vhost/net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ static void handle_tx(struct vhost_net *net)
957957
if (!sock)
958958
goto out;
959959

960-
if (!vq_iotlb_prefetch(vq))
960+
if (!vq_meta_prefetch(vq))
961961
goto out;
962962

963963
vhost_disable_notify(&net->dev, vq);
@@ -1126,7 +1126,7 @@ static void handle_rx(struct vhost_net *net)
11261126
if (!sock)
11271127
goto out;
11281128

1129-
if (!vq_iotlb_prefetch(vq))
1129+
if (!vq_meta_prefetch(vq))
11301130
goto out;
11311131

11321132
vhost_disable_notify(&net->dev, vq);

drivers/vhost/vhost.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq,
13311331
return true;
13321332
}
13331333

1334-
int vq_iotlb_prefetch(struct vhost_virtqueue *vq)
1334+
int vq_meta_prefetch(struct vhost_virtqueue *vq)
13351335
{
13361336
size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0;
13371337
unsigned int num = vq->num;
@@ -1350,7 +1350,7 @@ int vq_iotlb_prefetch(struct vhost_virtqueue *vq)
13501350
num * sizeof(*vq->used->ring) + s,
13511351
VHOST_ADDR_USED);
13521352
}
1353-
EXPORT_SYMBOL_GPL(vq_iotlb_prefetch);
1353+
EXPORT_SYMBOL_GPL(vq_meta_prefetch);
13541354

13551355
/* Can we log writes? */
13561356
/* Caller should have device mutex but not vq mutex */

drivers/vhost/vhost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
212212
int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
213213
unsigned int log_num, u64 len,
214214
struct iovec *iov, int count);
215-
int vq_iotlb_prefetch(struct vhost_virtqueue *vq);
215+
int vq_meta_prefetch(struct vhost_virtqueue *vq);
216216

217217
struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type);
218218
void vhost_enqueue_msg(struct vhost_dev *dev,

0 commit comments

Comments
 (0)