search for: virtqueue_get_buf_ctx_split

Displaying 20 results from an estimated 52 matches for "virtqueue_get_buf_ctx_split".

2023 Jun 22
1
[PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver
...; kfree(indir_desc); > vq->split.desc_state[head].indir_desc = NULL; > - } else if (ctx) { > - *ctx = vq->split.desc_state[head].indir_desc; > } > } > > @@ -812,7 +897,8 @@ static bool more_used_split(const struct vring_virtqueue *vq) > > static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > unsigned int *len, > - void **ctx) > + void **ctx, > + struct virtqueue_detach_cursor *cursor) > { > struct vring_virtqueue *vq = to_vvq(_vq); > void *ret; > @@ -852,7 +938,15 @@ static void *virtqueue_get_buf_ctx_split(str...
2023 Mar 24
1
[External] Re: [PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...gt; > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index 307e139cb11d..f486cccadbeb 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -795,7 +795,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > > > /* If we expect an interrupt for the next entry, tell host > > > * by writing event index and flush out the write before > > > * the read in the next get_buf call. */ > > > - if (!(vq->split.avail_fl...
2023 Mar 24
1
[External] Re: [PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...; > > > > > > > index 307e139cb11d..f486cccadbeb 100644 > > > > > > > > --- a/drivers/virtio/virtio_ring.c > > > > > > > > +++ b/drivers/virtio/virtio_ring.c > > > > > > > > @@ -795,7 +795,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > > > > > > > > /* If we expect an interrupt for the next entry, tell host > > > > > > > > * by writing event index and flush out the write before > > > > > > > > * the read in t...
2023 Mar 28
2
9p regression (Was: [PATCH v2] virtio_ring: don't update event idx on get_buf)
...e we call virtqueue_get_buf_ctx. This will bring more interruptions. > > To summarize: > 1) event_triggered was set to true in vring_interrupt() > 2) after this nothing will happen for virtqueue_disable_cb() so > VRING_AVAIL_F_NO_INTERRUPT is not set in avail_flags_shadow > 3) virtqueue_get_buf_ctx_split() will still think the cb is enabled > then it tries to publish new event > > To fix, if event_triggered is set to true, do not update > vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap > > Tested with iperf: > iperf3 tcp stream: > vm...
2018 Apr 13
0
[RFC v2] virtio: support packed ring
On Sun, Apr 01, 2018 at 10:12:16PM +0800, Tiwei Bie wrote: > +static inline bool more_used(const struct vring_virtqueue *vq) > +{ > + return vq->packed ? more_used_packed(vq) : more_used_split(vq); > +} > + > +void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, unsigned int *len, > + void **ctx) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); > + void *ret; > + unsigned int i; > + u16 last_used; > + > + START_USE(vq); > + > + if (unlikely(vq->broken)) { > + END_USE(vq); > + return NUL...
2020 Aug 02
0
[PATCH -next v2] virtio_net: Avoid loop in virtnet_poll
On Sun, Aug 02, 2020 at 01:56:33PM +0800, Mao Wenan wrote: > The loop may exist if vq->broken is true, > virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split > will return NULL, so virtnet_poll will reschedule napi to > receive packet, it will lead cpu usage(si) to 100%. > > call trace as below: > virtnet_poll > virtnet_receive > virtqueue_get_buf_ctx > virtqueue_get_buf_ctx_packed > virtqueue_get_buf_ctx_split >...
2020 Aug 02
0
[PATCH -next v2] virtio_net: Avoid loop in virtnet_poll
Just noticed the subject is wrong: this is no longer a virtio_net patch. On Sun, Aug 02, 2020 at 01:56:33PM +0800, Mao Wenan wrote: > The loop may exist if vq->broken is true, > virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split > will return NULL, so virtnet_poll will reschedule napi to > receive packet, it will lead cpu usage(si) to 100%. > > call trace as below: > virtnet_poll > virtnet_receive > virtqueue_get_buf_ctx > virtqueue_get_buf_ctx_packed > virtqueue_get_buf_ctx_split >...
2020 Aug 04
0
[PATCH -next v3] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
On 2020/8/2 ??3:44, Mao Wenan wrote: > The loop may exist if vq->broken is true, > virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split > will return NULL, so virtnet_poll will reschedule napi to > receive packet, it will lead cpu usage(si) to 100%. > > call trace as below: > virtnet_poll > virtnet_receive > virtqueue_get_buf_ctx > virtqueue_get_buf_ctx_packed > virtqueue_get_buf_ctx_split >...
2020 Aug 20
0
[PATCH AUTOSEL 5.8 21/27] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 5.7 19/24] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 5.4 17/22] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 4.19 14/18] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 4.14 11/13] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 4.9 09/11] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2020 Aug 20
0
[PATCH AUTOSEL 4.4 08/10] virtio_ring: Avoid loop when vq is broken in virtqueue_poll
From: Mao Wenan <wenan.mao at linux.alibaba.com> [ Upstream commit 481a0d7422db26fb63e2d64f0652667a5c6d0f3e ] The loop may exist if vq->broken is true, virtqueue_get_buf_ctx_packed or virtqueue_get_buf_ctx_split will return NULL, so virtnet_poll will reschedule napi to receive packet, it will lead cpu usage(si) to 100%. call trace as below: virtnet_poll virtnet_receive virtqueue_get_buf_ctx virtqueue_get_buf_ctx_packed virtqueue_get_buf_ctx_split virtqueue_napi_complete virtqueue_poll...
2023 Mar 27
0
[PATCH v2] virtio_ring: don't update event idx on get_buf
...e we call virtqueue_get_buf_ctx. This will bring more interruptions. > > To summarize: > 1) event_triggered was set to true in vring_interrupt() > 2) after this nothing will happen for virtqueue_disable_cb() so > VRING_AVAIL_F_NO_INTERRUPT is not set in avail_flags_shadow > 3) virtqueue_get_buf_ctx_split() will still think the cb is enabled > then it tries to publish new event > > To fix, if event_triggered is set to true, do not update > vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap > > Tested with iperf: > iperf3 tcp stream: > vm...
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Mar 22
0
[PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...> 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 307e139cb11d..f486cccadbeb 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -795,7 +795,8 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, > /* If we expect an interrupt for the next entry, tell host > * by writing event index and flush out the write before > * the read in the next get_buf call. */ > - if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERR...
2023 May 26
1
[PATCH] virtio_ring: validate used buffer length
...length if necessary */ + if (vq->split.buflen) + vq->split.buflen[head] = buflen; + /* Put entry in available array (but don't update avail->idx until they * do sync). */ avail = vq->split.avail_idx_shadow & (vq->split.vring.num - 1); @@ -861,6 +876,11 @@ static void *virtqueue_get_buf_ctx_split(struct virtqueue *_vq, BAD_RING(vq, "id %u is not a head!\n", i); return NULL; } + if (vq->split.buflen && unlikely(*len > vq->split.buflen[i])) { + BAD_RING(vq, "used len %d is larger than max in buffer len %u\n", + *len, vq->split.buflen[i]); +...