Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2012 22:13:11 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232367 - head/sys/dev/e1000
Message-ID:  <201203012213.q21MDBg4099034@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Mar  1 22:13:10 2012
New Revision: 232367
URL: http://svn.freebsd.org/changeset/base/232367

Log:
  Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
  allocation fails.
  
  Reviewed by:	jfv
  MFC after:	2 weeks

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Thu Mar  1 21:23:26 2012	(r232366)
+++ head/sys/dev/e1000/if_igb.c	Thu Mar  1 22:13:10 2012	(r232367)
@@ -2711,7 +2711,7 @@ igb_setup_msix(struct adapter *adapter)
 		    "MSIX Configuration Problem, "
 		    "%d vectors configured, but %d queues wanted!\n",
 		    msgs, want);
-		return (ENXIO);
+		return (0);
 	}
 	if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) {
                	device_printf(adapter->dev,
@@ -2721,9 +2721,11 @@ igb_setup_msix(struct adapter *adapter)
 	}
 msi:
        	msgs = pci_msi_count(dev);
-       	if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0)
-               	device_printf(adapter->dev,"Using MSI interrupt\n");
-	return (msgs);
+	if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) {
+		device_printf(adapter->dev," Using MSI interrupt\n");
+		return (msgs);
+	}
+	return (0);
 }
 
 /*********************************************************************



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