Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2019 13:22:12 +0000 (UTC)
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348397 - head/sys/dev/ena
Message-ID:  <201905301322.x4UDMCxM066064@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mw
Date: Thu May 30 13:22:12 2019
New Revision: 348397
URL: https://svnweb.freebsd.org/changeset/base/348397

Log:
  Check for number of MSI-x upon partial allocation in ENA
  
  The ENA driver needs at least 2 MSI-x - one for admin queue, and one for
  IO queues pair. If there were not enough resources to allocate more than
  one MSI-x, the device should not be attached.
  
  Submitted by:  Michal Krawczyk <mk@semihalf.com>
  Obtained from: Semihalf
  Sponsored by:  Amazon, Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c	Thu May 30 13:20:42 2019	(r348396)
+++ head/sys/dev/ena/ena.c	Thu May 30 13:22:12 2019	(r348397)
@@ -1865,6 +1865,14 @@ ena_enable_msix(struct ena_adapter *adapter)
 	}
 
 	if (msix_vecs != msix_req) {
+		if (msix_vecs == ENA_ADMIN_MSIX_VEC) {
+			device_printf(dev,
+			    "Not enough number of MSI-x allocated: %d\n",
+			    msix_vecs);
+			pci_release_msi(dev);
+			rc = ENOSPC;
+			goto err_msix_free;
+		}
 		device_printf(dev, "Enable only %d MSI-x (out of %d), reduce "
 		    "the number of queues\n", msix_vecs, msix_req);
 		adapter->num_queues = msix_vecs - ENA_ADMIN_MSIX_VEC;



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