search for: setup_vq

Displaying 20 results from an estimated 160 matches for "setup_vq".

2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
...diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 133978c..68023e5 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -82,6 +82,12 @@ struct virtio_pci_device { /* Whether we have vector per vq */ bool per_vq_vectors; + struct virtqueue *(*setup_vq)(struct virtio_pci_device *vp_dev, + struct virtio_pci_vq_info *info, + unsigned idx, + void (*callback)(struct virtqueue *vq), + const char *name, + u16 msix_vec); void (*del_vq)(struct virtio_pci_vq_info *info); }; @@ -389,15 +395,15 @@ static int...
2014 Dec 08
0
[PATCH v2 06/10] virtio_pci: setup vqs indirectly
...diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 133978c..68023e5 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -82,6 +82,12 @@ struct virtio_pci_device { /* Whether we have vector per vq */ bool per_vq_vectors; + struct virtqueue *(*setup_vq)(struct virtio_pci_device *vp_dev, + struct virtio_pci_vq_info *info, + unsigned idx, + void (*callback)(struct virtqueue *vq), + const char *name, + u16 msix_vec); void (*del_vq)(struct virtio_pci_vq_info *info); }; @@ -389,15 +395,15 @@ static int...
2012 Feb 01
0
[PATCH 1/2] virtio-pci: add setup_vqs flag in vp_try_to_find_vqs
...atic int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, > { > struct virtio_pci_device *vp_dev = to_vp_device(vdev); > u16 msix_vec; > - int i, err, nvectors, allocated_vectors; > + int i, err, nvectors; > + > + if (vp_dev->msix_used_vectors) > + goto setup_vqs; > > if (!use_msix) { > /* Old style: one normal interrupt for change and all vqs. */ > @@ -536,12 +541,16 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, > } > > vp_dev->per_vq_vectors = per_vq_vectors; > - allocated_vectors = vp...
2012 Feb 01
0
[PATCH 1/2] virtio-pci: add setup_vqs flag in vp_try_to_find_vqs
...atic int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, > { > struct virtio_pci_device *vp_dev = to_vp_device(vdev); > u16 msix_vec; > - int i, err, nvectors, allocated_vectors; > + int i, err, nvectors; > + > + if (vp_dev->msix_used_vectors) > + goto setup_vqs; > > if (!use_msix) { > /* Old style: one normal interrupt for change and all vqs. */ > @@ -536,12 +541,16 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, > } > > vp_dev->per_vq_vectors = per_vq_vectors; > - allocated_vectors = vp...
2017 Feb 07
2
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
On 2017?02?06? 01:15, Christoph Hellwig wrote: > We don't really need struct virtio_pci_vq_info, as most field in there > are redundant: > > - the vq backpointer is not strictly neede to start with > - the entry in the vqs list is not needed - the generic virtqueue already > has list, we only need to check if it has a callback to get the same > semantics >
2017 Feb 07
2
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
On 2017?02?06? 01:15, Christoph Hellwig wrote: > We don't really need struct virtio_pci_vq_info, as most field in there > are redundant: > > - the vq backpointer is not strictly neede to start with > - the entry in the vqs list is not needed - the generic virtqueue already > has list, we only need to check if it has a callback to get the same > semantics >
2017 Jan 27
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...&& vring_interrupt(irq, vq) == IRQ_HANDLED) ret = IRQ_HANDLED; } - spin_unlock_irqrestore(&vp_dev->lock, flags); return ret; } @@ -167,55 +164,6 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, return err; } -static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned index, - void (*callback)(struct virtqueue *vq), - const char *name, - u16 msix_vec) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc(sizeof *info, GFP_KERNEL); - struct virtqueue *vq...
2017 Feb 05
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...&& vring_interrupt(irq, vq) == IRQ_HANDLED) ret = IRQ_HANDLED; } - spin_unlock_irqrestore(&vp_dev->lock, flags); return ret; } @@ -167,55 +164,6 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, return err; } -static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned index, - void (*callback)(struct virtqueue *vq), - const char *name, - u16 msix_vec) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc(sizeof *info, GFP_KERNEL); - struct virtqueue *vq...
2017 Feb 07
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...t) { + if (vring_interrupt(irq, vq) == IRQ_HANDLED) ret = IRQ_HANDLED; } - spin_unlock_irqrestore(&vp_dev->lock, flags); return ret; } @@ -167,55 +164,6 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, return err; } -static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned index, - void (*callback)(struct virtqueue *vq), - const char *name, - u16 msix_vec) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc(sizeof *info, GFP_KERNEL); - struct virtqueue *vq...
2014 Dec 08
11
[PATCH 0/9] virtio_pci: split out legacy device support
...ges. Instead, this simply refactors virtio-pci, splitting legacy device support code out to a separate file: virtio_pci_legacy.c For virtio 1.0, all that's left is to add virtio_pci_modern.c supporting get_features finalize_features get (config) set (config) get_status set_status reset setup_vq del_vq probe remove Most notably, tricky MSI-X vector probing logic stays in common file: virtio_pci.c. version-specific only has to code setup/del functions for individual vqs. Note: this is on top of "virtio 1.0 enhancements" that I sent earlier. Michael S. Tsirkin (9): virtio_p...
2014 Dec 08
11
[PATCH 0/9] virtio_pci: split out legacy device support
...ges. Instead, this simply refactors virtio-pci, splitting legacy device support code out to a separate file: virtio_pci_legacy.c For virtio 1.0, all that's left is to add virtio_pci_modern.c supporting get_features finalize_features get (config) set (config) get_status set_status reset setup_vq del_vq probe remove Most notably, tricky MSI-X vector probing logic stays in common file: virtio_pci.c. version-specific only has to code setup/del functions for individual vqs. Note: this is on top of "virtio 1.0 enhancements" that I sent earlier. Michael S. Tsirkin (9): virtio_p...
2015 Jan 15
1
[PATCH] virtio_pci_modern: validate features
..._modern_probe(struct virtio_pci_device *vp_dev) vp_dev->vdev.config = &virtio_pci_config_nodev_ops; } + features = vp_get_features(vdev); + if (!features & (1ULL << VIRTIO_F_VERSION_1)) + goto err_valid_features; + vp_dev->config_vector = vp_config_vector; vp_dev->setup_vq = setup_vq; vp_dev->del_vq = del_vq; return 0; +err_valid_features: + if (vp_dev->device) + pci_iounmap(pci_dev, vp_dev->device); err_map_device: if (vp_dev->notify_base) pci_iounmap(pci_dev, vp_dev->notify_base); -- MST
2015 Jan 15
1
[PATCH] virtio_pci_modern: validate features
..._modern_probe(struct virtio_pci_device *vp_dev) vp_dev->vdev.config = &virtio_pci_config_nodev_ops; } + features = vp_get_features(vdev); + if (!features & (1ULL << VIRTIO_F_VERSION_1)) + goto err_valid_features; + vp_dev->config_vector = vp_config_vector; vp_dev->setup_vq = setup_vq; vp_dev->del_vq = del_vq; return 0; +err_valid_features: + if (vp_dev->device) + pci_iounmap(pci_dev, vp_dev->device); err_map_device: if (vp_dev->notify_base) pci_iounmap(pci_dev, vp_dev->notify_base); -- MST
2017 Apr 07
0
[vhost:linux-next 13/26] drivers//virtio/virtio_pci_common.c:186:7: error: too few arguments to function 'vp_dev->setup_vq'
...gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout d5edad95c2f89cced19a23713f752442b620f0e1 # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers//virtio/virtio_pci_common.c: In function 'vp_setup_vq': >> drivers//virtio/virtio_pci_common.c:186:7: error: too few arguments to function 'vp_dev->setup_vq' vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, ^~~~~~ drivers//virtio/virtio_pci_common.c: In function 'vp_find_vqs_msix': >> d...
2017 Apr 07
0
[vhost:linux-next 13/26] drivers//virtio/virtio_pci_common.c:186:7: error: too few arguments to function 'vp_dev->setup_vq'
...gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout d5edad95c2f89cced19a23713f752442b620f0e1 # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers//virtio/virtio_pci_common.c: In function 'vp_setup_vq': >> drivers//virtio/virtio_pci_common.c:186:7: error: too few arguments to function 'vp_dev->setup_vq' vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, ^~~~~~ drivers//virtio/virtio_pci_common.c: In function 'vp_find_vqs_msix': >> d...
2011 Dec 08
14
[PATCH 0/11] RFC: PCI using capabilitities
Here's the patch series I ended up with. I haven't coded up the QEMU side yet, so no idea if the new driver works. Questions: (1) Do we win from separating ISR, NOTIFY and COMMON? (2) I used a "u8 bar"; should I use a bir and pack it instead? BIR seems a little obscure (noone else in the kernel source seems to refer to it). Cheers, Rusty.
2011 Dec 08
14
[PATCH 0/11] RFC: PCI using capabilitities
Here's the patch series I ended up with. I haven't coded up the QEMU side yet, so no idea if the new driver works. Questions: (1) Do we win from separating ISR, NOTIFY and COMMON? (2) I used a "u8 bar"; should I use a bir and pack it instead? BIR seems a little obscure (noone else in the kernel source seems to refer to it). Cheers, Rusty.
2013 May 29
1
[RFC 7/11] virtio_pci: new, capability-aware driver.
On Wed, May 29, 2013 at 10:47:52AM +0930, Rusty Russell wrote: > "Michael S. Tsirkin" <mst at redhat.com> writes: > > > On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote: > >> On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote: > >> > On Sun, 11 Dec 2011 11:42:56 +0200, "Michael S. Tsirkin" <mst at
2023 Mar 07
3
[PATCH 1/3] virtio_pci_modern: Remove unnecessary num zero check
...ile changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index 9e496e288cfa..3d7144f8f959 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -306,10 +306,10 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev, return ERR_PTR(-EINVAL); /* Check if queue is either not available or already active. */ - num = vp_modern_get_queue_size(mdev, index); - if (!num || vp_modern_get_queue_enable(mdev, index)) + if (vp_modern_get_queue_enable(mdev, index)) return ERR_PTR(-E...
2014 Dec 03
1
[PATCH RFC 1/2] virtio_pci: free up vq->priv
...virtio_pci.c @@ -47,6 +58,9 @@ struct virtio_pci_device { spinlock_t lock; struct list_head virtqueues; + /* array of all queues for house-keeping */ + struct virtio_pci_vq_info **vqs; + /* MSI-X support */ int msix_enabled; int intx_enabled; @@ -429,7 +432,6 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, goto out_activate_queue; } - vq->priv = info; info->vq = vq; if (msix_vec != VIRTIO_MSI_NO_VECTOR) { @@ -449,6 +451,7 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, INIT_LIST_HEAD(&info->node)...