search for: remove_vqs

Displaying 20 results from an estimated 46 matches for "remove_vqs".

2019 Apr 28
2
[PATCH] virtio_console: remove vq buf while unpluging port
...@@ -1945,17 +1949,22 @@ static const struct file_operations portdev_fops = { .owner = THIS_MODULE, }; +static void remove_vq(struct virtqueue *vq) +{ + struct port_buffer *buf; + + flush_bufs(vq, true); + while ((buf = virtqueue_detach_unused_buf(vq))) + free_buf(buf, true); +} + static void remove_vqs(struct ports_device *portdev) { struct virtqueue *vq; - virtio_device_for_each_vq(portdev->vdev, vq) { - struct port_buffer *buf; + virtio_device_for_each_vq(portdev->vdev, vq) + remove_vq(vq); - flush_bufs(vq, true); - while ((buf = virtqueue_detach_unused_buf(vq))) - free_buf(b...
2019 Apr 28
2
[PATCH] virtio_console: remove vq buf while unpluging port
...@@ -1945,17 +1949,22 @@ static const struct file_operations portdev_fops = { .owner = THIS_MODULE, }; +static void remove_vq(struct virtqueue *vq) +{ + struct port_buffer *buf; + + flush_bufs(vq, true); + while ((buf = virtqueue_detach_unused_buf(vq))) + free_buf(buf, true); +} + static void remove_vqs(struct ports_device *portdev) { struct virtqueue *vq; - virtio_device_for_each_vq(portdev->vdev, vq) { - struct port_buffer *buf; + virtio_device_for_each_vq(portdev->vdev, vq) + remove_vq(vq); - flush_bufs(vq, true); - while ((buf = virtqueue_detach_unused_buf(vq))) - free_buf(b...
2019 May 05
0
[PATCH] virtio_console: remove vq buf while unpluging port
...@@ -1945,17 +1949,22 @@ static const struct file_operations portdev_fops = { .owner = THIS_MODULE, }; +static void remove_vq(struct virtqueue *vq) +{ + struct port_buffer *buf; + + flush_bufs(vq, true); + while ((buf = virtqueue_detach_unused_buf(vq))) + free_buf(buf, true); +} + static void remove_vqs(struct ports_device *portdev) { struct virtqueue *vq; - virtio_device_for_each_vq(portdev->vdev, vq) { - struct port_buffer *buf; + virtio_device_for_each_vq(portdev->vdev, vq) + remove_vq(vq); - flush_bufs(vq, true); - while ((buf = virtqueue_detach_unused_buf(vq))) - free_buf(b...
2019 May 24
0
[PATCH] virtio_console: remove vq buf while unpluging port
...ev_fops = { > .owner = THIS_MODULE, > }; > > +static void remove_vq(struct virtqueue *vq) > +{ > + struct port_buffer *buf; > + > + flush_bufs(vq, true); > + while ((buf = virtqueue_detach_unused_buf(vq))) > + free_buf(buf, true); > +} > + > static void remove_vqs(struct ports_device *portdev) > { > struct virtqueue *vq; > > - virtio_device_for_each_vq(portdev->vdev, vq) { > - struct port_buffer *buf; > + virtio_device_for_each_vq(portdev->vdev, vq) > + remove_vq(vq); > > - flush_bufs(vq, true); > - while ((buf...
2019 Mar 04
5
[PATCH] virtio_console: free unused buffers with virtio port
...t_data(port); + remove_unused_bufs(port->in_vq); spin_unlock_irq(&port->inbuf_lock); spin_lock_irq(&port->outvq_lock); reclaim_consumed_buffers(port); + remove_unused_bufs(port->out_vq); spin_unlock_irq(&port->outvq_lock); } @@ -1950,11 +1960,9 @@ static void remove_vqs(struct ports_device *portdev) struct virtqueue *vq; virtio_device_for_each_vq(portdev->vdev, vq) { - struct port_buffer *buf; flush_bufs(vq, true); - while ((buf = virtqueue_detach_unused_buf(vq))) - free_buf(buf, true); + remove_unused_bufs(vq); } portdev->vdev->config...
2019 Mar 04
5
[PATCH] virtio_console: free unused buffers with virtio port
...t_data(port); + remove_unused_bufs(port->in_vq); spin_unlock_irq(&port->inbuf_lock); spin_lock_irq(&port->outvq_lock); reclaim_consumed_buffers(port); + remove_unused_bufs(port->out_vq); spin_unlock_irq(&port->outvq_lock); } @@ -1950,11 +1960,9 @@ static void remove_vqs(struct ports_device *portdev) struct virtqueue *vq; virtio_device_for_each_vq(portdev->vdev, vq) { - struct port_buffer *buf; flush_bufs(vq, true); - while ((buf = virtqueue_detach_unused_buf(vq))) - free_buf(buf, true); + remove_unused_bufs(vq); } portdev->vdev->config...
2018 Apr 20
13
[PATCH 0/6] virtio-console: spec compliance fixes
Turns out virtio console tries to take a buffer out of an active vq. Works by sheer luck, and is explicitly forbidden by spec. And while going over it I saw that error handling is also broken - failure is easy to trigger if I force allocations to fail. Lightly tested. Michael S. Tsirkin (6): virtio_console: don't tie bufs to a vq virtio: add ability to iterate over vqs virtio_console:
2018 Apr 20
13
[PATCH 0/6] virtio-console: spec compliance fixes
Turns out virtio console tries to take a buffer out of an active vq. Works by sheer luck, and is explicitly forbidden by spec. And while going over it I saw that error handling is also broken - failure is easy to trigger if I force allocations to fail. Lightly tested. Michael S. Tsirkin (6): virtio_console: don't tie bufs to a vq virtio: add ability to iterate over vqs virtio_console:
2019 Oct 18
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...cause buffers for the in_vq are allocated when the port is added but are not released when the port is unplugged. They are only released when virtconsole is removed (see a7a69ec0d8e4) To avoid the problem and to be symmetric, we could allocate all the buffers in init_vqs() as they are released in remove_vqs(), but it sounds like a waste of memory. Rather than that, this patch changes add_port() logic to only allocate the buffers if the in_vq has available free slots. Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: mst at redhat.com Signed-off-by: Laurent Vivier <lvi...
2019 Oct 18
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...cause buffers for the in_vq are allocated when the port is added but are not released when the port is unplugged. They are only released when virtconsole is removed (see a7a69ec0d8e4) To avoid the problem and to be symmetric, we could allocate all the buffers in init_vqs() as they are released in remove_vqs(), but it sounds like a waste of memory. Rather than that, this patch changes add_port() logic to only allocate the buffers if the in_vq has available free slots. Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: mst at redhat.com Signed-off-by: Laurent Vivier <lvi...
2019 Nov 06
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...ort is >> added but are not released when the port is unplugged. >> >> They are only released when virtconsole is removed (see a7a69ec0d8e4) >> >> To avoid the problem and to be symmetric, we could allocate all the buffers >> in init_vqs() as they are released in remove_vqs(), but it sounds like >> a waste of memory. >> >> Rather than that, this patch changes add_port() logic to only allocate the >> buffers if the in_vq has available free slots. >> >> Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") >&gt...
2019 Nov 06
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...ort is >> added but are not released when the port is unplugged. >> >> They are only released when virtconsole is removed (see a7a69ec0d8e4) >> >> To avoid the problem and to be symmetric, we could allocate all the buffers >> in init_vqs() as they are released in remove_vqs(), but it sounds like >> a waste of memory. >> >> Rather than that, this patch changes add_port() logic to only allocate the >> buffers if the in_vq has available free slots. >> >> Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") >&gt...
2019 Mar 05
2
[PATCH] virtio_console: free unused buffers with virtio port
...> > spin_lock_irq(&port->outvq_lock); > > reclaim_consumed_buffers(port); > > + remove_unused_bufs(port->out_vq); > > spin_unlock_irq(&port->outvq_lock); > > } > > > > @@ -1950,11 +1960,9 @@ static void remove_vqs(struct ports_device *portdev) > > struct virtqueue *vq; > > > > virtio_device_for_each_vq(portdev->vdev, vq) { > > - struct port_buffer *buf; > > > > flush_bufs(vq, true); > > - while (...
2019 Mar 05
2
[PATCH] virtio_console: free unused buffers with virtio port
...> > spin_lock_irq(&port->outvq_lock); > > reclaim_consumed_buffers(port); > > + remove_unused_bufs(port->out_vq); > > spin_unlock_irq(&port->outvq_lock); > > } > > > > @@ -1950,11 +1960,9 @@ static void remove_vqs(struct ports_device *portdev) > > struct virtqueue *vq; > > > > virtio_device_for_each_vq(portdev->vdev, vq) { > > - struct port_buffer *buf; > > > > flush_bufs(vq, true); > > - while (...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...gt; > added but are not released when the port is unplugged. > > > > They are only released when virtconsole is removed (see a7a69ec0d8e4) > > > > To avoid the problem and to be symmetric, we could allocate all the buffers > > in init_vqs() as they are released in remove_vqs(), but it sounds like > > a waste of memory. > > > > Rather than that, this patch changes add_port() logic to ignore ENOSPC > > error in fill_queue(), which means queue has already been filled. > > > > Fixes: a7a69ec0d8e4 ("virtio_console: free buffers aft...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...gt; > added but are not released when the port is unplugged. > > > > They are only released when virtconsole is removed (see a7a69ec0d8e4) > > > > To avoid the problem and to be symmetric, we could allocate all the buffers > > in init_vqs() as they are released in remove_vqs(), but it sounds like > > a waste of memory. > > > > Rather than that, this patch changes add_port() logic to ignore ENOSPC > > error in fill_queue(), which means queue has already been filled. > > > > Fixes: a7a69ec0d8e4 ("virtio_console: free buffers aft...
2019 Aug 10
2
[PATCH v3 1/2] virtio_console: free unused buffers with port delete
...n_vq); > spin_unlock_irq(&port->inbuf_lock); > > spin_lock_irq(&port->outvq_lock); > reclaim_consumed_buffers(port); > + remove_unused_bufs(port->out_vq); > spin_unlock_irq(&port->outvq_lock); > } > > @@ -1938,11 +1948,9 @@ static void remove_vqs(struct ports_device *portdev) > struct virtqueue *vq; > > virtio_device_for_each_vq(portdev->vdev, vq) { > - struct port_buffer *buf; > > flush_bufs(vq, true); > - while ((buf = virtqueue_detach_unused_buf(vq))) > - free_buf(buf, true); > + remove_unuse...
2019 Aug 10
2
[PATCH v3 1/2] virtio_console: free unused buffers with port delete
...n_vq); > spin_unlock_irq(&port->inbuf_lock); > > spin_lock_irq(&port->outvq_lock); > reclaim_consumed_buffers(port); > + remove_unused_bufs(port->out_vq); > spin_unlock_irq(&port->outvq_lock); > } > > @@ -1938,11 +1948,9 @@ static void remove_vqs(struct ports_device *portdev) > struct virtqueue *vq; > > virtio_device_for_each_vq(portdev->vdev, vq) { > - struct port_buffer *buf; > > flush_bufs(vq, true); > - while ((buf = virtqueue_detach_unused_buf(vq))) > - free_buf(buf, true); > + remove_unuse...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...cause buffers for the in_vq are allocated when the port is added but are not released when the port is unplugged. They are only released when virtconsole is removed (see a7a69ec0d8e4) To avoid the problem and to be symmetric, we could allocate all the buffers in init_vqs() as they are released in remove_vqs(), but it sounds like a waste of memory. Rather than that, this patch changes add_port() logic to ignore ENOSPC error in fill_queue(), which means queue has already been filled. Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: mst at redhat.com Cc: stable at vger.ker...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...cause buffers for the in_vq are allocated when the port is added but are not released when the port is unplugged. They are only released when virtconsole is removed (see a7a69ec0d8e4) To avoid the problem and to be symmetric, we could allocate all the buffers in init_vqs() as they are released in remove_vqs(), but it sounds like a waste of memory. Rather than that, this patch changes add_port() logic to ignore ENOSPC error in fill_queue(), which means queue has already been filled. Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: mst at redhat.com Cc: stable at vger.ker...