search for: msix_used_vectors

Displaying 20 results from an estimated 108 matches for "msix_used_vectors".

2009 May 14
1
[PATCHv6 4/4] virtio_pci: optional MSI-X support
...intx_enabled; + struct msix_entry *msix_entries; + /* Name strings for interrupts. This size should be enough, + * and I'm too lazy to allocate each name separately. */ + char (*msix_names)[256]; + /* Number of available vectors */ + unsigned msix_vectors; + /* Vectors allocated */ + unsigned msix_used_vectors; +}; + +/* Constants for MSI-X */ +/* Use first vector for configuration changes, second and the rest for + * virtqueues Thus, we need at least 2 vectors for MSI. */ +enum { + VP_MSIX_CONFIG_VECTOR = 0, + VP_MSIX_VQ_VECTOR = 1, }; struct virtio_pci_vq_info @@ -60,6 +80,9 @@ struct virtio_pci_vq...
2009 May 14
1
[PATCHv6 4/4] virtio_pci: optional MSI-X support
...intx_enabled; + struct msix_entry *msix_entries; + /* Name strings for interrupts. This size should be enough, + * and I'm too lazy to allocate each name separately. */ + char (*msix_names)[256]; + /* Number of available vectors */ + unsigned msix_vectors; + /* Vectors allocated */ + unsigned msix_used_vectors; +}; + +/* Constants for MSI-X */ +/* Use first vector for configuration changes, second and the rest for + * virtqueues Thus, we need at least 2 vectors for MSI. */ +enum { + VP_MSIX_CONFIG_VECTOR = 0, + VP_MSIX_VQ_VECTOR = 1, }; struct virtio_pci_vq_info @@ -60,6 +80,9 @@ struct virtio_pci_vq...
2009 Jul 23
1
[PATCHv2 1/2] virtio: fix double free_irq on device removal
...0644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,7 +52,7 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; }; @@ -364,13 +364,15 @@ error_entries: static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, void (*callback)(struct virtqueue *vq), - const char *name) + const char *name, + u16 vector, + u16 per_vq_vector) { struct virtio_p...
2009 Jul 23
1
[PATCHv2 1/2] virtio: fix double free_irq on device removal
...0644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,7 +52,7 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; }; @@ -364,13 +364,15 @@ error_entries: static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, void (*callback)(struct virtqueue *vq), - const char *name) + const char *name, + u16 vector, + u16 per_vq_vector) { struct virtio_p...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,8 +52,10 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; + /* Whether we have vector per vq */ + bool per_vq_vectors; }; /* Constants for MSI-X */ @@ -278,27 +280,24 @@ static void vp_free_vectors(struct virtio_device *vdev) vp_dev->msix_entries = NULL; } -static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, - int *...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,8 +52,10 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; + /* Whether we have vector per vq */ + bool per_vq_vectors; }; /* Constants for MSI-X */ @@ -278,27 +280,24 @@ static void vp_free_vectors(struct virtio_device *vdev) vp_dev->msix_entries = NULL; } -static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, - int *...
2014 Sep 15
3
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...r; + goto error_msix_used; } if (!per_vq_vectors) { @@ -369,11 +369,15 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, vp_vring_interrupt, 0, vp_dev->msix_names[v], vp_dev); if (err) - goto error; + goto error_msix_used; ++vp_dev->msix_used_vectors; } return 0; +error_msix_used: + v = --vp_dev->msix_used_vectors; + free_irq(vp_dev->msix_entries[v].vector, vp_dev); error: + vp_dev->msix_enabled = 0; vp_free_vectors(vdev); return err; } -- 1.7.9.5
2014 Sep 15
3
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...r; + goto error_msix_used; } if (!per_vq_vectors) { @@ -369,11 +369,15 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, vp_vring_interrupt, 0, vp_dev->msix_names[v], vp_dev); if (err) - goto error; + goto error_msix_used; ++vp_dev->msix_used_vectors; } return 0; +error_msix_used: + v = --vp_dev->msix_used_vectors; + free_irq(vp_dev->msix_entries[v].vector, vp_dev); error: + vp_dev->msix_enabled = 0; vp_free_vectors(vdev); return err; } -- 1.7.9.5
2009 May 13
1
[PATCHv5 3/3] virtio_pci: optional MSI-X support
...intx_enabled; + struct msix_entry *msix_entries; + /* Name strings for interrupts. This size should be enough, + * and I'm too lazy to allocate each name separately. */ + char (*msix_names)[256]; + /* Number of available vectors */ + unsigned msix_vectors; + /* Vectors allocated */ + unsigned msix_used_vectors; +}; + +/* Constants for MSI-X */ +/* Use first vector for configuration changes, second and the rest for + * virtqueues Thus, we need at least 2 vectors for MSI. */ +enum { + VP_MSIX_CONFIG_VECTOR = 0, + VP_MSIX_VQ_VECTOR = 1, }; struct virtio_pci_vq_info @@ -60,6 +80,9 @@ struct virtio_pci_vq...
2009 May 13
1
[PATCHv5 3/3] virtio_pci: optional MSI-X support
...intx_enabled; + struct msix_entry *msix_entries; + /* Name strings for interrupts. This size should be enough, + * and I'm too lazy to allocate each name separately. */ + char (*msix_names)[256]; + /* Number of available vectors */ + unsigned msix_vectors; + /* Vectors allocated */ + unsigned msix_used_vectors; +}; + +/* Constants for MSI-X */ +/* Use first vector for configuration changes, second and the rest for + * virtqueues Thus, we need at least 2 vectors for MSI. */ +enum { + VP_MSIX_CONFIG_VECTOR = 0, + VP_MSIX_VQ_VECTOR = 1, }; struct virtio_pci_vq_info @@ -60,6 +80,9 @@ struct virtio_pci_vq...
2016 Nov 06
8
virtio_pci irq handling cleanups
Hi Michael, this series contains a couple cleanups for the virtio_pci interrupt handling code, including a switch to the new pci_irq_alloc_vectors helper. All these are in preparation of taking advantage of the new PCI layer / core IRQ interrupt affinity handling, for which I will send out a series once this and some core interrupt handling changes are in.
2016 Nov 06
8
virtio_pci irq handling cleanups
Hi Michael, this series contains a couple cleanups for the virtio_pci interrupt handling code, including a switch to the new pci_irq_alloc_vectors helper. All these are in preparation of taking advantage of the new PCI layer / core IRQ interrupt affinity handling, for which I will send out a series once this and some core interrupt handling changes are in.
2009 Jul 26
1
[PATCHv4 2/2] virtio: refactor find_vqs
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,8 +52,10 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; + /* Whether we have vector per vq */ + bool per_vq_vectors; }; /* Constants for MSI-X */ @@ -278,27 +280,24 @@ static void vp_free_vectors(struct virtio_device *vdev) vp_dev->msix_entries = NULL; } -static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, - int *...
2009 Jul 26
1
[PATCHv4 2/2] virtio: refactor find_vqs
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -52,8 +52,10 @@ struct virtio_pci_device char (*msix_names)[256]; /* Number of available vectors */ unsigned msix_vectors; - /* Vectors allocated */ + /* Vectors allocated, excluding per-vq vectors if any */ unsigned msix_used_vectors; + /* Whether we have vector per vq */ + bool per_vq_vectors; }; /* Constants for MSI-X */ @@ -278,27 +280,24 @@ static void vp_free_vectors(struct virtio_device *vdev) vp_dev->msix_entries = NULL; } -static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, - int *...
2017 Jan 27
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
..._var(&vp_dev->msix_affinity_masks[i], - GFP_KERNEL)) - goto error; - - err = pci_alloc_irq_vectors(vp_dev->pci_dev, nvectors, nvectors, - PCI_IRQ_MSIX); - if (err < 0) - goto error; - vp_dev->msix_enabled = 1; - - /* Set the vector used for configuration */ - v = vp_dev->msix_used_vectors; - snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, - "%s-config", name); - err = request_irq(pci_irq_vector(vp_dev->pci_dev, v), - vp_config_changed, 0, vp_dev->msix_names[v], - vp_dev); - if (err) - goto error; - ++vp_dev->msix_used_vectors; - - v =...
2017 Feb 05
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
..._var(&vp_dev->msix_affinity_masks[i], - GFP_KERNEL)) - goto error; - - err = pci_alloc_irq_vectors(vp_dev->pci_dev, nvectors, nvectors, - PCI_IRQ_MSIX); - if (err < 0) - goto error; - vp_dev->msix_enabled = 1; - - /* Set the vector used for configuration */ - v = vp_dev->msix_used_vectors; - snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, - "%s-config", name); - err = request_irq(pci_irq_vector(vp_dev->pci_dev, v), - vp_config_changed, 0, vp_dev->msix_names[v], - vp_dev); - if (err) - goto error; - ++vp_dev->msix_used_vectors; - - v =...
2014 Sep 15
1
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...t;> only happen if there was a bug in the device emulation but it still >> should be handled correctly. > > This might happen if host runs out of resources when trying > to map VQs to vectors, so doesn't have to be a bug. > > But I don't see what the problem is: > msix_used_vectors reflects the number of used vectors > and msix_enabled is set, thus vp_free_vectors > will free all IRQs and then disable MSIX. > > Where is the inconsistency you speak about? I missed the fact that vp_free_vectors() conditionally sets msix_enabled=0. It seems a bit cludgy especially...
2014 Sep 15
1
[PATCH] virtio_pci: properly clean up MSI-X state when initialization fails
...t;> only happen if there was a bug in the device emulation but it still >> should be handled correctly. > > This might happen if host runs out of resources when trying > to map VQs to vectors, so doesn't have to be a bug. > > But I don't see what the problem is: > msix_used_vectors reflects the number of used vectors > and msix_enabled is set, thus vp_free_vectors > will free all IRQs and then disable MSIX. > > Where is the inconsistency you speak about? I missed the fact that vp_free_vectors() conditionally sets msix_enabled=0. It seems a bit cludgy especially...
2014 Apr 19
1
RFC: sharing config interrupt between virtio devices for saving MSI
...ar config_msix_name[100]; static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, bool per_vq_vectors) { @@ -341,14 +343,13 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, /* Set the vector used for configuration */ v = vp_dev->msix_used_vectors; - snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, + snprintf(config_msix_name, sizeof *vp_dev->msix_names, "%s-config", name); - err = request_irq(vp_dev->msix_entries[v].vector, - vp_config_changed, 0, vp_dev->msix_names[v], - vp_dev); + err = requ...
2014 Apr 19
1
RFC: sharing config interrupt between virtio devices for saving MSI
...ar config_msix_name[100]; static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, bool per_vq_vectors) { @@ -341,14 +343,13 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, /* Set the vector used for configuration */ v = vp_dev->msix_used_vectors; - snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, + snprintf(config_msix_name, sizeof *vp_dev->msix_names, "%s-config", name); - err = request_irq(vp_dev->msix_entries[v].vector, - vp_config_changed, 0, vp_dev->msix_names[v], - vp_dev); + err = requ...