search for: virtqueue_kick_prepare_split

Displaying 20 results from an estimated 33 matches for "virtqueue_kick_prepare_split".

2023 Mar 02
1
[PATCH vhost v1 01/12] virtio_ring: split: refactor virtqueue_add_split() for premapped
..., out_sgs, in_sgs, desc); + if (err) + goto err; + + /* Store token and indirect buffer state. */ + vq->split.desc_state[head].data = data; + vq->split.desc_state[head].indir_desc = desc ? desc : ctx; + + goto end; + +err: + kfree(desc); + +end: + END_USE(vq); + return err; +} + static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); -- 2.32.0.3.g01195cf9f
2019 Nov 14
0
[PATCH 1/1] virtio_ring: fix return code on DMA mapping fails
...ers/virtio/virtio_ring.c index a8041e451e9e..867c7ebd3f10 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -583,7 +583,7 @@ static inline int virtqueue_add_split(struct virtqueue *_vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) @@ -1085,7 +1085,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, kfree(desc); END_USE(vq); - return -EIO; + return -ENOMEM; } static inline int virtqueue_add_packed(struct virtqueue *_vq, -- 2.17.1
2023 Feb 20
2
[PATCH vhost 01/10] virtio_ring: split: refactor virtqueue_add_split() for premapped
...desc ? desc : ctx; > + > + goto end; > + > +err: > + virtqueue_unmap_sgs(vq, sgs, total_sg, out_sgs, in_sgs); > + > + kfree(desc); > + > +end: > END_USE(vq); > - return -ENOMEM; > + return err; > } > > static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > -- > 2.32.0.3.g01195cf9f >
2023 Feb 20
1
[PATCH vhost 04/10] virtio_ring: split: introduce virtqueue_add_split_premapped()
...nd so did for packed (patch 5). > > Thanks > > > > > + > > + goto end; > > + > > +err: > > + kfree(desc); > > + > > +end: > > + END_USE(vq); > > + return err; > > +} > > + > > static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > > { > > struct vring_virtqueue *vq = to_vvq(_vq); > > @@ -824,20 +869,23 @@ static void detach_buf_split(struct vring_virtqueue *vq, unsigned int head, > > { > > unsigned int i, j; > > __virtio16 nextflag = cpu_t...
2023 Jun 22
1
[PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver
...2 files changed, 119 insertions(+), 10 deletions(-) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index dc109fbc05a5..cdc4349f6066 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -754,8 +754,95 @@ static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > return needs_kick; > } > > -static void detach_buf_split(struct vring_virtqueue *vq, unsigned int head, > - void **ctx) > +static void detach_cursor_init_split(struct vring_virtqueue *vq, > + struct virtqueue_detach_cursor *cursor, u...
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi, This patch set implements packed ring support in virtio driver. A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw ~30% performance gain in packed ring in this case. To make this patch set work with below patch set for vhost, some hacks are needed to set the _F_NEXT flag in indirect descriptors (this should
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi, This patch set implements packed ring support in virtio driver. A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw ~30% performance gain in packed ring in this case. To make this patch set work with below patch set for vhost, some hacks are needed to set the _F_NEXT flag in indirect descriptors (this should
2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...t virtqueue *_vq, goto unmap_release; vq->split.vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, - VRING_DESC_F_INDIRECT); + BIT(VRING_SPLIT_DESC_F_INDIRECT)); vq->split.vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, addr); @@ -603,8 +607,8 @@ static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) new, old); } else { needs_kick = !(vq->split.vring.used->flags & - cpu_to_virtio16(_vq->vdev, - VRING_USED_F_NO_NOTIFY)); + cpu_to_virtio16(_vq->vdev, + BIT(VRING_SPLIT_USED_F_NO_NOTIFY))); } END_USE(vq); return needs_kic...
2018 May 22
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...+) { if (i == err_idx) break; - vring_unmap_one(vq, &desc[i]); + vring_unmap_one_split(vq, &desc[i]); i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); } @@ -435,6 +479,355 @@ static inline int virtqueue_add(struct virtqueue *_vq, return -EIO; } +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + u16 new, old; + bool needs_kick; + + START_USE(vq); + /* We need to expose available array entries before checking avail + * event. */ + virtio_mb(vq->weak_barriers); + + old = vq->avail_idx_shadow - vq->num_added; +...
2018 Jul 11
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...+) { if (i == err_idx) break; - vring_unmap_one(vq, &desc[i]); + vring_unmap_one_split(vq, &desc[i]); i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); } @@ -434,6 +478,355 @@ static inline int virtqueue_add(struct virtqueue *_vq, return -EIO; } +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + u16 new, old; + bool needs_kick; + + START_USE(vq); + /* We need to expose available array entries before checking avail + * event. */ + virtio_mb(vq->weak_barriers); + + old = vq->avail_idx_shadow - vq->num_added; +...
2018 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
..._one(vq, &desc[i]); > + vring_unmap_one_split(vq, &desc[i]); > i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); > } > > @@ -435,6 +479,355 @@ static inline int virtqueue_add(struct virtqueue *_vq, > return -EIO; > } > > +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); > + u16 new, old; > + bool needs_kick; > + > + START_USE(vq); > + /* We need to expose available array entries before checking avail > + * event. */ > + virtio_mb(vq->weak_barriers); > + >...
2018 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
..._one(vq, &desc[i]); > + vring_unmap_one_split(vq, &desc[i]); > i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next); > } > > @@ -435,6 +479,355 @@ static inline int virtqueue_add(struct virtqueue *_vq, > return -EIO; > } > > +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); > + u16 new, old; > + bool needs_kick; > + > + START_USE(vq); > + /* We need to expose available array entries before checking avail > + * event. */ > + virtio_mb(vq->weak_barriers); > + >...
2018 Apr 10
0
[RFC v2] virtio: support packed ring
...ue_kick_prepare(vq)) > - * virtqueue_notify(vq); > - * > - * This is sometimes useful because the virtqueue_kick_prepare() needs > - * to be serialized, but the actual virtqueue_notify() call does not. > - */ > -bool virtqueue_kick_prepare(struct virtqueue *_vq) > +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > u16 new, old; > @@ -580,6 +844,62 @@ bool virtqueue_kick_prepare(struct virtqueue *_vq) > END_USE(vq); > return needs_kick; > } > + > +static bool virtqueue_kick_prepare_packed(struct...
2023 Feb 14
11
[PATCH vhost 00/10] virtio core prepares for AF_XDP
XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero copy feature of xsk (XDP socket) needs to be supported by the driver. The performance of zero copy is very good. ENV: Qemu with vhost. vhost cpu | Guest APP CPU |Guest Softirq CPU | PPS -----------------------------|---------------|------------------|------------ xmit by sockperf: 90% | 100%
2018 Apr 13
0
[RFC v2] virtio: support packed ring
...ue_kick_prepare(vq)) > - * virtqueue_notify(vq); > - * > - * This is sometimes useful because the virtqueue_kick_prepare() needs > - * to be serialized, but the actual virtqueue_notify() call does not. > - */ > -bool virtqueue_kick_prepare(struct virtqueue *_vq) > +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > u16 new, old; > @@ -580,6 +844,62 @@ bool virtqueue_kick_prepare(struct virtqueue *_vq) > END_USE(vq); > return needs_kick; > } > + > +static bool virtqueue_kick_prepare_packed(struct...
2018 May 22
9
[RFC v5 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost (RFC v4): https://lkml.org/lkml/2018/5/16/501 Both of ping and netperf worked as expected w/ EVENT_IDX disabled. Ping worked as expected w/ EVENT_IDX enabled, but netperf didn't (A hack has been added in the driver to
2018 May 22
9
[RFC v5 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost (RFC v4): https://lkml.org/lkml/2018/5/16/501 Both of ping and netperf worked as expected w/ EVENT_IDX disabled. Ping worked as expected w/ EVENT_IDX enabled, but netperf didn't (A hack has been added in the driver to
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread: https://patchwork.ozlabs.org/patch/1001015/#2042353 Tiwei Bie (3): virtio_ring: define flags as shifts consistently virtio_ring: add VIRTIO_RING_NO_LEGACY virtio_ring: use new vring flags drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++------------- include/uapi/linux/virtio_ring.h | 61 +++++++++++++------ 2 files changed,
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread: https://patchwork.ozlabs.org/patch/1001015/#2042353 Tiwei Bie (3): virtio_ring: define flags as shifts consistently virtio_ring: add VIRTIO_RING_NO_LEGACY virtio_ring: use new vring flags drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++------------- include/uapi/linux/virtio_ring.h | 61 +++++++++++++------ 2 files changed,
2018 Apr 01
8
[RFC v2] virtio: support packed ring
...kick(), you can do: - * if (virtqueue_kick_prepare(vq)) - * virtqueue_notify(vq); - * - * This is sometimes useful because the virtqueue_kick_prepare() needs - * to be serialized, but the actual virtqueue_notify() call does not. - */ -bool virtqueue_kick_prepare(struct virtqueue *_vq) +static bool virtqueue_kick_prepare_split(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); u16 new, old; @@ -580,6 +844,62 @@ bool virtqueue_kick_prepare(struct virtqueue *_vq) END_USE(vq); return needs_kick; } + +static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) +{ + struct vring_virtqueue *vq =...