search for: vhost_add_used_and_signal

Displaying 20 results from an estimated 200 matches for "vhost_add_used_and_signal".

2014 Jul 01
0
[PATCH RFC 2/2] vhost: support urgent descriptors
...); void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); int vhost_init_used(struct vhost_virtqueue *); -int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); -int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads, - unsigned count); -void vhost_add_used_and_signal(struct vhost_dev *, struct vhost_virtqueue *, +int vhost_add_used(struct vhost_virtqueue *, bool urgent, + unsigned int head, int len); +int vhost_add_used_n(struct vhost_virtqueue *, bool urgent, + struct vring_used_elem *heads, unsigned count); +void vhost_add_used_and_signal(struct vho...
2014 Jul 01
5
[PATCH RFC 1/2] virtio: support for urgent descriptors
Below should be useful for some experiments Jason is doing. I thought I'd send it out for early review/feedback. Compiled-only at this point. event idx feature allows us to defer interrupts until a specific # of descriptors were used. Sometimes it might be useful to get an interrupt after a specific descriptor, regardless. This adds a descriptor flag for this, and an API to create an urgent
2014 Jul 01
5
[PATCH RFC 1/2] virtio: support for urgent descriptors
Below should be useful for some experiments Jason is doing. I thought I'd send it out for early review/feedback. Compiled-only at this point. event idx feature allows us to defer interrupts until a specific # of descriptors were used. Sometimes it might be useful to get an interrupt after a specific descriptor, regardless. This adds a descriptor flag for this, and an API to create an urgent
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...discard(vq, 1); tx_poll_start(net, sock); break; } if (err != len) pr_err("Truncated TX packet: " " len %d != %zd\n", err, len); - vhost_add_used_and_signal(&net->dev, vq, head, 0); + vhost_add_used_and_signal(&net->dev, vq, &head, 1); total_len += len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { vhost_poll_queue(&vq->poll); @@ -182,12 +181,22 @@...
2010 Mar 03
1
[RFC][ PATCH 1/3] vhost-net: support multiple buffer heads in receiver
...discard(vq, 1); tx_poll_start(net, sock); break; } if (err != len) pr_err("Truncated TX packet: " " len %d != %zd\n", err, len); - vhost_add_used_and_signal(&net->dev, vq, head, 0); + vhost_add_used_and_signal(&net->dev, vq, &head, 1); total_len += len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { vhost_poll_queue(&vq->poll); @@ -182,12 +181,22 @@...
2013 Aug 16
2
[PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 16, 2013 at 01:16:26PM +0800, Jason Wang wrote: > Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). With the patch we will call at most 2 times > (consider done_idx warp around) compared to N times w/o this patch. > > Signed-off-by: Jason Wang <jasowang at redhat.com> So? Does this help performance then? > --- &...
2013 Aug 16
2
[PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 16, 2013 at 01:16:26PM +0800, Jason Wang wrote: > Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). With the patch we will call at most 2 times > (consider done_idx warp around) compared to N times w/o this patch. > > Signed-off-by: Jason Wang <jasowang at redhat.com> So? Does this help performance then? > --- &...
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...gt; return true; > } > + vq->urgent = false; > return !(flags & VRING_AVAIL_F_NO_INTERRUPT); > } > old = vq->signalled_used; > @@ -1468,9 +1475,10 @@ EXPORT_SYMBOL_GPL(vhost_signal); > /* And here's the combo meal deal. Supersize me! */ > void vhost_add_used_and_signal(struct vhost_dev *dev, > struct vhost_virtqueue *vq, > + bool urgent, > unsigned int head, int len) > { > - vhost_add_used(vq, head, len); > + vhost_add_used(vq, urgent, head, len); > vhost_signal(dev, vq); > } > EXPORT_SYMBOL_GPL(vhost...
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...gt; return true; > } > + vq->urgent = false; > return !(flags & VRING_AVAIL_F_NO_INTERRUPT); > } > old = vq->signalled_used; > @@ -1468,9 +1475,10 @@ EXPORT_SYMBOL_GPL(vhost_signal); > /* And here's the combo meal deal. Supersize me! */ > void vhost_add_used_and_signal(struct vhost_dev *dev, > struct vhost_virtqueue *vq, > + bool urgent, > unsigned int head, int len) > { > - vhost_add_used(vq, head, len); > + vhost_add_used(vq, urgent, head, len); > vhost_signal(dev, vq); > } > EXPORT_SYMBOL_GPL(vhost...
2020 Jun 07
0
[PATCH RFC v5 13/13] vhost: drop head based APIs
...int vhost_put_used_n_bufs(struct vhost_virtqueue *vq, struct vhost_buf *bufs, unsigned count) { @@ -2580,26 +2580,6 @@ void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) } EXPORT_SYMBOL_GPL(vhost_signal); -/* And here's the combo meal deal. Supersize me! */ -void vhost_add_used_and_signal(struct vhost_dev *dev, - struct vhost_virtqueue *vq, - unsigned int head, int len) -{ - vhost_add_used(vq, head, len); - vhost_signal(dev, vq); -} -EXPORT_SYMBOL_GPL(vhost_add_used_and_signal); - -/* multi-buffer version of vhost_add_used_and_signal */ -void vhost_add_used_and_sig...
2017 Sep 28
1
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...!= %zd\n", err, len); > + if (!zcopy) { > + vhost_add_used_idx(vq, 1); > + vhost_signal(&net->dev, vq); > + } else if (!zcopy_used) { > + vhost_add_used_and_signal(&net->dev, > + vq, head, 0); While batching, perhaps can also move this producer index update out of the loop and using vhost_add_used_and_signal_n. > + } else > + vhost_zer...
2017 Sep 28
1
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...!= %zd\n", err, len); > + if (!zcopy) { > + vhost_add_used_idx(vq, 1); > + vhost_signal(&net->dev, vq); > + } else if (!zcopy_used) { > + vhost_add_used_and_signal(&net->dev, > + vq, head, 0); While batching, perhaps can also move this producer index update out of the loop and using vhost_add_used_and_signal_n. > + } else > + vhost_zer...
2013 Sep 02
1
[PATCH V2 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 30, 2013 at 12:29:18PM +0800, Jason Wang wrote: > We tend to batch the used adding and signaling in vhost_zerocopy_callback() > which may result more than 100 used buffers to be updated in > vhost_zerocopy_signal_used() in some cases. So wwitch to use switch > vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). Which means much more less times of used index > updating and memory barriers. pls put info on perf gain in commit log too > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/net.c |...
2013 Sep 02
1
[PATCH V2 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 30, 2013 at 12:29:18PM +0800, Jason Wang wrote: > We tend to batch the used adding and signaling in vhost_zerocopy_callback() > which may result more than 100 used buffers to be updated in > vhost_zerocopy_signal_used() in some cases. So wwitch to use switch > vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). Which means much more less times of used index > updating and memory barriers. pls put info on perf gain in commit log too > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/net.c |...
2020 Jun 02
0
[PATCH RFC 11/13] vhost/scsi: switch to buf APIs
...if (vhost_enable_notify(&vs->dev, vq)) goto again; vs->vs_events_missed = true; @@ -488,7 +503,7 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) eventp = vq->iov[out].iov_base; ret = __copy_to_user(eventp, event, sizeof(*event)); if (!ret) - vhost_add_used_and_signal(&vs->dev, vq, head, 0); + vhost_scsi_signal_noinput(&vs->dev, vq, &buf); else vq_err(vq, "Faulted on vhost_scsi_send_event\n"); } @@ -549,7 +564,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) ret = copy_to_iter(&v_rsp, sizeof(v_rsp),...
2020 Jun 07
0
[PATCH RFC v5 11/13] vhost/scsi: switch to buf APIs
...if (vhost_enable_notify(&vs->dev, vq)) goto again; vs->vs_events_missed = true; @@ -488,7 +503,7 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) eventp = vq->iov[out].iov_base; ret = __copy_to_user(eventp, event, sizeof(*event)); if (!ret) - vhost_add_used_and_signal(&vs->dev, vq, head, 0); + vhost_scsi_signal_noinput(&vs->dev, vq, &buf); else vq_err(vq, "Faulted on vhost_scsi_send_event\n"); } @@ -549,7 +564,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) ret = copy_to_iter(&v_rsp, sizeof(v_rsp),...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > > if (vq->call_ctx && vhost_notify(dev, vq)) > > > eventfd_signal(vq->call_ctx, 1); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_signal); > > > > > > /* And here's the combo meal deal. Supersize me! */ > > > void vhost_add_used_and_signal(struct vhost_dev *dev, > > > @@ -1465,6 +1492,7 @@ void vhost_add_used_and_signal(struct vhost_dev *dev, > > > vhost_add_used(vq, head, len); > > > vhost_signal(dev, vq); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_add_used_and_signal); > > >...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > > if (vq->call_ctx && vhost_notify(dev, vq)) > > > eventfd_signal(vq->call_ctx, 1); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_signal); > > > > > > /* And here's the combo meal deal. Supersize me! */ > > > void vhost_add_used_and_signal(struct vhost_dev *dev, > > > @@ -1465,6 +1492,7 @@ void vhost_add_used_and_signal(struct vhost_dev *dev, > > > vhost_add_used(vq, head, len); > > > vhost_signal(dev, vq); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_add_used_and_signal); > > >...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
...if (unlikely(err < 0)) { - vhost_discard_vq_desc(vq); - tx_poll_start(net, sock); + if (err == -EAGAIN) { + vhost_discard_desc(vq, 1); + tx_poll_start(net, sock); + } else { + vq_err(vq, "sendmsg: errno %d\n", -err); + /* drop packet; do not discard/resend */ + vhost_add_used_and_signal(&net->dev, vq, head, + 0); + } break; } if (err != len) @@ -186,12 +192,25 @@ static void handle_tx(struct vhost_net * unuse_mm(net->dev.mm); } +static int vhost_head_len(struct sock *sk) +{ + struct sk_buff *head; + int len = 0; + + lock_sock(sk); + head = skb_pe...
2010 Apr 06
1
[PATCH v3] Add Mergeable receive buffer support to vhost_net
...if (unlikely(err < 0)) { - vhost_discard_vq_desc(vq); - tx_poll_start(net, sock); + if (err == -EAGAIN) { + vhost_discard_desc(vq, 1); + tx_poll_start(net, sock); + } else { + vq_err(vq, "sendmsg: errno %d\n", -err); + /* drop packet; do not discard/resend */ + vhost_add_used_and_signal(&net->dev, vq, head, + 0); + } break; } if (err != len) @@ -186,12 +192,25 @@ static void handle_tx(struct vhost_net * unuse_mm(net->dev.mm); } +static int vhost_head_len(struct sock *sk) +{ + struct sk_buff *head; + int len = 0; + + lock_sock(sk); + head = skb_pe...