Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Aug 2016 00:22:40 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r304511 - in stable: 10/sys/dev/pci 8/sys/dev/pci 9/sys/dev/pci
Message-ID:  <201608200022.u7K0MesG077140@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Sat Aug 20 00:22:39 2016
New Revision: 304511
URL: https://svnweb.freebsd.org/changeset/base/304511

Log:
  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.

Modified:
  stable/9/sys/dev/pci/pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/pci/pci.c
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/10/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/pci/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==============================================================================
--- stable/9/sys/dev/pci/pci.c	Sat Aug 20 00:08:10 2016	(r304510)
+++ stable/9/sys/dev/pci/pci.c	Sat Aug 20 00:22:39 2016	(r304511)
@@ -1660,7 +1660,7 @@ pci_remap_msix_method(device_t dev, devi
 	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);
 	}
@@ -1674,7 +1674,7 @@ pci_remap_msix_method(device_t dev, devi
 				printf("---");
 			else
 				printf("%d",
-				    msix->msix_vectors[vectors[i]].mv_irq);
+				    msix->msix_vectors[vectors[i] - 1].mv_irq);
 		}
 		printf("\n");
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608200022.u7K0MesG077140>