search for: vhost_get_desc

Displaying 20 results from an estimated 122 matches for "vhost_get_desc".

2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +172,20 @@...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +172,20 @@...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
This patch adds support for the Mergeable Receive Buffers feature to vhost_net. +-DLS Changes from previous revision: 1) renamed: vhost_discard_vq_desc -> vhost_discard_desc vhost_get_heads -> vhost_get_desc_n vhost_get_vq_desc -> vhost_get_desc 2) added heads as argument to ghost_get_desc_n 3) changed "vq->heads" from iovec to vring_used_elem, removed casts 4) changed vhost_add_used to do multiple elements in a single copy_to_user, or two when we wrap the ring. 5) removed rxmaxheadco...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
This patch adds support for the Mergeable Receive Buffers feature to vhost_net. +-DLS Changes from previous revision: 1) renamed: vhost_discard_vq_desc -> vhost_discard_desc vhost_get_heads -> vhost_get_desc_n vhost_get_vq_desc -> vhost_get_desc 2) added heads as argument to ghost_get_desc_n 3) changed "vq->heads" from iovec to vring_used_elem, removed casts 4) changed vhost_add_used to do multiple elements in a single copy_to_user, or two when we wrap the ring. 5) removed rxmaxheadco...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +155,20 @@...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +155,20 @@...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -154,20 +154,20 @@...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -154,20 +154,20 @@...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +155,20 @@...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) { - head = vhost_get_vq_desc(&net->dev, vq, vq->iov, - ARRAY_SIZE(vq->iov), - &out, &in, - NULL, NULL); + head = vhost_get_desc(&net->dev, vq, vq->iov, + ARRAY_SIZE(vq->iov), + &out, &in, + NULL, NULL); /* Nothing new? Wait for eventfd to tell us they refilled. */ if (head == vq->num) { wmem = atomic_read(&sock->sk->sk_wmem_alloc); @@ -155,20 +155,20 @@...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...+{ > + return vhost_get_avail(vq, *event, vhost_used_event(vq)); > +} > + > +static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, > + __virtio16 *idx) > +{ > + return vhost_get_used(vq, *idx, &vq->used->idx); > +} > + > +static inline int vhost_get_desc(struct vhost_virtqueue *vq, > + struct vring_desc *desc, int idx) > +{ > + return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc)); > +} > + > static int vhost_new_umem_range(struct vhost_umem *umem, > u64 start, u64 size, u64 end, > u64 userspace...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...+{ > + return vhost_get_avail(vq, *event, vhost_used_event(vq)); > +} > + > +static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, > + __virtio16 *idx) > +{ > + return vhost_get_used(vq, *idx, &vq->used->idx); > +} > + > +static inline int vhost_get_desc(struct vhost_virtqueue *vq, > + struct vring_desc *desc, int idx) > +{ > + return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc)); > +} > + > static int vhost_new_umem_range(struct vhost_umem *umem, > u64 start, u64 size, u64 end, > u64 userspace...
2018 Jul 03
0
[PATCH net-next 1/8] vhost: move get_rx_bufs to vhost.c
...ns(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29756d8..712b134 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -685,83 +685,6 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk) return len; } -/* This is a multi-buffer version of vhost_get_desc, that works if - * vq has read descriptors only. - * @vq - the relevant virtqueue - * @datalen - data length we'll be reading - * @iovcount - returned count of io vectors we fill - * @log - vhost log - * @log_num - log offset - * @quota - headcount quota, 1 for big buffer - * returns nu...
2018 Apr 23
0
[RFC V3 PATCH 1/8] vhost: move get_rx_bufs to vhost.c
...ns(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 986058a..762aa81 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -664,83 +664,6 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk) return len; } -/* This is a multi-buffer version of vhost_get_desc, that works if - * vq has read descriptors only. - * @vq - the relevant virtqueue - * @datalen - data length we'll be reading - * @iovcount - returned count of io vectors we fill - * @log - vhost log - * @log_num - log offset - * @quota - headcount quota, 1 for big buffer - * returns nu...
2019 Mar 06
0
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...host_virtqueue *vq, + __virtio16 *event) +{ + return vhost_get_avail(vq, *event, vhost_used_event(vq)); +} + +static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, + __virtio16 *idx) +{ + return vhost_get_used(vq, *idx, &vq->used->idx); +} + +static inline int vhost_get_desc(struct vhost_virtqueue *vq, + struct vring_desc *desc, int idx) +{ + return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc)); +} + static int vhost_new_umem_range(struct vhost_umem *umem, u64 start, u64 size, u64 end, u64 userspace_addr, int perm) @@ -1840,8 +1905,7 @...
2018 May 02
1
[RFC V3 PATCH 1/8] vhost: move get_rx_bufs to vhost.c
...b/drivers/vhost/net.c > index 986058a..762aa81 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -664,83 +664,6 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk) > return len; > } > > -/* This is a multi-buffer version of vhost_get_desc, that works if > - * vq has read descriptors only. > - * @vq - the relevant virtqueue > - * @datalen - data length we'll be reading > - * @iovcount - returned count of io vectors we fill > - * @log - vhost log > - * @log_num - log offset > - * @quota - headcount quo...
2019 Mar 07
0
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
..., *event, vhost_used_event(vq)); >> +} >> + >> +static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, >> + __virtio16 *idx) >> +{ >> + return vhost_get_used(vq, *idx, &vq->used->idx); >> +} >> + >> +static inline int vhost_get_desc(struct vhost_virtqueue *vq, >> + struct vring_desc *desc, int idx) >> +{ >> + return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc)); >> +} >> + >> static int vhost_new_umem_range(struct vhost_umem *umem, >> u64 start, u64 size, u64...
2020 Jun 03
1
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...gt;> + if (unlikely(++found > vq->num)) { >>> + vq_err(vq, "Loop detected: last one at %u " >>> + "vq size %u head %u\n", >>> + i, vq->num, head); >>> + return -EINVAL; >>> + } >>> + ret = vhost_get_desc(vq, &desc, i); >>> + if (unlikely(ret)) { >>> + vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", >>> + i, vq->desc + i); >>> + return -EFAULT; >>> + } >>> + ret = push_split_desc(vq, &desc, head); &gt...
2018 Dec 28
4
[RFC PATCH V2 0/3] vhost: accelerate metadata access through vmap()
Hi: This series tries to access virtqueue metadata through kernel virtual address instead of copy_user() friends since they had too much overheads like checks, spec barriers or even hardware feature toggling. Test shows about 24% improvement on TX PPS. It should benefit other cases as well. Changes from V1: - instead of pinning pages, use MMU notifier to invalidate vmaps and remap duing
2019 Jun 06
2
[PATCH] vhost: Don't use defined in VHOST_ARCH_CAN_ACCEL_UACCESS definition
...t_used_idx(struct vhost_virtqueue *vq, __virtio16 *idx) { -#if VHOST_ARCH_CAN_ACCEL_UACCESS +#ifdef VHOST_ARCH_CAN_ACCEL_UACCESS struct vhost_map *map; struct vring_used *used; @@ -1466,7 +1466,7 @@ static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, static inline int vhost_get_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, int idx) { -#if VHOST_ARCH_CAN_ACCEL_UACCESS +#ifdef VHOST_ARCH_CAN_ACCEL_UACCESS struct vhost_map *map; struct vring_desc *d; @@ -1825,7 +1825,7 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -#if VHO...