Displaying 11 results from an estimated 11 matches for "virtio_find_vqs_ctx".
2017 Mar 30
1
[PATCH 4/6] virtio_net: allow specifying context for rx
...f (ctx)
> > + ctx[rxq2vq(i)] = true;
> > }
> >
> > - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> > + ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
> > + names, ctx, NULL);
>
> virtio_find_vqs_ctx()? (Needs to be exported, obviously.)
I guess I can do that but there's a single user ATM.
Do you think it's worth doing right now, or wait until
it gets more users?
> > if (ret)
> > goto err_find;
> >
> > @@ -2101,6 +2112,8 @@ static int virtnet_find_vqs(s...
2017 Mar 30
1
[PATCH 4/6] virtio_net: allow specifying context for rx
...f (ctx)
> > + ctx[rxq2vq(i)] = true;
> > }
> >
> > - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> > + ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
> > + names, ctx, NULL);
>
> virtio_find_vqs_ctx()? (Needs to be exported, obviously.)
I guess I can do that but there's a single user ATM.
Do you think it's worth doing right now, or wait until
it gets more users?
> > if (ret)
> > goto err_find;
> >
> > @@ -2101,6 +2112,8 @@ static int virtnet_find_vqs(s...
2017 Mar 29
2
[PATCH 4/6] virtio_net: allow specifying context for rx
With mergeable buffers we never use s/g for rx,
so allow specifying context in that case.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 6802169..340f737 100644
--- a/drivers/net/virtio_net.c
+++
2017 Mar 29
2
[PATCH 4/6] virtio_net: allow specifying context for rx
With mergeable buffers we never use s/g for rx,
so allow specifying context in that case.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/net/virtio_net.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 6802169..340f737 100644
--- a/drivers/net/virtio_net.c
+++
2017 Mar 30
0
[PATCH 4/6] virtio_net: allow specifying context for rx
...xq2vq(i)] = vi->sq[i].name;
> + if (ctx)
> + ctx[rxq2vq(i)] = true;
> }
>
> - ret = virtio_find_vqs(vi->vdev, total_vqs, vqs, callbacks, names, NULL);
> + ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks,
> + names, ctx, NULL);
virtio_find_vqs_ctx()? (Needs to be exported, obviously.)
> if (ret)
> goto err_find;
>
> @@ -2101,6 +2112,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
> return 0;
>
> err_find:
> + kfree(ctx);
> +err_ctx:
> kfree(names);
> err_names:
> kfree(callbacks...
2019 Mar 13
2
virtio-blk: should num_vqs be limited by num_possible_cpus()?
...g_ops {
const struct cpumask *cpu_mask);
const struct cpumask *(*get_vq_affinity)(struct virtio_device *vdev,
int index);
+ unsigned short (*calc_num_vqs)(unsigned short num_vqs);
};
/* If driver didn't advertise the feature, it will never appear. */
@@ -207,6 +209,15 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev,
unsigned nvqs,
desc);
}
+static inline
+unsigned short virtio_calc_num_vqs(struct virtio_device *vdev,
+ unsigned short num_vqs)
+{
+ if (vdev->config->calc_num_vqs)
+ return vdev->config->calc_num_vqs(num_vqs);
+ return num_vqs;
+}
+
/**...
2019 Mar 13
2
virtio-blk: should num_vqs be limited by num_possible_cpus()?
...g_ops {
const struct cpumask *cpu_mask);
const struct cpumask *(*get_vq_affinity)(struct virtio_device *vdev,
int index);
+ unsigned short (*calc_num_vqs)(unsigned short num_vqs);
};
/* If driver didn't advertise the feature, it will never appear. */
@@ -207,6 +209,15 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev,
unsigned nvqs,
desc);
}
+static inline
+unsigned short virtio_calc_num_vqs(struct virtio_device *vdev,
+ unsigned short num_vqs)
+{
+ if (vdev->config->calc_num_vqs)
+ return vdev->config->calc_num_vqs(num_vqs);
+ return num_vqs;
+}
+
/**...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...struct virtio_device *vdev, unsigned nvqs,
const char * const names[],
struct irq_affinity *desc)
{
- return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, desc);
+ return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, desc);
+}
+
+static inline
+int virtio_find_vqs_ctx(struct virtio_device *vdev, unsigned nvqs,
+ struct virtqueue *vqs[], vq_callback_t *callbacks[],
+ const char * const names[], const bool *ctx,
+ struct irq_affinity *desc)
+{
+ return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx,
+ desc);
}
/**
diff --git...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...struct virtio_device *vdev, unsigned nvqs,
const char * const names[],
struct irq_affinity *desc)
{
- return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, desc);
+ return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, desc);
+}
+
+static inline
+int virtio_find_vqs_ctx(struct virtio_device *vdev, unsigned nvqs,
+ struct virtqueue *vqs[], vq_callback_t *callbacks[],
+ const char * const names[], const bool *ctx,
+ struct irq_affinity *desc)
+{
+ return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx,
+ desc);
}
/**
diff --git...
2019 Mar 12
4
virtio-blk: should num_vqs be limited by num_possible_cpus()?
I observed that there is one msix vector for config and one shared vector
for all queues in below qemu cmdline, when the num-queues for virtio-blk
is more than the number of possible cpus:
qemu: "-smp 4" while "-device virtio-blk-pci,drive=drive-0,id=virtblk0,num-queues=6"
# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
... ...
24: 0
2019 Mar 12
4
virtio-blk: should num_vqs be limited by num_possible_cpus()?
I observed that there is one msix vector for config and one shared vector
for all queues in below qemu cmdline, when the num-queues for virtio-blk
is more than the number of possible cpus:
qemu: "-smp 4" while "-device virtio-blk-pci,drive=drive-0,id=virtblk0,num-queues=6"
# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
... ...
24: 0