search for: vhost_vq_free_iovecs

Displaying 20 results from an estimated 75 matches for "vhost_vq_free_iovecs".

2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > kfree(vq->descs); > @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + if (vhost_vq_num_...
2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > kfree(vq->descs); > @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > for (i = 0; i < dev->nvqs; ++i) { > vq = dev->vqs[i]; > vq->max_descs = dev->iov_limit; > + if (vhost_vq_num_...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...ged, 28 insertions(+), 18 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 2025543..1015464 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -413,6 +413,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) > vhost_vq_free_iovecs(dev->vqs[i]); > } > > +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) Nit: Any reason not to make `num` unsigned or size_t? > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > + > + return sizeof(*vq->avail) + >...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...ged, 28 insertions(+), 18 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 2025543..1015464 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -413,6 +413,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) > vhost_vq_free_iovecs(dev->vqs[i]); > } > > +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) Nit: Any reason not to make `num` unsigned or size_t? > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > + > + return sizeof(*vq->avail) + >...
2019 Oct 12
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...set(struct vhost_dev *dev, > struct vhost_virtqueue *vq) > { > vq->num = 1; > + vq->ndescs = 0; > vq->desc = NULL; > vq->avail = NULL; > vq->used = NULL; > @@ -369,6 +370,9 @@ static int vhost_worker(void *data) > > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > + kfree(vq->descs); > + vq->descs = NULL; > + vq->max_descs = 0; > kfree(vq->indirect); > vq->indirect = NULL; > kfree(vq->log); > @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) &g...
2019 Oct 12
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...set(struct vhost_dev *dev, > struct vhost_virtqueue *vq) > { > vq->num = 1; > + vq->ndescs = 0; > vq->desc = NULL; > vq->avail = NULL; > vq->used = NULL; > @@ -369,6 +370,9 @@ static int vhost_worker(void *data) > > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > + kfree(vq->descs); > + vq->descs = NULL; > + vq->max_descs = 0; > kfree(vq->indirect); > vq->indirect = NULL; > kfree(vq->log); > @@ -385,6 +389,10 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) &g...
2019 Oct 14
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...*vq) >>> { >>> vq->num = 1; >>> + vq->ndescs = 0; >>> vq->desc = NULL; >>> vq->avail = NULL; >>> vq->used = NULL; >>> @@ -369,6 +370,9 @@ static int vhost_worker(void *data) >>> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) >>> { >>> + kfree(vq->descs); >>> + vq->descs = NULL; >>> + vq->max_descs = 0; >>> kfree(vq->indirect); >>> vq->indirect = NULL; >>> kfree(vq->log); >>> @@ -385,6 +38...
2019 Oct 14
2
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...*vq) >>> { >>> vq->num = 1; >>> + vq->ndescs = 0; >>> vq->desc = NULL; >>> vq->avail = NULL; >>> vq->used = NULL; >>> @@ -369,6 +370,9 @@ static int vhost_worker(void *data) >>> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) >>> { >>> + kfree(vq->descs); >>> + vq->descs = NULL; >>> + vq->max_descs = 0; >>> kfree(vq->indirect); >>> vq->indirect = NULL; >>> kfree(vq->log); >>> @@ -385,6 +38...
2011 Jul 18
1
[PATCHv11] vhost: vhost TX zero-copy support
...set(struct vhost_dev *dev, vq->call_ctx = NULL; vq->call = NULL; vq->log_ctx = NULL; + vq->upend_idx = 0; + vq->done_idx = 0; + vq->ubufs = NULL; } static int vhost_worker(void *data) @@ -225,10 +230,28 @@ static int vhost_worker(void *data) return 0; } +static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) +{ + kfree(vq->indirect); + vq->indirect = NULL; + kfree(vq->log); + vq->log = NULL; + kfree(vq->heads); + vq->heads = NULL; + kfree(vq->ubuf_info); + vq->ubuf_info = NULL; +} + +void vhost_enable_zcopy(int vq) +{ + vhost_zcopy_mask |= 0x1 <&lt...
2011 Jul 18
1
[PATCHv11] vhost: vhost TX zero-copy support
...set(struct vhost_dev *dev, vq->call_ctx = NULL; vq->call = NULL; vq->log_ctx = NULL; + vq->upend_idx = 0; + vq->done_idx = 0; + vq->ubufs = NULL; } static int vhost_worker(void *data) @@ -225,10 +230,28 @@ static int vhost_worker(void *data) return 0; } +static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) +{ + kfree(vq->indirect); + vq->indirect = NULL; + kfree(vq->log); + vq->log = NULL; + kfree(vq->heads); + vq->heads = NULL; + kfree(vq->ubuf_info); + vq->ubuf_info = NULL; +} + +void vhost_enable_zcopy(int vq) +{ + vhost_zcopy_mask |= 0x1 <&lt...
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2013 Apr 27
2
[PATCH v6 0/2] tcm_vhost flush
Changes in v6: - Allow device specific fields per vq - Track cmd per vq - Do not track evt - Switch to static array for inflight allocation, completely get rid of the pain to handle inflight allocation failure. Asias He (2): vhost: Allow device specific fields per vq tcm_vhost: Wait for pending requests in vhost_scsi_flush() drivers/vhost/net.c | 60 +++++++++++--------
2014 May 13
2
[PATCH v1] vhost: avoid large order allocations
A test case which generates memory pressure while performing guest administration fails with vhost triggering "page allocation failure" and guest not starting up. After some analysis we discovered the allocation order of vhost to be rensponsible for this behaviour. Thus we suggest patch 1/1 which dynamically allocates the required memory. Please see its description for details. Thanks,
2014 May 13
2
[PATCH v1] vhost: avoid large order allocations
A test case which generates memory pressure while performing guest administration fails with vhost triggering "page allocation failure" and guest not starting up. After some analysis we discovered the allocation order of vhost to be rensponsible for this behaviour. Thus we suggest patch 1/1 which dynamically allocates the required memory. Please see its description for details. Thanks,
2019 Mar 07
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...eletions(-) >> >> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c >> index 2025543..1015464 100644 >> --- a/drivers/vhost/vhost.c >> +++ b/drivers/vhost/vhost.c >> @@ -413,6 +413,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) >> vhost_vq_free_iovecs(dev->vqs[i]); >> } >> >> +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) > Nit: Any reason not to make `num` unsigned or size_t? > Let me use unsigned int to match the definition of vq->num. Thanks
2020 Jun 22
0
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: > > On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > > { > > kfree(vq->descs); > > @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > > for (i = 0; i < dev->nvqs; ++i) { > > vq = dev->vqs[i]; > > vq->max_descs = dev->iov_li...
2020 Jun 23
0
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
...at 4:51 AM Jason Wang <jasowang at redhat.com> wrote: >> >> On 2020/6/23 ??12:00, Michael S. Tsirkin wrote: >>> On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: >>>> On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: >>>>> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) >>>>> { >>>>> kfree(vq->descs); >>>>> @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) >>>>> for (i = 0; i < dev->nvqs; ++i) { >>>>>...
2020 Jun 23
0
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
...Wang <jasowang at redhat.com> wrote: > > > > > > On 2020/6/23 ??12:00, Michael S. Tsirkin wrote: > > > On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: > > >> On 2020/6/11 ??7:34, Michael S. Tsirkin wrote: > > >>> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > > >>> { > > >>> kfree(vq->descs); > > >>> @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) > > >>> for (i = 0; i < dev->nvqs; ++i) { > > >>>...
2020 Jun 23
0
[RFC v9 02/11] vhost: use batched get_vq_desc version
...vq->avail = NULL; > vq->used = NULL; > @@ -372,6 +373,11 @@ static int vhost_worker(void *data) > return 0; > } > > +static int vhost_vq_num_batch_descs(struct vhost_virtqueue *vq) > +{ > + return vq->max_descs - UIO_MAXIOV; > +} > + > static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) > { > kfree(vq->descs); Batching is enabled if max_descs > UIO_MAXIOV. So this uses batching for test. But net is unchanged, so it is still not using the batched version. Is that right? I think a better subject would be "vhost/test: use batched g...
2019 Mar 06
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...+++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 2025543..1015464 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -413,6 +413,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) vhost_vq_free_iovecs(dev->vqs[i]); } +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) +{ + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + + return sizeof(*vq->avail) + + sizeof(*vq->avail->ring) * num + event; +} + +static size_t vhost_get_used_siz...