search for: pop_split_desc

Displaying 20 results from an estimated 32 matches for "pop_split_desc".

2020 Jun 04
1
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...sc and vhost_buf can work for split and packed. > > Do you mean we should add packed ring support based on this? > For sure, this is one of the motivators for the patchset. > Somehow. But the reason I ask is that I see "split" suffix is used in patch 1 as: peek_split_desc() pop_split_desc() push_split_desc() But that suffix is not used for the new used ring API invented in this patch. Thanks
2019 Oct 13
4
[PATCH RFC v3 0/4] 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. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...t_vq_desc(struct vhost_virtqueue *vq, > } > EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + return &vq->descs[vq->ndescs - 1]; > +} > + > +static void pop_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + --vq->ndescs; > +} > + > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > + VRING_DESC_F_NEXT) > +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc...
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...t_vq_desc(struct vhost_virtqueue *vq, > } > EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + return &vq->descs[vq->ndescs - 1]; > +} > + > +static void pop_split_desc(struct vhost_virtqueue *vq) > +{ > + BUG_ON(!vq->ndescs); > + --vq->ndescs; > +} > + > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > + VRING_DESC_F_NEXT) > +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc...
2019 Oct 12
2
[PATCH RFC v1 2/2] vhost: batching fetches
...{ > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + vq->batch_descs = dev->iov_limit - UIO_MAXIOV; > vq->descs = kmalloc_array(vq->max_descs, > sizeof(*vq->descs), > GFP_KERNEL); > @@ -2366,6 +2368,8 @@ static void pop_split_desc(struct vhost_virtqueue *vq) > --vq->ndescs; > } > > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > + VRING_DESC_F_NEXT) > static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) > { > struct v...
2019 Oct 12
2
[PATCH RFC v1 2/2] vhost: batching fetches
...{ > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + vq->batch_descs = dev->iov_limit - UIO_MAXIOV; > vq->descs = kmalloc_array(vq->max_descs, > sizeof(*vq->descs), > GFP_KERNEL); > @@ -2366,6 +2368,8 @@ static void pop_split_desc(struct vhost_virtqueue *vq) > --vq->ndescs; > } > > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > + VRING_DESC_F_NEXT) > static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) > { > struct v...
2019 Oct 12
2
[PATCH RFC v2 0/2] 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. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while
2020 Jun 03
1
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...save descriptor: idx %d\n", i); >>> + return -EINVAL; >>> + } >>> + } while ((i = next_desc(vq, &desc)) != -1); >>> + >>> + last = peek_split_desc(vq); >>> + if (unlikely(last->flags & VRING_DESC_F_INDIRECT)) { >>> + pop_split_desc(vq); >>> + ret = fetch_indirect_descs(vq, last, head); >> >> Note that this means we don't supported chained indirect descriptors which >> complies the spec but we support this in vhost_get_vq_desc(). > Well the spec says: > A driver MUST NOT set both VIRTQ_DE...
2020 Jun 02
0
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...} return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void pop_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + --vq->ndescs; +} + +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ + VRING_DESC_F_NEXT) +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) +{ + struct vhost_desc *h; + +...
2020 Apr 07
0
[PATCH v7 17/19] vhost: option to fetch descriptors through an independent struct
...} return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void pop_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + --vq->ndescs; +} + +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ + VRING_DESC_F_NEXT) +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) +{ + struct vhost_desc *h; + +...
2020 Apr 07
0
[PATCH v8 17/19] vhost: option to fetch descriptors through an independent struct
...} return 0; @@ -2277,6 +2285,293 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void pop_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + --vq->ndescs; +} + +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ + VRING_DESC_F_NEXT) +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) +{ + struct vhost_desc *h; + +...
2020 Jun 03
0
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...> > } > > EXPORT_SYMBOL_GPL(vhost_get_vq_desc); > > +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) > > +{ > > + BUG_ON(!vq->ndescs); > > + return &vq->descs[vq->ndescs - 1]; > > +} > > + > > +static void pop_split_desc(struct vhost_virtqueue *vq) > > +{ > > + BUG_ON(!vq->ndescs); > > + --vq->ndescs; > > +} > > + > > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > > + VRING_DESC_F_NEXT) > > +static int push_split_desc(struct vhos...
2019 Oct 11
0
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...} return 0; @@ -2346,6 +2354,295 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq, } EXPORT_SYMBOL_GPL(vhost_get_vq_desc); +static struct vhost_desc *peek_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + return &vq->descs[vq->ndescs - 1]; +} + +static void pop_split_desc(struct vhost_virtqueue *vq) +{ + BUG_ON(!vq->ndescs); + --vq->ndescs; +} + +static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) +{ + struct vhost_desc *h; + + if (unlikely(vq->ndescs >= vq->max_descs)) + return -EINVAL; + h = &vq->descs[vq-...
2019 Oct 11
8
[PATCH RFC v1 0/2] vhost: ring format independence
So the idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while we are fetching multiple descriptors. And perhaps more importantly,
2019 Oct 11
8
[PATCH RFC v1 0/2] vhost: ring format independence
So the idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while we are fetching multiple descriptors. And perhaps more importantly,
2019 Oct 13
6
[PATCH RFC v4 0/5] 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. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization. This will also allow all kind of batching tricks - e.g. it seems possible to keep SMAP disabled while
2020 Feb 06
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
.../vhost/vhost.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 27ae5b4872a0..56c5253056ee 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -2125,6 +2125,8 @@ static void pop_split_desc(struct vhost_virtqueue *vq) > --vq->ndescs; > } > > +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ > + VRING_DESC_F_NEXT) > static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) > { > struct vhost_d...
2019 Oct 11
0
[vhost:vhost 6/6] drivers/vhost/vhost.c:2672:9: error: 'desc' undeclared; did you mean 'rdtsc'?
...if (ret) 2589 return ret; 2590 2591 /* Note: indirect descriptors are not batched */ 2592 /* TODO: batch up to a limit */ 2593 last = peek_split_desc(vq); 2594 id = last->id; 2595 2596 if (last->flags & VRING_DESC_F_INDIRECT) { 2597 int r; 2598 2599 pop_split_desc(vq); 2600 r = fetch_indirect_descs(vq, last, id); 2601 if (unlikely(r < 0)) { 2602 if (r != -EAGAIN) 2603 vq_err(vq, "Failure detected " 2604 "in indirect descriptor at idx %d\n", id); 2605 return ret; 2606 } 2607 } 2608...
2019 Oct 11
0
[vhost:vhost 6/6] drivers/vhost/vhost.c:2672:9: error: 'desc' undeclared
...if (ret) 2589 return ret; 2590 2591 /* Note: indirect descriptors are not batched */ 2592 /* TODO: batch up to a limit */ 2593 last = peek_split_desc(vq); 2594 id = last->id; 2595 2596 if (last->flags & VRING_DESC_F_INDIRECT) { 2597 int r; 2598 2599 pop_split_desc(vq); 2600 r = fetch_indirect_descs(vq, last, id); 2601 if (unlikely(r < 0)) { 2602 if (r != -EAGAIN) 2603 vq_err(vq, "Failure detected " 2604 "in indirect descriptor at idx %d\n", id); 2605 return ret; 2606 } 2607 } 2608...
2019 Oct 11
0
[PATCH RFC v1 2/2] vhost: batching fetches
...for (i = 0; i < dev->nvqs; ++i) { vq = dev->vqs[i]; vq->max_descs = dev->iov_limit; + vq->batch_descs = dev->iov_limit - UIO_MAXIOV; vq->descs = kmalloc_array(vq->max_descs, sizeof(*vq->descs), GFP_KERNEL); @@ -2366,6 +2368,8 @@ static void pop_split_desc(struct vhost_virtqueue *vq) --vq->ndescs; } +#define VHOST_DESC_FLAGS (VRING_DESC_F_INDIRECT | VRING_DESC_F_WRITE | \ + VRING_DESC_F_NEXT) static int push_split_desc(struct vhost_virtqueue *vq, struct vring_desc *desc, u16 id) { struct vhost_desc *h; @@ -2375,7 +2379,7 @@ static int...