Displaying 20 results from an estimated 59 matches for "error_find".
2017 Jan 27
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
...ty_masks;
+
+ /* Set the vector used for configuration */
+ snprintf(vp_dev->msix_names[0], sizeof(*vp_dev->msix_names),
+ "%s-config", name);
+ err = request_irq(pci_irq_vector(vp_dev->pci_dev, 0), vp_config_changed,
+ 0, vp_dev->msix_names[0], vp_dev);
if (err)
- goto error_find;
+ goto out_free_irq_vectors;
- if (per_vq_vectors) {
- vp_dev->msix_vector_map = kmalloc_array(nvqs,
- sizeof(*vp_dev->msix_vector_map), GFP_KERNEL);
- if (!vp_dev->msix_vector_map)
- goto error_find;
+ /* Verify we had enough resources to assign the vector */
+ if (vp_dev->c...
2017 Feb 05
0
[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues
...asks;
+ }
+
+ /* Set the vector used for configuration */
+ snprintf(vp_dev->msix_names[0], sizeof(*vp_dev->msix_names),
+ "%s-config", name);
+ err = request_irq(pci_irq_vector(vp_dev->pci_dev, 0), vp_config_changed,
+ 0, vp_dev->msix_names[0], vp_dev);
if (err)
- goto error_find;
+ goto out_free_irq_vectors;
- if (per_vq_vectors) {
- vp_dev->msix_vector_map = kmalloc_array(nvqs,
- sizeof(*vp_dev->msix_vector_map), GFP_KERNEL);
- if (!vp_dev->msix_vector_map)
- goto error_find;
+ /* Verify we had enough resources to assign the vector */
+ if (vp_dev->c...
2014 Dec 08
0
[PATCH v2 03/10] virtio_pci: free up vq->priv
...s, allocated_vectors;
+ vp_dev->vqs = kmalloc(nvqs * sizeof *vp_dev->vqs, GFP_KERNEL);
+ if (!vp_dev->vqs)
+ return -ENOMEM;
+
if (!use_msix) {
/* Old style: one normal interrupt for change and all vqs. */
err = vp_request_intx(vdev);
if (err)
- goto error_request;
+ goto error_find;
} else {
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
@@ -545,7 +553,7 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors);
if (err)
- goto error_request;
+...
2014 Dec 08
0
[PATCH v2 03/10] virtio_pci: free up vq->priv
...s, allocated_vectors;
+ vp_dev->vqs = kmalloc(nvqs * sizeof *vp_dev->vqs, GFP_KERNEL);
+ if (!vp_dev->vqs)
+ return -ENOMEM;
+
if (!use_msix) {
/* Old style: one normal interrupt for change and all vqs. */
err = vp_request_intx(vdev);
if (err)
- goto error_request;
+ goto error_find;
} else {
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
@@ -545,7 +553,7 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors);
if (err)
- goto error_request;
+...
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
>
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.
2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...names[i]) {
>> + vqs[i] = NULL;
>> + continue;
>> + }
>> vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i]);
>> if (IS_ERR(vqs[i])) {
>> - vm_del_vqs(vdev);
>> - return PTR_ERR(vqs[i]);
>> + err = PTR_ERR(vqs[i]);
>> + goto error_find;
>> + }
>> + if (!per_vq_irq || !callbacks[i])
>> + continue;
>> + /* allocate per-vq irq if available and necessary */
>> + snprintf(vm_dev->vm_vq_names[vm_dev->used_irqs],
>> + sizeof(*vm_dev->vm_vq_names),
>> + "%s-%s",
>&...
2014 Nov 06
2
[RFC PATCH] virtio-mmio: support for multiple irqs
...names[i]) {
>> + vqs[i] = NULL;
>> + continue;
>> + }
>> vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i]);
>> if (IS_ERR(vqs[i])) {
>> - vm_del_vqs(vdev);
>> - return PTR_ERR(vqs[i]);
>> + err = PTR_ERR(vqs[i]);
>> + goto error_find;
>> + }
>> + if (!per_vq_irq || !callbacks[i])
>> + continue;
>> + /* allocate per-vq irq if available and necessary */
>> + snprintf(vm_dev->vm_vq_names[vm_dev->used_irqs],
>> + sizeof(*vm_dev->vm_vq_names),
>> + "%s-%s",
>&...
2017 Jan 27
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL);
- if (!vp_dev->vqs)
- return -ENOMEM;
-
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
nvectors = 1;
@@ -294,7 +237,13 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
if (err)
goto error_find;
- vp_dev->per_vq_vectors = per_vq_vectors;
+ if (per_vq_vectors) {
+ vp_dev->msix_vector_map = kmalloc_array(nvqs,
+ sizeof(*vp_dev->msix_vector_map), GFP_KERNEL);
+ if (!vp_dev->msix_vector_map)
+ goto error_find;
+ }
+
allocated_vectors = vp_dev->msix_used_vectors;
fo...
2017 Feb 05
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL);
- if (!vp_dev->vqs)
- return -ENOMEM;
-
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
nvectors = 1;
@@ -294,7 +237,13 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
if (err)
goto error_find;
- vp_dev->per_vq_vectors = per_vq_vectors;
+ if (per_vq_vectors) {
+ vp_dev->msix_vector_map = kmalloc_array(nvqs,
+ sizeof(*vp_dev->msix_vector_map), GFP_KERNEL);
+ if (!vp_dev->msix_vector_map)
+ goto error_find;
+ }
+
allocated_vectors = vp_dev->msix_used_vectors;
fo...
2017 Feb 07
0
[PATCH 1/9] virtio_pci: remove struct virtio_pci_vq_info
...nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL);
- if (!vp_dev->vqs)
- return -ENOMEM;
-
if (per_vq_vectors) {
/* Best option: one for change interrupt, one per vq. */
nvectors = 1;
@@ -294,7 +237,13 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
if (err)
goto error_find;
- vp_dev->per_vq_vectors = per_vq_vectors;
+ if (per_vq_vectors) {
+ vp_dev->msix_vector_map = kmalloc_array(nvqs,
+ sizeof(*vp_dev->msix_vector_map), GFP_KERNEL);
+ if (!vp_dev->msix_vector_map)
+ goto error_find;
+ }
+
allocated_vectors = vp_dev->msix_used_vectors;
fo...
2014 Nov 06
0
[RFC PATCH] virtio-mmio: support for multiple irqs
...0; i < nvqs; i++) {
> + if (!names[i]) {
> + vqs[i] = NULL;
> + continue;
> + }
> vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i]);
> if (IS_ERR(vqs[i])) {
> - vm_del_vqs(vdev);
> - return PTR_ERR(vqs[i]);
> + err = PTR_ERR(vqs[i]);
> + goto error_find;
> + }
> + if (!per_vq_irq || !callbacks[i])
> + continue;
> + /* allocate per-vq irq if available and necessary */
> + snprintf(vm_dev->vm_vq_names[vm_dev->used_irqs],
> + sizeof(*vm_dev->vm_vq_names),
> + "%s-%s",
> + dev_name(&vm_dev->...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...!vp_dev->msix_enabled)
+ vector = VIRTIO_MSI_NO_VECTOR;
+ else if (vp_dev->per_vq_vectors)
+ vector = allocated_vectors++;
+ else
+ vector = VP_MSIX_VQ_VECTOR;
+ vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i], vector);
+ if (IS_ERR(vqs[i])) {
+ err = PTR_ERR(vqs[i]);
goto error_find;
+ }
+ /* allocate per-vq irq if available and necessary */
+ if (vp_dev->per_vq_vectors && vector != VIRTIO_MSI_NO_VECTOR) {
+ snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
+ "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]);
+ err = re...
2009 Jul 26
0
[PATCHv3 2/2] virtio: refactor find_vqs
...!vp_dev->msix_enabled)
+ vector = VIRTIO_MSI_NO_VECTOR;
+ else if (vp_dev->per_vq_vectors)
+ vector = allocated_vectors++;
+ else
+ vector = VP_MSIX_VQ_VECTOR;
+ vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i], vector);
+ if (IS_ERR(vqs[i])) {
+ err = PTR_ERR(vqs[i]);
goto error_find;
+ }
+ /* allocate per-vq irq if available and necessary */
+ if (vp_dev->per_vq_vectors && vector != VIRTIO_MSI_NO_VECTOR) {
+ snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
+ "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]);
+ err = re...
2009 Jun 01
2
find_vqs operation starting at arbitrary index
...,8 @@ static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
goto error_request;
for (i = 0; i < nvqs; ++i) {
- vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i]);
+ vqs[i] = vp_find_vq(vdev, start_index + i, callbacks[i],
+ names[i]);
if (IS_ERR(vqs[i]))
goto error_find;
}
Amit
2009 Jun 01
2
find_vqs operation starting at arbitrary index
...,8 @@ static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
goto error_request;
for (i = 0; i < nvqs; ++i) {
- vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i]);
+ vqs[i] = vp_find_vq(vdev, start_index + i, callbacks[i],
+ names[i]);
if (IS_ERR(vqs[i]))
goto error_find;
}
Amit
2009 Jul 26
1
[PATCHv4 2/2] virtio: refactor find_vqs
...!vp_dev->msix_enabled)
+ vector = VIRTIO_MSI_NO_VECTOR;
+ else if (vp_dev->per_vq_vectors)
+ vector = allocated_vectors++;
+ else
+ vector = VP_MSIX_VQ_VECTOR;
+ vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i], vector);
+ if (IS_ERR(vqs[i])) {
+ err = PTR_ERR(vqs[i]);
goto error_find;
+ }
+ /* allocate per-vq irq if available and necessary */
+ if (vp_dev->per_vq_vectors && vector != VIRTIO_MSI_NO_VECTOR) {
+ snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
+ "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]);
+ err = re...
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