search for: get_inbuf

Displaying 20 results from an estimated 39 matches for "get_inbuf".

Did you mean: get_buf
2011 Nov 01
2
[PULL] virtio
...ow about a revert for now? > Amit Shah (8): > virtio: console: Fix indentation > virtio: console: Ignore port name update request if name already set > virtio: console: Use wait_event_freezable instead of _interruptible > virtio: console: Fix return type for get_inbuf() > virtio: console: make get_inbuf() return port->inbuf if present > virtio: console: rename variable > virtio: console: make discard_port_data() use get_inbuf() > virtio: console: add port stats for bytes received, sent and discarded > > Christian Bor...
2011 Nov 01
2
[PULL] virtio
...ow about a revert for now? > Amit Shah (8): > virtio: console: Fix indentation > virtio: console: Ignore port name update request if name already set > virtio: console: Use wait_event_freezable instead of _interruptible > virtio: console: Fix return type for get_inbuf() > virtio: console: make get_inbuf() return port->inbuf if present > virtio: console: rename variable > virtio: console: make discard_port_data() use get_inbuf() > virtio: console: add port stats for bytes received, sent and discarded > > Christian Bor...
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all, It turns out that networking really wants ordered requests, which the previous patches didn't allow. This patch changes it to a callback mechanism; kudos to Avi. The downside is that locking is more complicated, and after a few dead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all, It turns out that networking really wants ordered requests, which the previous patches didn't allow. This patch changes it to a callback mechanism; kudos to Avi. The downside is that locking is more complicated, and after a few dead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
Hi again all, It turns out that networking really wants ordered requests, which the previous patches didn't allow. This patch changes it to a callback mechanism; kudos to Avi. The downside is that locking is more complicated, and after a few dead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get
2013 Jul 19
2
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
On 07/19/2013 04:16 AM, Amit Shah wrote: > If a port gets unplugged while a user is blocked on read(), -ENODEV is > returned. However, subsequent read()s returned 0, indicating there's no > host-side connection (but not indicating the device went away). > > This also happened when a port was unplugged and the user didn't have > any blocking operation pending. If the
2013 Jul 19
2
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
On 07/19/2013 04:16 AM, Amit Shah wrote: > If a port gets unplugged while a user is blocked on read(), -ENODEV is > returned. However, subsequent read()s returned 0, indicating there's no > host-side connection (but not indicating the device went away). > > This also happened when a port was unplugged and the user didn't have > any blocking operation pending. If the
2013 Jul 19
0
[PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug
...t() clears out all the data. However, I spotted a couple of things that need fixing: 1. In the condition you describe above, port_has_data will return false, and host_connected will be false as well, and fops_read() will return 0 instead of -ENODEV once. Subsequent reads will return -ENODEV. 2. get_inbuf(), which is called by port_has_data() accesses the vqs even if the port is unplugged. The vqs are still available, and won't have data in them (since the port is unplugged), but it's best to not rely on such behaviour. For the next merge window, I'll add extra state, port_(un)plugged...
2018 Apr 20
0
[PATCH 3/6] virtio_console: free buffers after reset
...aitqueue); } @@ -1808,8 +1796,10 @@ static void in_intr(struct virtqueue *vq) unsigned long flags; port = find_port_by_vq(vq->vdev->priv, vq); - if (!port) + if (!port) { + flush_bufs(vq, false); return; + } spin_lock_irqsave(&port->inbuf_lock, flags); port->inbuf = get_inbuf(port); @@ -1984,6 +1974,15 @@ static const struct file_operations portdev_fops = { 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 = virtque...
2010 Feb 24
0
[PULL] virtio & lguest
...hah (29): virtio: Initialize vq->data entries to NULL virtio: console: We support only one device at a time virtio: console: encapsulate buffer information in a struct virtio: console: ensure add_inbuf can work for multiple ports as well virtio: console: introduce a get_inbuf helper to fetch bufs from in_vq virtio: console: don't assume a single console port. virtio: console: struct ports for multiple ports per device. virtio: console: ensure console size is updated on hvc open virtio: console: Separate out console-specific data into a separa...
2010 Feb 24
0
[PULL] virtio & lguest
...hah (29): virtio: Initialize vq->data entries to NULL virtio: console: We support only one device at a time virtio: console: encapsulate buffer information in a struct virtio: console: ensure add_inbuf can work for multiple ports as well virtio: console: introduce a get_inbuf helper to fetch bufs from in_vq virtio: console: don't assume a single console port. virtio: console: struct ports for multiple ports per device. virtio: console: ensure console size is updated on hvc open virtio: console: Separate out console-specific data into a separa...
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
...@@ -414,7 +455,7 @@ static void discard_port_data(struct port *port) port->stats.bytes_discarded += buf->len - buf->offset; if (add_inbuf(port->in_vq, buf) < 0) { err++; - free_buf(buf); + free_buf(port->in_vq, buf, PAGE_SIZE); } port->inbuf = NULL; buf = get_inbuf(port); @@ -485,7 +526,7 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + free_databuf(port->portdev->vdev, len, buf); port->outvq_full = false; } } @@ -672,6 +713,8 @@ static s...
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
...@@ -414,7 +455,7 @@ static void discard_port_data(struct port *port) port->stats.bytes_discarded += buf->len - buf->offset; if (add_inbuf(port->in_vq, buf) < 0) { err++; - free_buf(buf); + free_buf(port->in_vq, buf, PAGE_SIZE); } port->inbuf = NULL; buf = get_inbuf(port); @@ -485,7 +526,7 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + free_databuf(port->portdev->vdev, len, buf); port->outvq_full = false; } } @@ -672,6 +713,8 @@ static s...
2012 Sep 07
4
[RFCv2 1/2] virtio_console: Add support for DMA memory allocation
...@@ -414,7 +457,7 @@ static void discard_port_data(struct port *port) port->stats.bytes_discarded += buf->len - buf->offset; if (add_inbuf(port->in_vq, buf) < 0) { err++; - free_buf(buf); + free_buf(port->in_vq, buf, PAGE_SIZE); } port->inbuf = NULL; buf = get_inbuf(port); @@ -485,7 +528,7 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + free_databuf(port->portdev->vdev, len, buf); port->outvq_full = false; } } @@ -672,6 +715,7 @@ static s...
2012 Sep 07
4
[RFCv2 1/2] virtio_console: Add support for DMA memory allocation
...@@ -414,7 +457,7 @@ static void discard_port_data(struct port *port) port->stats.bytes_discarded += buf->len - buf->offset; if (add_inbuf(port->in_vq, buf) < 0) { err++; - free_buf(buf); + free_buf(port->in_vq, buf, PAGE_SIZE); } port->inbuf = NULL; buf = get_inbuf(port); @@ -485,7 +528,7 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + free_databuf(port->portdev->vdev, len, buf); port->outvq_full = false; } } @@ -672,6 +715,7 @@ static s...
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:
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
Hey Rusty, These updated patches in the series return -EFAULT on copy_xx_user errors and also move the copy_from_user into fops_write() instead of it being in send_buf. This enables send_buf to just read from kernel buffers, making it simpler. This also allows write()s to write more to the host in one go, removingthe 4k limitation. I do limit the writes to 32k at once to not put too much