search for: out_vq

Displaying 20 results from an estimated 281 matches for "out_vq".

Did you mean: out_vt
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -162,9 +162,6 @@ struct port { */ spinlock_t inbuf_lock; - /* Buffer that's used to pass data from the guest to the host */ - struct port_buffer *outbuf; - /* The IO vqs for this port */ struct virtqueue *in_vq, *out_vq; @@ -399,43 +396,23 @@ static ssize_t send_control_msg(struct port *port, unsigned int event, return 0; } -static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, - bool from_user) +static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) { struc...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -162,9 +162,6 @@ struct port { */ spinlock_t inbuf_lock; - /* Buffer that's used to pass data from the guest to the host */ - struct port_buffer *outbuf; - /* The IO vqs for this port */ struct virtqueue *in_vq, *out_vq; @@ -399,43 +396,23 @@ static ssize_t send_control_msg(struct port *port, unsigned int event, return 0; } -static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, - bool from_user) +static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) { struc...
2012 Apr 18
3
[RFC PATCH] virtio_console: link vq to port with a private pointer in struct virtqueue
...tatic struct port *find_port_by_vq(struct ports_device *portdev, struct virtqueue *vq) { - struct port *port; - unsigned long flags; - - spin_lock_irqsave(&portdev->ports_lock, flags); - list_for_each_entry(port, &portdev->ports, list) - if (port->in_vq == vq || port->out_vq == vq) - goto out; - port = NULL; -out: - spin_unlock_irqrestore(&portdev->ports_lock, flags); - return port; + return vq->vdev_priv; } static bool is_console_port(struct port *port) @@ -1159,6 +1149,8 @@ static int add_port(struct ports_device *portdev, u32 id) port->in_vq =...
2012 Apr 18
3
[RFC PATCH] virtio_console: link vq to port with a private pointer in struct virtqueue
...tatic struct port *find_port_by_vq(struct ports_device *portdev, struct virtqueue *vq) { - struct port *port; - unsigned long flags; - - spin_lock_irqsave(&portdev->ports_lock, flags); - list_for_each_entry(port, &portdev->ports, list) - if (port->in_vq == vq || port->out_vq == vq) - goto out; - port = NULL; -out: - spin_unlock_irqrestore(&portdev->ports_lock, flags); - return port; + return vq->vdev_priv; } static bool is_console_port(struct port *port) @@ -1159,6 +1149,8 @@ static int add_port(struct ports_device *portdev, u32 id) port->in_vq =...
2010 Mar 30
1
[PATCH 3/4] virtio: console makes incorrect assumption about virtio API
...ar/virtio_console.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -415,20 +415,16 @@ static ssize_t send_buf(struct port *por out_vq->vq_ops->kick(out_vq); if (ret < 0) { - len = 0; + in_count = 0; goto fail; } - /* - * Wait till the host acknowledges it pushed out the data we - * sent. Also ensure we return to userspace the number of - * bytes that were successfully consumed by the host. - */ + /* Wait...
2010 Mar 30
1
[PATCH 3/4] virtio: console makes incorrect assumption about virtio API
...ar/virtio_console.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -415,20 +415,16 @@ static ssize_t send_buf(struct port *por out_vq->vq_ops->kick(out_vq); if (ret < 0) { - len = 0; + in_count = 0; goto fail; } - /* - * Wait till the host acknowledges it pushed out the data we - * sent. Also ensure we return to userspace the number of - * bytes that were successfully consumed by the host. - */ + /* Wait...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...+ io_names[vq_num + 1] = "serial-output"; > + err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs, > + io_callbacks, > + (const char **)io_names); > + if (err) > + goto free; > + portdev->in_vqs[id] = vqs[vq_num]; > + portdev->out_vqs[id] = vqs[vq_num + 1]; I don't think this approach will work fine for port hot-plug / hot-unplug cases at all. For example, I first start qemu with one port, at id 1. Then I add a port at id 5, then at 2, then at 10. Will that be fine? > + > +free: > + kfree(io_names); > + kfre...
2012 Feb 01
1
[PATCH 2/2] virtio-serial: setup_port_vq when adding port
...+ io_names[vq_num + 1] = "serial-output"; > + err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs, > + io_callbacks, > + (const char **)io_names); > + if (err) > + goto free; > + portdev->in_vqs[id] = vqs[vq_num]; > + portdev->out_vqs[id] = vqs[vq_num + 1]; I don't think this approach will work fine for port hot-plug / hot-unplug cases at all. For example, I first start qemu with one port, at id 1. Then I add a port at id 5, then at 2, then at 10. Will that be fine? > + > +free: > + kfree(io_names); > + kfre...
2012 Nov 08
1
[[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
..._port_data(struct port *port) /* Remove buffers we queued up for the Host to send us data in. */ while ((buf = virtqueue_detach_unused_buf(port->in_vq))) free_buf(buf, true); + + /* Remove buffers we queued up for the Host to consume */ + while ((buf = virtqueue_detach_unused_buf(port->out_vq))) + free_buf(buf, true); } /* -- 1.7.7.6
2012 Nov 08
1
[[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal
..._port_data(struct port *port) /* Remove buffers we queued up for the Host to send us data in. */ while ((buf = virtqueue_detach_unused_buf(port->in_vq))) free_buf(buf, true); + + /* Remove buffers we queued up for the Host to consume */ + while ((buf = virtqueue_detach_unused_buf(port->out_vq))) + free_buf(buf, true); } /* -- 1.7.7.6
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...+ GFP_KERNEL); + } else { + buf->buf = kmalloc(buf_size, GFP_KERNEL); + buf->dev = NULL; + } + if (!buf->buf) goto free_buf; buf->len = 0; @@ -485,7 +582,10 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + if (is_console_port(port)) + kfree(buf); + else + free_buf(buf); port->outvq_full = false; } } @@ -498,6 +598,7 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, ssize_t ret; unsigned long flags; unsigned int len; + str...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...+ GFP_KERNEL); + } else { + buf->buf = kmalloc(buf_size, GFP_KERNEL); + buf->dev = NULL; + } + if (!buf->buf) goto free_buf; buf->len = 0; @@ -485,7 +582,10 @@ static void reclaim_consumed_buffers(struct port *port) return; } while ((buf = virtqueue_get_buf(port->out_vq, &len))) { - kfree(buf); + if (is_console_port(port)) + kfree(buf); + else + free_buf(buf); port->outvq_full = false; } } @@ -498,6 +598,7 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, ssize_t ret; unsigned long flags; unsigned int len; + str...
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
...sjur.brandeland at stericsson.com> I thought rebasing rproc_serial to linux-next was going to be trivial. But when starting the merge I realized that I had to refactor the the patches from Masami Hiramatsu. The splice support has the same issue as I faced, with different type of buffers in the out_vq. So I ended up refactoring the splice functionality. The code size got smaller so hopefully this a step in the right direction. This refactoring also make introduction of rproc_serial cleaner. As requested I also added a patch for not initializing buffers. I have tested the VIRTIO_CONSOLE device...
2012 Sep 25
5
[PATCHv6 0/3] virtio_console: Add rproc_serial device
...sjur.brandeland at stericsson.com> I thought rebasing rproc_serial to linux-next was going to be trivial. But when starting the merge I realized that I had to refactor the the patches from Masami Hiramatsu. The splice support has the same issue as I faced, with different type of buffers in the out_vq. So I ended up refactoring the splice functionality. The code size got smaller so hopefully this a step in the right direction. This refactoring also make introduction of rproc_serial cleaner. As requested I also added a patch for not initializing buffers. I have tested the VIRTIO_CONSOLE device...
2019 May 15
5
[PATCH v9 2/7] virtio-pmem: Add virtio pmem driver
....module = THIS_MODULE; > + > + vpmem->nvdimm_bus = nvdimm_bus_register(&vdev->dev, > + &vpmem->nd_desc); > + if (!vpmem->nvdimm_bus) { > + dev_err(&vdev->dev, "failed to register device with nvdimm_bus\n"); > + err = -ENXIO; > + goto out_vq; > + } > + > + dev_set_drvdata(&vdev->dev, vpmem->nvdimm_bus); > + > + ndr_desc.res = &res; > + ndr_desc.numa_node = nid; > + ndr_desc.flush = async_pmem_flush; > + set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); > + set_bit(ND_REGION_ASYNC, &ndr_desc.f...
2019 May 15
5
[PATCH v9 2/7] virtio-pmem: Add virtio pmem driver
....module = THIS_MODULE; > + > + vpmem->nvdimm_bus = nvdimm_bus_register(&vdev->dev, > + &vpmem->nd_desc); > + if (!vpmem->nvdimm_bus) { > + dev_err(&vdev->dev, "failed to register device with nvdimm_bus\n"); > + err = -ENXIO; > + goto out_vq; > + } > + > + dev_set_drvdata(&vdev->dev, vpmem->nvdimm_bus); > + > + ndr_desc.res = &res; > + ndr_desc.numa_node = nid; > + ndr_desc.flush = async_pmem_flush; > + set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); > + set_bit(ND_REGION_ASYNC, &ndr_desc.f...
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> This patch-set introduces a new virtio type "rproc_serial" for communicating with remote processors over shared memory. The driver depends on the the remoteproc framework. As preparation for introducing "rproc_serial" I've done a refactoring of the transmit buffer handling. This patch-set is a rework of the
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com> This patch-set introduces a new virtio type "rproc_serial" for communicating with remote processors over shared memory. The driver depends on the the remoteproc framework. As preparation for introducing "rproc_serial" I've done a refactoring of the transmit buffer handling. This patch-set is a rework of the
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating with remote processors over shared memory. The driver depends on the the remoteproc framework. As preparation for introducing "rproc_serial" I've done a refactoring of the transmit buffer handling. NOTE: These two patches are identical to first two patches of the V8 patch-set, but are rebased to
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating with remote processors over shared memory. The driver depends on the the remoteproc framework. As preparation for introducing "rproc_serial" I've done a refactoring of the transmit buffer handling. NOTE: These two patches are identical to first two patches of the V8 patch-set, but are rebased to