search for: msix_entries

Displaying 20 results from an estimated 158 matches for "msix_entries".

2009 May 14
1
[PATCHv6 4/4] virtio_pci: optional MSI-X support
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,26 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_enabled; + int 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...
2009 May 14
1
[PATCHv6 4/4] virtio_pci: optional MSI-X support
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,26 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_enabled; + int 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...
2009 Jul 26
1
[PATCHv4 2/2] virtio: refactor find_vqs
...- /* 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 *options, int noptions) -{ - int i; - for (i = 0; i < noptions; ++i) - if (!pci_enable_msix(dev, entries, options[i])) - return options[i]; - return -EBUSY; -} - -static int vp_request_vectors(s...
2009 Jul 26
1
[PATCHv4 2/2] virtio: refactor find_vqs
...- /* 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 *options, int noptions) -{ - int i; - for (i = 0; i < noptions; ++i) - if (!pci_enable_msix(dev, entries, options[i])) - return options[i]; - return -EBUSY; -} - -static int vp_request_vectors(s...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...- /* 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 *options, int noptions) -{ - int i; - for (i = 0; i < noptions; ++i) - if (!pci_enable_msix(dev, entries, options[i])) - return options[i]; - return -EBUSY; -} - -static int vp_request_vectors(s...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...- /* 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 *options, int noptions) -{ - int i; - for (i = 0; i < noptions; ++i) - if (!pci_enable_msix(dev, entries, options[i])) - return options[i]; - return -EBUSY; -} - -static int vp_request_vectors(s...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...f7b79a2..2b6333c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,28 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_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 vectors configured at startup (excludes per-virtqueue + * vectors if any) */ + unsigned msix_preset_vectors; + /* Number of per-vi...
2009 May 07
1
[PATCH 3/3] virtio_pci: optional MSI-X support
...f7b79a2..2b6333c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,28 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_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 vectors configured at startup (excludes per-virtqueue + * vectors if any) */ + unsigned msix_preset_vectors; + /* Number of per-vi...
2009 Apr 27
0
[PATCH 8/8] virtio_pci: optional MSI-X support
.../virtio_pci.c index 151538c..20bdc8c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,8 +42,33 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + 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 vectors configured at startup (excludes per-virtqueue + * vectors if any) */ + unsigned msix_preset_vectors; + /* Number of per-vi...
2009 Apr 27
0
[PATCH 8/8] virtio_pci: optional MSI-X support
.../virtio_pci.c index 151538c..20bdc8c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,8 +42,33 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + 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 vectors configured at startup (excludes per-virtqueue + * vectors if any) */ + unsigned msix_preset_vectors; + /* Number of per-vi...
2009 May 13
1
[PATCHv5 3/3] virtio_pci: optional MSI-X support
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,26 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_enabled; + int 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...
2009 May 13
1
[PATCHv5 3/3] virtio_pci: optional MSI-X support
...644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -42,6 +42,26 @@ struct virtio_pci_device /* a list of queues so we can dispatch IRQs */ spinlock_t lock; struct list_head virtqueues; + + /* MSI-X support */ + int msix_enabled; + int 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...
2009 Jul 23
0
qemu-kvm missing some msix capability check
...st one vector per queue and one for config changes. > - * Fallback to separate vectors for config and a shared for queues. > - * Finally fall back to regular interrupts. */ > - int options[] = { max_vqs + 1, 2 }; > - int nvectors = max(options[0], options[1]); > > vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, > GFP_KERNEL); > @@ -307,37 +316,29 @@ static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs) > vp_dev->msix_entries[i].entry = i; > > err = vp_enable_msix(vp_dev->pci_dev, vp_dev->...
2009 Jul 23
0
qemu-kvm missing some msix capability check
...st one vector per queue and one for config changes. > - * Fallback to separate vectors for config and a shared for queues. > - * Finally fall back to regular interrupts. */ > - int options[] = { max_vqs + 1, 2 }; > - int nvectors = max(options[0], options[1]); > > vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, > GFP_KERNEL); > @@ -307,37 +316,29 @@ static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs) > vp_dev->msix_entries[i].entry = i; > > err = vp_enable_msix(vp_dev->pci_dev, vp_dev->...
2014 Feb 19
3
[PATCH] virtio: Use pci_enable_msix_range() instead of pci_enable_msix()
...ers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index a416f9b..dea042c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, for (i = 0; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; - /* pci_enable_msix returns positive if we can't get this many. */ - err = pci_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, nvectors); - if (err > 0) - err = -ENOSPC; - if (err) + err = pci_enable_msix_range(vp_dev->pci_dev, + vp_dev->msix_entries,...
2014 Feb 19
3
[PATCH] virtio: Use pci_enable_msix_range() instead of pci_enable_msix()
...ers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index a416f9b..dea042c 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, for (i = 0; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; - /* pci_enable_msix returns positive if we can't get this many. */ - err = pci_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, nvectors); - if (err > 0) - err = -ENOSPC; - if (err) + err = pci_enable_msix_range(vp_dev->pci_dev, + vp_dev->msix_entries,...
2010 Mar 25
2
[PATCH v3 1/1] Shared memory uio_pci driver
...nclude <linux/uio_driver.h> > + > +#include <asm/io.h> > + > +#define IntrStatus 0x04 > +#define IntrMask 0x00 > + > +struct ivshmem_info { > + struct uio_info *uio; > + struct pci_dev *dev; > + char (*msix_names)[256]; > + struct msix_entry *msix_entries; > + int nvectors; > +}; > + > +static irqreturn_t ivshmem_handler(int irq, struct uio_info *dev_info) > +{ > + > + void __iomem *plx_intscr = dev_info->mem[0].internal_addr > + + IntrStatus; > + u32 val; > + > + val = readl(plx_int...
2010 Mar 25
2
[PATCH v3 1/1] Shared memory uio_pci driver
...nclude <linux/uio_driver.h> > + > +#include <asm/io.h> > + > +#define IntrStatus 0x04 > +#define IntrMask 0x00 > + > +struct ivshmem_info { > + struct uio_info *uio; > + struct pci_dev *dev; > + char (*msix_names)[256]; > + struct msix_entry *msix_entries; > + int nvectors; > +}; > + > +static irqreturn_t ivshmem_handler(int irq, struct uio_info *dev_info) > +{ > + > + void __iomem *plx_intscr = dev_info->mem[0].internal_addr > + + IntrStatus; > + u32 val; > + > + val = readl(plx_int...
2013 Jun 20
3
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
...tors = 0; vp_dev->msix_used_vectors = 0; kfree(vp_dev->msix_names); vp_dev->msix_names = NULL; @@ -309,6 +309,8 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, unsigned i, v; int err = -ENOMEM; + vp_dev->msix_vectors = nvectors; + vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, GFP_KERNEL); if (!vp_dev->msix_entries) @@ -336,7 +338,6 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, err = -ENOSPC; if (err) goto error; - vp_dev->msix_vectors = nvectors; vp_dev-...
2013 Jun 20
3
[PATCH] virtio-pci: fix leaks of msix_affinity_masks
...tors = 0; vp_dev->msix_used_vectors = 0; kfree(vp_dev->msix_names); vp_dev->msix_names = NULL; @@ -309,6 +309,8 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, unsigned i, v; int err = -ENOMEM; + vp_dev->msix_vectors = nvectors; + vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, GFP_KERNEL); if (!vp_dev->msix_entries) @@ -336,7 +338,6 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, err = -ENOSPC; if (err) goto error; - vp_dev->msix_vectors = nvectors; vp_dev-...