Displaying 20 results from an estimated 70 matches for "vm_setup_vq".
2017 Feb 04
0
[PATCH] virtio_mmio: remove virtio_mmio_vq_info
...l(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
if (vm_dev->version == 1) {
@@ -333,8 +311,6 @@ static void vm_del_vq(struct virtqueue *vq)
}
vring_del_virtqueue(vq);
-
- kfree(info);
}
static void vm_del_vqs(struct virtio_device *vdev)
@@ -353,9 +329,7 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
const char *name)
{
struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
- struct virtio_mmio_vq_info *info;
struct virtqueue *vq;
- unsigned long flags;
unsigned int num;
int err;
@@ -372,13 +346,6 @@ static struct virtqueue...
2017 Feb 04
0
[PATCH] virtio_mmio: remove virtio_mmio_vq_info
...l(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
if (vm_dev->version == 1) {
@@ -333,8 +311,6 @@ static void vm_del_vq(struct virtqueue *vq)
}
vring_del_virtqueue(vq);
-
- kfree(info);
}
static void vm_del_vqs(struct virtio_device *vdev)
@@ -353,9 +329,7 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
const char *name)
{
struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
- struct virtio_mmio_vq_info *info;
struct virtqueue *vq;
- unsigned long flags;
unsigned int num;
int err;
@@ -372,13 +346,6 @@ static struct virtqueue...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +301,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2015 Jan 20
4
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +301,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2012 Sep 24
3
[PATCH 0/2] virtio-mmio updates for 3.7
Hi Rusty,
Would you be so kind and consider getting those two small fixes into
3.7 merge? All credits go to Brian, all shame on me :-)
Cheers!
Pawel
Brian Foley (2):
virtio_mmio: fix off by one error allocating queue
virtio_mmio: Don't attempt to create empty virtqueues
drivers/virtio/virtio_mmio.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--
1.7.9.5
2012 Sep 24
3
[PATCH 0/2] virtio-mmio updates for 3.7
Hi Rusty,
Would you be so kind and consider getting those two small fixes into
3.7 merge? All credits go to Brian, all shame on me :-)
Cheers!
Pawel
Brian Foley (2):
virtio_mmio: fix off by one error allocating queue
virtio_mmio: Don't attempt to create empty virtqueues
drivers/virtio/virtio_mmio.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--
1.7.9.5
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +294,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2015 Jan 20
1
[PATCH] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +294,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...m_dev->base + VIRTIO_MMIO_QUEUE_READY);
> + WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
> + }
>
> size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
> free_pages_exact(info->queue, size);
> @@ -312,7 +301,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
> writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
>
> /* Queue shouldn't already be set up. */
> - if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
> + if (readl(vm_dev->base + (vm_dev->version == 1 ?
> + V...
2015 Jan 20
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
...m_dev->base + VIRTIO_MMIO_QUEUE_READY);
> + WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
> + }
>
> size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
> free_pages_exact(info->queue, size);
> @@ -312,7 +301,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
> writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
>
> /* Queue shouldn't already be set up. */
> - if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
> + if (readl(vm_dev->base + (vm_dev->version == 1 ?
> + V...
2023 Oct 10
1
[PATCH 2/2] virtio-mmio: Support multiple interrupts per device
...list_for_each_entry_safe(vq, n, &vdev->vqs, list)
> vm_del_vq(vq);
> -
> - free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev);
> }
>
> static void vm_synchronize_cbs(struct virtio_device *vdev)
> @@ -488,6 +511,18 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned int in
> return ERR_PTR(err);
> }
>
> +/* Map virtqueue to zero-based interrupt number */
> +static unsigned int vq2irq(const struct virtqueue *vq)
> +{
> + switch (vq->vdev->id.device) {
> + case VIRTIO_ID_NET:...
2023 Oct 10
1
[PATCH 2/2] virtio-mmio: Support multiple interrupts per device
...list_for_each_entry_safe(vq, n, &vdev->vqs, list)
> vm_del_vq(vq);
> -
> - free_irq(platform_get_irq(vm_dev->pdev, 0), vm_dev);
> }
>
> static void vm_synchronize_cbs(struct virtio_device *vdev)
> @@ -488,6 +511,18 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned int in
> return ERR_PTR(err);
> }
>
> +/* Map virtqueue to zero-based interrupt number */
> +static unsigned int vq2irq(const struct virtqueue *vq)
> +{
> + switch (vq->vdev->id.device) {
> + case VIRTIO_ID_NET:...
2015 Apr 28
0
[PATCH v2] virtio-mmio: Update the device to OASIS spec version
Hi,
On 01/20/2015 01:12 PM, Pawel Moll wrote:
> @@ -356,13 +346,6 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
> info->num /= 2;
> }
>
> - /* Activate the queue */
> - writel(info->num, vm_dev->base + VIRTIO_MMIO_QUEUE_NUM);
> - writel(VIRTIO_MMIO_VRING_ALIGN,
> - vm_dev->base + VIRTIO_MMIO_QUEUE_ALIGN);
> - writel(virt...
2018 Dec 28
0
[PATCH v1 2/2] virtio: don't allocate vqs when names[i] = NULL
...;pdev, 0);
- int i, err;
+ int i, err, queue_idx = 0;
err = request_irq(irq, vm_interrupt, IRQF_SHARED,
dev_name(&vdev->dev), vm_dev);
@@ -476,7 +476,12 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
return err;
for (i = 0; i < nvqs; ++i) {
- vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i],
+ if (!names[i]) {
+ vqs[i] = NULL;
+ continue;
+ }
+
+ vqs[i] = vm_setup_vq(vdev, queue_idx++, callbacks[i], names[i],
ctx ? ctx[i] : false);
if (IS_ERR(vqs[i])) {
vm_del_vqs(vdev);
--
2.7.4
2023 Mar 23
1
[PATCH v4] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support
...ation_data(vq);
> +
> + writel(data, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY);
> +
> + return true;
> +}
> +
> /* Notify all virtqueues on an interrupt. */
> static irqreturn_t vm_interrupt(int irq, void *opaque)
> {
> @@ -368,6 +378,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned int in
> unsigned long flags;
> unsigned int num;
> int err;
> + bool (*notify)(struct virtqueue *vq) = __virtio_test_bit(vdev,
> + VIRTIO_F_NOTIFICATION_DATA) ? vm_notify_with_data : vm_notify;
Can we optimize this line?
Thanks.
>
&...
2023 Mar 23
1
[PATCH v4] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support
...Y);
> > > +
> > > + return true;
> > > +}
> > > +
> > > /* Notify all virtqueues on an interrupt. */
> > > static irqreturn_t vm_interrupt(int irq, void *opaque)
> > > {
> > > @@ -368,6 +378,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned int in
> > > unsigned long flags;
> > > unsigned int num;
> > > int err;
> > > + bool (*notify)(struct virtqueue *vq) = __virtio_test_bit(vdev,
> > > + VIRTIO_F_NOTIFICATION_DATA) ? v...
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +294,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2014 Dec 19
5
[RFC] virtio-mmio: Update the device to OASIS spec version
...FN);
+ } else {
+ writel(0, vm_dev->base + VIRTIO_MMIO_QUEUE_READY);
+ WARN_ON(readl(vm_dev->base + VIRTIO_MMIO_QUEUE_READY));
+ }
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_MMIO_VRING_ALIGN));
free_pages_exact(info->queue, size);
@@ -312,7 +294,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
/* Queue shouldn't already be set up. */
- if (readl(vm_dev->base + VIRTIO_MMIO_QUEUE_PFN)) {
+ if (readl(vm_dev->base + (vm_dev->version == 1 ?
+ VIRTIO_MMIO_QUEUE_PFN : VIRTIO_...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...vqs[i]);
vqs[i] = NULL;
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 78343b8..74dc717 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -351,7 +351,7 @@ static void vm_del_vqs(struct virtio_device *vdev)
static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
void (*callback)(struct virtqueue *vq),
- const char *name)
+ const char *name, bool ctx)
{
struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
struct virtio_mmio_vq_info *info;
@@ -388,7 +388,7 @@ static struct virtqueu...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...vqs[i]);
vqs[i] = NULL;
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 78343b8..74dc717 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -351,7 +351,7 @@ static void vm_del_vqs(struct virtio_device *vdev)
static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
void (*callback)(struct virtqueue *vq),
- const char *name)
+ const char *name, bool ctx)
{
struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
struct virtio_mmio_vq_info *info;
@@ -388,7 +388,7 @@ static struct virtqueu...