search for: remove_vq

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

Did you mean: remove_vqs
2019 Apr 28
2
[PATCH] virtio_console: remove vq buf while unpluging port
...ivers/char/virtio_console.c index fbeb719..f6e37f4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -251,6 +251,7 @@ struct port { /* This is the very early arch-specified put chars function. */ static int (*early_put_chars)(u32, const char *, int); +static void remove_vq(struct virtqueue *vq); static struct port *find_port_by_vtermno(u32 vtermno) { @@ -1550,6 +1551,9 @@ static void unplug_port(struct port *port) } remove_port_data(port); + spin_lock_irq(&port->inbuf_lock); + remove_vq(port->in_vq); + spin_unlock_irq(&port->inbuf_lock);...
2019 Apr 28
2
[PATCH] virtio_console: remove vq buf while unpluging port
...ivers/char/virtio_console.c index fbeb719..f6e37f4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -251,6 +251,7 @@ struct port { /* This is the very early arch-specified put chars function. */ static int (*early_put_chars)(u32, const char *, int); +static void remove_vq(struct virtqueue *vq); static struct port *find_port_by_vtermno(u32 vtermno) { @@ -1550,6 +1551,9 @@ static void unplug_port(struct port *port) } remove_port_data(port); + spin_lock_irq(&port->inbuf_lock); + remove_vq(port->in_vq); + spin_unlock_irq(&port->inbuf_lock);...
2019 May 05
0
[PATCH] virtio_console: remove vq buf while unpluging port
...ivers/char/virtio_console.c index fbeb719..f6e37f4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -251,6 +251,7 @@ struct port { /* This is the very early arch-specified put chars function. */ static int (*early_put_chars)(u32, const char *, int); +static void remove_vq(struct virtqueue *vq); static struct port *find_port_by_vtermno(u32 vtermno) { @@ -1550,6 +1551,9 @@ static void unplug_port(struct port *port) } remove_port_data(port); + spin_lock_irq(&port->inbuf_lock); + remove_vq(port->in_vq); + spin_unlock_irq(&port->inbuf_lock);...
2019 May 24
0
[PATCH] virtio_console: remove vq buf while unpluging port
...beb719..f6e37f4 100644 > --- a/drivers/char/virtio_console.c > +++ b/drivers/char/virtio_console.c > @@ -251,6 +251,7 @@ struct port { > > /* This is the very early arch-specified put chars function. */ > static int (*early_put_chars)(u32, const char *, int); > +static void remove_vq(struct virtqueue *vq); > > static struct port *find_port_by_vtermno(u32 vtermno) > { > @@ -1550,6 +1551,9 @@ static void unplug_port(struct port *port) > } > > remove_port_data(port); > + spin_lock_irq(&port->inbuf_lock); > + remove_vq(port->in_vq); &g...
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->confi...
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->confi...
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 <lv...
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 <lv...
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") >&g...
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") >&g...
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 af...
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 af...
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_unus...
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_unus...
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.ke...
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.ke...