search for: unfetch_descs

Displaying 13 results from an estimated 13 matches for "unfetch_descs".

Did you mean: fetch_descs
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 decreased last_avail_idx. >> Can we fix this by letting unfetch_descs() return the number and then we can >> do: >> >> int d = unfetch_descs(vq); >> vq->last_avail_idx -= (n > d) ?...
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 decreased last_avail_idx. >> Can we fix this by letting unfetch_descs() return the number and then we can >> do: >> >> int d = unfetch_descs(vq); >> vq->last_avail_idx -= (n > d) ?...
2020 Jun 11
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...rkin 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 decreased last_avail_idx. > > > Can we fix this by letting unfetch_descs() return the number and then we can > > > do: > > > > > > int d = unfetch_descs(vq); > >...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...p; vq->ndescs <= vhost_vq_num_batch_descs(vq); > + ret = fetch_buf(vq)) > + ; > + > + /* On success we expect some descs */ > + BUG_ON(ret > 0 && !vq->ndescs); > + return ret; > +} > + > +/* Reverse the effects of fetch_descs */ > +static void unfetch_descs(struct vhost_virtqueue *vq) > +{ > + int i; > + > + for (i = vq->first_desc; i < vq->ndescs; ++i) > + if (!(vq->descs[i].flags & VRING_DESC_F_NEXT)) > + vq->last_avail_idx -= 1; > + vq->ndescs = 0; > +} Is it better to set first_desc to zero here?...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...p; vq->ndescs <= vhost_vq_num_batch_descs(vq); > + ret = fetch_buf(vq)) > + ; > + > + /* On success we expect some descs */ > + BUG_ON(ret > 0 && !vq->ndescs); > + return ret; > +} > + > +/* Reverse the effects of fetch_descs */ > +static void unfetch_descs(struct vhost_virtqueue *vq) > +{ > + int i; > + > + for (i = vq->first_desc; i < vq->ndescs; ++i) > + if (!(vq->descs[i].flags & VRING_DESC_F_NEXT)) > + vq->last_avail_idx -= 1; > + vq->ndescs = 0; > +} Is it better to set first_desc to zero here?...
2020 Jun 10
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...); > > + ret = fetch_buf(vq)) > > + ; > > + > > + /* On success we expect some descs */ > > + BUG_ON(ret > 0 && !vq->ndescs); > > + return ret; > > +} > > + > > +/* Reverse the effects of fetch_descs */ > > +static void unfetch_descs(struct vhost_virtqueue *vq) > > +{ > > + int i; > > + > > + for (i = vq->first_desc; i < vq->ndescs; ++i) > > + if (!(vq->descs[i].flags & VRING_DESC_F_NEXT)) > > + vq->last_avail_idx -= 1; > > + vq->ndescs = 0; > > +} > &...
2020 Jun 11
0
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
...rn 1; + + for (ret = 1; + ret > 0 && vq->ndescs <= vhost_vq_num_batch_descs(vq); + ret = fetch_buf(vq)) + ; + + /* On success we expect some descs */ + BUG_ON(ret > 0 && !vq->ndescs); + return ret; +} + +/* Reverse the effects of fetch_descs */ +static void unfetch_descs(struct vhost_virtqueue *vq) +{ + int i; + + for (i = vq->first_desc; i < vq->ndescs; ++i) + if (!(vq->descs[i].flags & VRING_DESC_F_NEXT)) + vq->last_avail_idx -= 1; + vq->ndescs = 0; +} + /* This looks in the virtqueue and for the first available buffer, and converts *...
2020 Jun 08
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...rn 1; + + for (ret = 1; + ret > 0 && vq->ndescs <= vhost_vq_num_batch_descs(vq); + ret = fetch_buf(vq)) + ; + + /* On success we expect some descs */ + BUG_ON(ret > 0 && !vq->ndescs); + return ret; +} + +/* Reverse the effects of fetch_descs */ +static void unfetch_descs(struct vhost_virtqueue *vq) +{ + int i; + + for (i = vq->first_desc; i < vq->ndescs; ++i) + if (!(vq->descs[i].flags & VRING_DESC_F_NEXT)) + vq->last_avail_idx -= 1; + vq->ndescs = 0; +} + /* This looks in the virtqueue and for the first available buffer, and converts *...
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 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 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