search for: vhost_discard_avail_bufs

Displaying 19 results from an estimated 19 matches for "vhost_discard_avail_bufs".

2020 Jun 11
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/10 ??7:05, Michael S. Tsirkin wrote: >>> +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); >>> /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ >>> void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) >>> { >>> + unfetch_descs(vq); >>> vq->last_avail_idx -= n; >> So unfetch_descs() has
2020 Jun 11
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/10 ??7:05, Michael S. Tsirkin wrote: >>> +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); >>> /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ >>> void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) >>> { >>> + unfetch_descs(vq); >>> vq->last_avail_idx -= n; >> So unfetch_descs() has
2020 Jun 03
1
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...able_notify(&net->dev, > @@ -808,7 +823,7 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) > goto done; > } else if (unlikely(err != -ENOSPC)) { > vhost_tx_batch(net, nvq, sock, &msg); > - vhost_discard_vq_desc(vq, 1); > + vhost_discard_avail_bufs(vq, &buf, 1); > vhost_net_enable_vq(net, vq); > break; > } > @@ -829,7 +844,7 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) > /* TODO: Check specific error and bomb out unless ENOBUFS? */ > err = sock->ops->sendmsg(soc...
2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...@@ -2375,7 +2379,15 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > > return ret; > } > -EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > +EXPORT_SYMBOL_GPL(vhost_get_avail_buf); > + > +/* Reverse the effect of vhost_get_avail_buf. Useful for error handling. */ > +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, > + struct vhost_buf *buf, unsigned count) > +{ > + vhost_discard_vq_desc(vq, count); > +} > +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem...
2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...@@ -2375,7 +2379,15 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, > > return ret; > } > -EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > +EXPORT_SYMBOL_GPL(vhost_get_avail_buf); > + > +/* Reverse the effect of vhost_get_avail_buf. Useful for error handling. */ > +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, > + struct vhost_buf *buf, unsigned count) > +{ > + vhost_discard_vq_desc(vq, count); > +} > +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem...
2020 Jun 02
0
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...} else if (unlikely(vhost_enable_notify(&net->dev, @@ -808,7 +823,7 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) goto done; } else if (unlikely(err != -ENOSPC)) { vhost_tx_batch(net, nvq, sock, &msg); - vhost_discard_vq_desc(vq, 1); + vhost_discard_avail_bufs(vq, &buf, 1); vhost_net_enable_vq(net, vq); break; } @@ -829,7 +844,7 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) /* TODO: Check specific error and bomb out unless ENOBUFS? */ err = sock->ops->sendmsg(sock, &msg, len); if (unlikely(...
2020 Jun 02
0
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...>first_desc; i < vq->ndescs; ++i) @@ -2375,7 +2379,15 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, return ret; } -EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +EXPORT_SYMBOL_GPL(vhost_get_avail_buf); + +/* Reverse the effect of vhost_get_avail_buf. Useful for error handling. */ +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, + struct vhost_buf *buf, unsigned count) +{ + vhost_discard_vq_desc(vq, count); +} +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, @@ -2459,6 +2471,26 @@ int vhost_a...
2020 Jun 04
0
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...vhost_get_vq_desc(struct vhost_virtqueue *vq, > > return ret; > > } > > -EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +EXPORT_SYMBOL_GPL(vhost_get_avail_buf); > > + > > +/* Reverse the effect of vhost_get_avail_buf. Useful for error handling. */ > > +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, > > + struct vhost_buf *buf, unsigned count) > > +{ > > + vhost_discard_vq_desc(vq, count); > > +} > > +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > >...
2020 Jun 11
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On Thu, Jun 11, 2020 at 11:02:57AM +0800, Jason Wang wrote: > > On 2020/6/10 ??7:05, Michael S. Tsirkin wrote: > > > > +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > > > /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ > > > > void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) > > > > { > > >
2020 Jun 02
21
[PATCH RFC 00/13] vhost: format independence
We let the specifics of the ring format seep through to vhost API callers - mostly because there was only one format so it was hard to imagine what an independent API would look like. Now that there's an alternative in form of the packed ring, it's easier to see the issues, and fixing them is perhaps the cleanest way to add support for more formats. This patchset does this by indtroducing
2020 Jun 10
18
[PATCH RFC v7 00/14] vhost: ring format independence
This intentionally leaves "fixup" changes separate - hopefully that is enough to fix vhost-net crashes reported here, but it helps me keep track of what changed. I will naturally squash them later when we are done. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that
2020 Jun 10
18
[PATCH RFC v7 00/14] vhost: ring format independence
This intentionally leaves "fixup" changes separate - hopefully that is enough to fix vhost-net crashes reported here, but it helps me keep track of what changed. I will naturally squash them later when we are done. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that
2020 Jun 08
14
[PATCH RFC v6 00/11] vhost: ring format independence
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to IOV later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will
2020 Jun 07
17
[PATCH RFC v5 00/13] vhost: ring format independence
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to IOV later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will
2020 Jun 07
0
[PATCH RFC v5 13/13] vhost: drop head based APIs
...t vhost_virtqueue *, int n); int vhost_get_avail_buf(struct vhost_virtqueue *, struct vhost_buf *buf, struct iovec iov[], unsigned int iov_count, unsigned int *out_num, unsigned int *in_num, @@ -209,13 +204,6 @@ int vhost_get_avail_buf(struct vhost_virtqueue *, struct vhost_buf *buf, void vhost_discard_avail_bufs(struct vhost_virtqueue *, struct vhost_buf *, unsigned count); int vhost_vq_init_access(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 co...
2020 Jun 11
27
[PATCH RFC v8 00/11] vhost: ring format independence
This still causes corruption issues for people so don't try to use in production please. Posting to expedite debugging. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to
2020 Jun 11
27
[PATCH RFC v8 00/11] vhost: ring format independence
This still causes corruption issues for people so don't try to use in production please. Posting to expedite debugging. This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. Used ring is similar: we fetch into an independent struct first, convert that to
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/8 ??8:52, Michael S. Tsirkin wrote: > As testing shows no performance change, switch to that now. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > Signed-off-by: Eugenio P?rez <eperezma at redhat.com> > Link: https://lore.kernel.org/r/20200401183118.8334-3-eperezma at redhat.com > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> >
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
On 2020/6/8 ??8:52, Michael S. Tsirkin wrote: > As testing shows no performance change, switch to that now. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > Signed-off-by: Eugenio P?rez <eperezma at redhat.com> > Link: https://lore.kernel.org/r/20200401183118.8334-3-eperezma at redhat.com > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> >