Displaying 20 results from an estimated 48 matches for "virtio_queue_set_num".
2014 Dec 03
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
On Tue, 2 Dec 2014 21:03:45 +0200
"Michael S. Tsirkin" <mst at redhat.com> wrote:
> On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > {
> > + /*
> > + * For virtio-1 devices, the number of buffers may only be
> > + * updated if the ring addresses have not yet been set up.
>
> Where does it say that?
Hmpf, may have imagined that.
This means we eit...
2014 Dec 03
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
On Tue, 2 Dec 2014 21:03:45 +0200
"Michael S. Tsirkin" <mst at redhat.com> wrote:
> On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > {
> > + /*
> > + * For virtio-1 devices, the number of buffers may only be
> > + * updated if the ring addresses have not yet been set up.
>
> Where does it say that?
Hmpf, may have imagined that.
This means we eit...
2014 Dec 03
0
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
On Wed, 3 Dec 2014 10:27:36 +0100
Cornelia Huck <cornelia.huck at de.ibm.com> wrote:
> On Tue, 2 Dec 2014 21:03:45 +0200
> "Michael S. Tsirkin" <mst at redhat.com> wrote:
>
> > On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > > {
> > > + /*
> > > + * For virtio-1 devices, the number of buffers may only be
> > > + * updated if the ring addresses have not yet been set up.
> >
> > Where does it say that?
>
> Hmpf, ma...
2014 Dec 03
0
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
On Wed, 3 Dec 2014 10:27:36 +0100
Cornelia Huck <cornelia.huck at de.ibm.com> wrote:
> On Tue, 2 Dec 2014 21:03:45 +0200
> "Michael S. Tsirkin" <mst at redhat.com> wrote:
>
> > On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > > {
> > > + /*
> > > + * For virtio-1 devices, the number of buffers may only be
> > > + * updated if the ring addresses have not yet been set up.
> >
> > Where does it say that?
>
> Hmpf, ma...
2014 Dec 02
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...Device *vdev, int n, hwaddr desc,
> + hwaddr avail, hwaddr used)
> +{
> + vdev->vq[n].pa = -1ULL;
> + vdev->vq[n].vring.desc = desc;
> + vdev->vq[n].vring.avail = avail;
> + vdev->vq[n].vring.used = used;
> +}
> +
> void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> {
> /* Don't allow guest to flip queue between existent and
pa == -1ULL tricks look quite ugly.
Can't we set desc/avail/used unconditionally, and drop
the pa value?
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h...
2014 Dec 02
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...Device *vdev, int n, hwaddr desc,
> + hwaddr avail, hwaddr used)
> +{
> + vdev->vq[n].pa = -1ULL;
> + vdev->vq[n].vring.desc = desc;
> + vdev->vq[n].vring.avail = avail;
> + vdev->vq[n].vring.used = used;
> +}
> +
> void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> {
> /* Don't allow guest to flip queue between existent and
pa == -1ULL tricks look quite ugly.
Can't we set desc/avail/used unconditionally, and drop
the pa value?
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h...
2014 Dec 02
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...return vdev->vq[n].vring.desc;
+}
+
+void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
+ hwaddr avail, hwaddr used)
+{
+ vdev->vq[n].vring.desc = desc;
+ vdev->vq[n].vring.avail = avail;
+ vdev->vq[n].vring.used = used;
}
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
{
+ /*
+ * For virtio-1 devices, the number of buffers may only be
+ * updated if the ring addresses have not yet been set up.
+ */
+ if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1) &&
+ vdev->vq[n].vring.desc) {
+ err...
2014 Dec 02
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...return vdev->vq[n].vring.desc;
+}
+
+void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
+ hwaddr avail, hwaddr used)
+{
+ vdev->vq[n].vring.desc = desc;
+ vdev->vq[n].vring.avail = avail;
+ vdev->vq[n].vring.used = used;
}
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
{
+ /*
+ * For virtio-1 devices, the number of buffers may only be
+ * updated if the ring addresses have not yet been set up.
+ */
+ if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1) &&
+ vdev->vq[n].vring.desc) {
+ err...
2014 Dec 03
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...gt; Cornelia Huck <cornelia.huck at de.ibm.com> wrote:
>
> > On Tue, 2 Dec 2014 21:03:45 +0200
> > "Michael S. Tsirkin" <mst at redhat.com> wrote:
> >
> > > On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > > > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > > > {
> > > > + /*
> > > > + * For virtio-1 devices, the number of buffers may only be
> > > > + * updated if the ring addresses have not yet been set up.
> > >
> > > Where does it...
2014 Dec 03
2
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...gt; Cornelia Huck <cornelia.huck at de.ibm.com> wrote:
>
> > On Tue, 2 Dec 2014 21:03:45 +0200
> > "Michael S. Tsirkin" <mst at redhat.com> wrote:
> >
> > > On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote:
> > > > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > > > {
> > > > + /*
> > > > + * For virtio-1 devices, the number of buffers may only be
> > > > + * updated if the ring addresses have not yet been set up.
> > >
> > > Where does it...
2015 Jan 22
2
[Qemu-devel] [PATCH RFC v6 07/20] virtio: allow virtio-1 queue layout
...o/virtio-mmio.c
> +++ b/hw/virtio/virtio-mmio.c
> @@ -244,8 +244,11 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
> case VIRTIO_MMIO_QUEUENUM:
> DPRINTF("mmio_queue write %d max %d\n", (int)value, VIRTQUEUE_MAX_SIZE);
> virtio_queue_set_num(vdev, vdev->queue_sel, value);
> + /* Note: only call this function for legacy devices */
It's not clear to me if this is an assertion that this *does* only
call the function for legacy devices or a fixme, that it *should* only
call the function for legacy devices.
> +...
2015 Jan 22
2
[Qemu-devel] [PATCH RFC v6 07/20] virtio: allow virtio-1 queue layout
...o/virtio-mmio.c
> +++ b/hw/virtio/virtio-mmio.c
> @@ -244,8 +244,11 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
> case VIRTIO_MMIO_QUEUENUM:
> DPRINTF("mmio_queue write %d max %d\n", (int)value, VIRTQUEUE_MAX_SIZE);
> virtio_queue_set_num(vdev, vdev->queue_sel, value);
> + /* Note: only call this function for legacy devices */
It's not clear to me if this is an assertion that this *does* only
call the function for legacy devices or a fixme, that it *should* only
call the function for legacy devices.
> +...
2014 Dec 11
0
[PATCH RFC v6 07/20] virtio: allow virtio-1 queue layout
...63b 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -244,8 +244,11 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
case VIRTIO_MMIO_QUEUENUM:
DPRINTF("mmio_queue write %d max %d\n", (int)value, VIRTQUEUE_MAX_SIZE);
virtio_queue_set_num(vdev, vdev->queue_sel, value);
+ /* Note: only call this function for legacy devices */
+ virtio_queue_update_rings(vdev, vdev->queue_sel);
break;
case VIRTIO_MMIO_QUEUEALIGN:
+ /* Note: this is only valid for legacy devices */
virtio_queue_set_alig...
2014 Dec 11
0
[PATCH RFC v6 07/20] virtio: allow virtio-1 queue layout
...63b 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -244,8 +244,11 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
case VIRTIO_MMIO_QUEUENUM:
DPRINTF("mmio_queue write %d max %d\n", (int)value, VIRTQUEUE_MAX_SIZE);
virtio_queue_set_num(vdev, vdev->queue_sel, value);
+ /* Note: only call this function for legacy devices */
+ virtio_queue_update_rings(vdev, vdev->queue_sel);
break;
case VIRTIO_MMIO_QUEUEALIGN:
+ /* Note: this is only valid for legacy devices */
virtio_queue_set_alig...
2014 Dec 02
0
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
....pa;
}
+void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
+ hwaddr avail, hwaddr used)
+{
+ vdev->vq[n].pa = -1ULL;
+ vdev->vq[n].vring.desc = desc;
+ vdev->vq[n].vring.avail = avail;
+ vdev->vq[n].vring.used = used;
+}
+
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
{
/* Don't allow guest to flip queue between existent and
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 68c40db..80ee313 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -224,6 +224,8 @@ void virti...
2014 Dec 02
0
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
....pa;
}
+void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
+ hwaddr avail, hwaddr used)
+{
+ vdev->vq[n].pa = -1ULL;
+ vdev->vq[n].vring.desc = desc;
+ vdev->vq[n].vring.avail = avail;
+ vdev->vq[n].vring.used = used;
+}
+
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
{
/* Don't allow guest to flip queue between existent and
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 68c40db..80ee313 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -224,6 +224,8 @@ void virti...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...(struct virtio_pci_common_cfg, queue_select):
+ assert(val < VIRTIO_PCI_QUEUE_MAX);
+ vdev->queue_sel = val;
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_size):
+ assert(val && val < 0x8ffff && !(val & (val - 1)));
+ virtio_queue_set_num(vdev, vdev->queue_sel, val);
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_msix_vector):
+ virtio_queue_set_vector(vdev, vdev->queue_sel, val);
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_enable):
+ /* TODO */
+ break;
+ case offse...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...(struct virtio_pci_common_cfg, queue_select):
+ assert(val < VIRTIO_PCI_QUEUE_MAX);
+ vdev->queue_sel = val;
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_size):
+ assert(val && val < 0x8ffff && !(val & (val - 1)));
+ virtio_queue_set_num(vdev, vdev->queue_sel, val);
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_msix_vector):
+ virtio_queue_set_vector(vdev, vdev->queue_sel, val);
+ break;
+ case offsetof(struct virtio_pci_common_cfg, queue_enable):
+ /* TODO */
+ break;
+ case offse...
2013 May 28
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...queue_select):
> + assert(val < VIRTIO_PCI_QUEUE_MAX);
> + vdev->queue_sel = val;
> + break;
> + case offsetof(struct virtio_pci_common_cfg, queue_size):
> + assert(val && val < 0x8ffff && !(val & (val - 1)));
> + virtio_queue_set_num(vdev, vdev->queue_sel, val);
> + break;
> + case offsetof(struct virtio_pci_common_cfg, queue_msix_vector):
> + virtio_queue_set_vector(vdev, vdev->queue_sel, val);
> + break;
> + case offsetof(struct virtio_pci_common_cfg, queue_enable):
> + /* TO...
2014 Dec 02
0
[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout
...hwaddr avail, hwaddr used)
> > +{
> > + vdev->vq[n].pa = -1ULL;
> > + vdev->vq[n].vring.desc = desc;
> > + vdev->vq[n].vring.avail = avail;
> > + vdev->vq[n].vring.used = used;
> > +}
> > +
> > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
> > {
> > /* Don't allow guest to flip queue between existent and
>
> pa == -1ULL tricks look quite ugly.
> Can't we set desc/avail/used unconditionally, and drop
> the pa value?
And have virtio_queue_get_addr() return desc...