Displaying 20 results from an estimated 40 matches for "pci_irq_msix".
2017 Jan 27
0
[PATCH 4/9] virtio_pci: simplify MSI-X setup
...ks[i])
-				++nvectors;
-	} else {
-		/* Second best: one for change, shared for all vqs. */
+	nvectors = 1;
+	for (i = 0; i < nvqs; i++) {
+		if (callbacks[i])
+			nvectors++;
+	}
+
+	/* Try one vector per queue first. */
+	err = pci_alloc_irq_vectors(vp_dev->pci_dev, nvectors, nvectors,
+			PCI_IRQ_MSIX);
+	if (err < 0) {
+		/* Fallback to one vector for config, one shared for queues. */
+		shared = true;
 		nvectors = 2;
+		err = pci_alloc_irq_vectors(vp_dev->pci_dev, nvectors, nvectors,
+				PCI_IRQ_MSIX);
+		if (err < 0)
+			return err;
 	}
 
 	vp_dev->msix_vectors = nvectors;
 	vp_...
2017 Feb 05
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
...finity_masks,
-			  GFP_KERNEL);
-	if (!vp_dev->msix_affinity_masks)
-		goto error;
-	for (i = 0; i < nvectors; ++i)
-		if (!alloc_cpumask_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->p...
2020 May 13
0
[PATCH V2] ifcvf: move IRQ request/free to status change handlers
...+
> +static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
> +{
> +	struct pci_dev *pdev = adapter->pdev;
> +	struct ifcvf_hw *vf = &adapter->vf;
> +	int vector, i, ret, irq;
> +
> +	ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
> +				    IFCVF_MAX_INTR, PCI_IRQ_MSIX);
> +	if (ret < 0) {
> +		IFCVF_ERR(pdev, "Failed to alloc IRQ vectors\n");
> +		return ret;
> +	}
> +
> +	for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> +		snprintf(vf->vring[i].msix_name, 256, "ifcvf[%s]-%d\n",
> +			 pci_name(pdev), i);
&...
2020 May 11
0
[PATCH] ifcvf: move IRQ request/free to status change handlers
...+
> +static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
> +{
> +	struct pci_dev *pdev = adapter->pdev;
> +	struct ifcvf_hw *vf = &adapter->vf;
> +	int vector, i, ret, irq;
> +
> +	ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
> +				    IFCVF_MAX_INTR, PCI_IRQ_MSIX);
> +	if (ret < 0) {
> +		IFCVF_ERR(pdev, "Failed to alloc IRQ vectors\n");
> +		return ret;
> +	}
> +
> +	for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
> +		snprintf(vf->vring[i].msix_name, 256, "ifcvf[%s]-%d\n",
> +			 pci_name(pdev), i);
&...
2017 Mar 23
2
[REGRESSION] 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues") causes crashes in guest
...ce *vdev, unsigned nvqs,
>  {
>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>  	const char *name = dev_name(&vp_dev->vdev.dev);
> -	int i, err = -ENOMEM, allocated_vectors, nvectors;
> +	int i, j, err = -ENOMEM, allocated_vectors, nvectors;
>  	unsigned flags = PCI_IRQ_MSIX;
>  	bool shared = false;
>  	u16 msix_vec;
> @@ -212,7 +212,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
>  	if (!vp_dev->msix_vector_map)
>  		goto out_disable_config_irq;
>  
> -	allocated_vectors = 1; /* vector 0 is the config interrupt */...
2017 Mar 23
2
[REGRESSION] 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues") causes crashes in guest
...ce *vdev, unsigned nvqs,
>  {
>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>  	const char *name = dev_name(&vp_dev->vdev.dev);
> -	int i, err = -ENOMEM, allocated_vectors, nvectors;
> +	int i, j, err = -ENOMEM, allocated_vectors, nvectors;
>  	unsigned flags = PCI_IRQ_MSIX;
>  	bool shared = false;
>  	u16 msix_vec;
> @@ -212,7 +212,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
>  	if (!vp_dev->msix_vector_map)
>  		goto out_disable_config_irq;
>  
> -	allocated_vectors = 1; /* vector 0 is the config interrupt */...
2017 Feb 05
13
automatic IRQ affinity for virtio V3
Hi Michael, hi Jason,
This patches applies a few cleanups to the virtio PCI interrupt handling
code, and then converts the virtio PCI code to use the automatic MSI-X
vectors spreading, as well as using the information in virtio-blk
and virtio-scsi to automatically align the blk-mq queues to the MSI-X
vectors.
Changes since V2:
 - remove a redundant callback check
 - calculate ->msix_vectors
2017 Feb 05
13
automatic IRQ affinity for virtio V3
Hi Michael, hi Jason,
This patches applies a few cleanups to the virtio PCI interrupt handling
code, and then converts the virtio PCI code to use the automatic MSI-X
vectors spreading, as well as using the information in virtio-blk
and virtio-scsi to automatically align the blk-mq queues to the MSI-X
vectors.
Changes since V2:
 - remove a redundant callback check
 - calculate ->msix_vectors
2016 Nov 17
13
automatic IRQ affinity for virtio
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, and support for automatic affinity by the PCI layer if the
consumers ask for it.  It then converts over virtio_blk to use this
functionality so that it's blk-mq queues are aligned to the MSI-X
vector routing.  I have a similar patch in the
2016 Nov 17
13
automatic IRQ affinity for virtio
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, and support for automatic affinity by the PCI layer if the
consumers ask for it.  It then converts over virtio_blk to use this
functionality so that it's blk-mq queues are aligned to the MSI-X
vector routing.  I have a similar patch in the
2020 May 12
1
[PATCH] ifcvf: move IRQ request/free to status change handlers
...+{
>>> +??? struct pci_dev *pdev = adapter->pdev;
>>> +??? struct ifcvf_hw *vf = &adapter->vf;
>>> +??? int vector, i, ret, irq;
>>> +
>>> +??? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
>>> +??????????????????? IFCVF_MAX_INTR, PCI_IRQ_MSIX);
>>> +??? if (ret < 0) {
>>> +??????? IFCVF_ERR(pdev, "Failed to alloc IRQ vectors\n");
>>> +??????? return ret;
>>> +??? }
>>> +
>>> +??? for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
>>> +??????? snprintf(vf->v...
2017 Jan 27
15
automatic IRQ affinity for virtio V2
Hi Michael, hi Jason,
This patches applies a few cleanups to the virtio PCI interrupt handling
code, and then converts the virtio PCI code to use the automatic MSI-X
vectors spreading, as well as using the information in virtio-blk
and virtio-scsi to automatically align the blk-mq queues to the MSI-X
vectors.
Changes since V1:
 - dropped the patches already merged for 4.10-rc
 - new patch to
2017 Jan 27
15
automatic IRQ affinity for virtio V2
Hi Michael, hi Jason,
This patches applies a few cleanups to the virtio PCI interrupt handling
code, and then converts the virtio PCI code to use the automatic MSI-X
vectors spreading, as well as using the information in virtio-blk
and virtio-scsi to automatically align the blk-mq queues to the MSI-X
vectors.
Changes since V1:
 - dropped the patches already merged for 4.10-rc
 - new patch to
2017 Jan 27
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
...finity_masks,
-			  GFP_KERNEL);
-	if (!vp_dev->msix_affinity_masks)
-		goto error;
-	for (i = 0; i < nvectors; ++i)
-		if (!alloc_cpumask_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->p...
2017 Mar 23
0
[REGRESSION] 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues") causes crashes in guest
...>  {
> >  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
> >  	const char *name = dev_name(&vp_dev->vdev.dev);
> > -	int i, err = -ENOMEM, allocated_vectors, nvectors;
> > +	int i, j, err = -ENOMEM, allocated_vectors, nvectors;
> >  	unsigned flags = PCI_IRQ_MSIX;
> >  	bool shared = false;
> >  	u16 msix_vec;
> > @@ -212,7 +212,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
> >  	if (!vp_dev->msix_vector_map)
> >  		goto out_disable_config_irq;
> >  
> > -	allocated_vectors = 1; /* v...
2020 May 12
0
[PATCH] ifcvf: move IRQ request/free to status change handlers
...+{
>>> +??? struct pci_dev *pdev = adapter->pdev;
>>> +??? struct ifcvf_hw *vf = &adapter->vf;
>>> +??? int vector, i, ret, irq;
>>> +
>>> +??? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR,
>>> +??????????????????? IFCVF_MAX_INTR, PCI_IRQ_MSIX);
>>> +??? if (ret < 0) {
>>> +??????? IFCVF_ERR(pdev, "Failed to alloc IRQ vectors\n");
>>> +??????? return ret;
>>> +??? }
>>> +
>>> +??? for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
>>> +??????? snprintf(vf->v...
2017 Jan 27
0
[PATCH 5/9] virtio: allow drivers to request IRQ affinity when creating VQs
...lback_t *callbacks[],
-		const char * const names[])
+		const char * const names[], struct irq_affinity *desc)
 {
 	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
 	const char *name = dev_name(&vp_dev->vdev.dev);
 	int i, err = -ENOMEM, allocated_vectors, nvectors;
+	unsigned flags = PCI_IRQ_MSIX;
 	bool shared = false;
 	u16 msix_vec;
 
+	if (desc) {
+		flags |= PCI_IRQ_AFFINITY;
+		desc->pre_vectors++; /* virtio config vector */
+	}
+
 	nvectors = 1;
 	for (i = 0; i < nvqs; i++) {
 		if (callbacks[i])
@@ -158,8 +164,8 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsign...
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review
 - heavily reworked NET_F_MAC patch, matches recent PR-68875
 - reordered to put "clean and reset vqs" before "alloc-irq"
   to make them slightly simpler patches
 - other minor cleanups for simpler patches
These are some fixes for device providing a MAC address, for allocating
irq resources later to support vhost use, and for properly cleaning
vq info
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review
 - heavily reworked NET_F_MAC patch, matches recent PR-68875
 - reordered to put "clean and reset vqs" before "alloc-irq"
   to make them slightly simpler patches
 - other minor cleanups for simpler patches
These are some fixes for device providing a MAC address, for allocating
irq resources later to support vhost use, and for properly cleaning
vq info
2017 Mar 23
3
[REGRESSION] 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues") causes crashes in guest
Hi,
Fedora has received multiple reports of crashes when running
4.11 as a guest
https://bugzilla.redhat.com/show_bug.cgi?id=1430297
https://bugzilla.redhat.com/show_bug.cgi?id=1434462
https://bugzilla.kernel.org/show_bug.cgi?id=194911
https://bugzilla.redhat.com/show_bug.cgi?id=1433899
The crashes are not always consistent but they are generally
some flavor of oops or GPF in virtio related