summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-08-20 00:22:39 +0000
committerjhb <jhb@FreeBSD.org>2016-08-20 00:22:39 +0000
commit8da6388522adcb02408e4d43045841ca31c4437f (patch)
tree08cc9083b440f5f2035710f44e3320d5439bec67
parentc79b77667f995d731fc154644168549853d1e586 (diff)
downloadFreeBSD-src-8da6388522adcb02408e4d43045841ca31c4437f.zip
FreeBSD-src-8da6388522adcb02408e4d43045841ca31c4437f.tar.gz
MFC 298950: Fix an off by one error when remapping MSI-X vectors.
pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value.
-rw-r--r--sys/dev/pci/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 4ceb075..d70aaad 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1744,7 +1744,7 @@ pci_remap_msix_method(device_t dev, device_t child, int count,
for (i = 0; i < count; i++) {
if (vectors[i] == 0)
continue;
- irq = msix->msix_vectors[vectors[i]].mv_irq;
+ irq = msix->msix_vectors[vectors[i] - 1].mv_irq;
resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq,
irq, 1);
}
@@ -1758,7 +1758,7 @@ pci_remap_msix_method(device_t dev, device_t child, int count,
printf("---");
else
printf("%d",
- msix->msix_vectors[vectors[i]].mv_irq);
+ msix->msix_vectors[vectors[i] - 1].mv_irq);
}
printf("\n");
}
OpenPOWER on IntegriCloud