svn commit: r325166 - head/sys/net

Stephen Hurd shurd at FreeBSD.org
Mon Oct 30 21:08:14 UTC 2017


Author: shurd
Date: Mon Oct 30 21:08:12 2017
New Revision: 325166
URL: https://svnweb.freebsd.org/changeset/base/325166

Log:
  Avoid enabling MSI-X if MSI-X is disabled globally
  
  It was reported on the community call that with
  hw.pci.enable_msix=0, iflib would enable MSI-X on the device and attempt
  to use it, which caused issues. Test the sysctl explicitly and do not
  enable MSI-X if it's disabled globally.
  
  Reviewed by:	sbruno
  Approved by:	sbruno (mentor)
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D12805

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Mon Oct 30 20:58:57 2017	(r325165)
+++ head/sys/net/iflib.c	Mon Oct 30 21:08:12 2017	(r325166)
@@ -5260,6 +5260,19 @@ iflib_msix_init(if_ctx_t ctx)
 	
 	bar = ctx->ifc_softc_ctx.isc_msix_bar;
 	admincnt = sctx->isc_admin_intrcnt;
+	/* Override by global tuneable */
+	{
+		int i;
+		size_t len = sizeof(i);
+		err = kernel_sysctlbyname(curthread, "hw.pci.enable_msix", &i, &len, NULL, 0, NULL, 0);
+		if (err == 0) {
+			if (i == 0)
+				goto msi;
+		}
+		else {
+			device_printf(dev, "unable to read hw.pci.enable_msix.");
+		}
+	}
 	/* Override by tuneable */
 	if (scctx->isc_disable_msix)
 		goto msi;


More information about the svn-src-all mailing list