Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2018 04:50:11 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338088 - head/usr.sbin/bhyve
Message-ID:  <201808200450.w7K4oBbN099207@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Mon Aug 20 04:50:11 2018
New Revision: 338088
URL: https://svnweb.freebsd.org/changeset/base/338088

Log:
  Users must set the number of queues from 1 to maximum 16 queues.
  
  Sponsored by:	iXsystems Inc.

Modified:
  head/usr.sbin/bhyve/pci_nvme.c

Modified: head/usr.sbin/bhyve/pci_nvme.c
==============================================================================
--- head/usr.sbin/bhyve/pci_nvme.c	Mon Aug 20 04:44:29 2018	(r338087)
+++ head/usr.sbin/bhyve/pci_nvme.c	Mon Aug 20 04:50:11 2018	(r338088)
@@ -373,9 +373,8 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc)
 	sc->regs.cc = 0;
 	sc->regs.csts = 0;
 
+	sc->num_cqueues = sc->num_squeues = sc->max_queues;
 	if (sc->submit_queues != NULL) {
-		sc->num_cqueues = sc->num_squeues = sc->max_queues;
-
 		for (int i = 0; i <= sc->max_queues; i++) {
 			/*
 			 * The Admin Submission Queue is at index 0.
@@ -1765,10 +1764,9 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o
 	     (1 << sc->nvstore.sectsz_bits) < sc->nvstore.sectsz;
 	     sc->nvstore.sectsz_bits++);
 
-	if (sc->max_queues == 0) {
-		fprintf(stderr, "Invalid maxq option\n");
-		return (-1);
-	}
+	if (sc->max_queues <= 0 || sc->max_queues > NVME_QUEUES)
+		sc->max_queues = NVME_QUEUES;
+
 	if (sc->max_qentries <= 0) {
 		fprintf(stderr, "Invalid qsz option\n");
 		return (-1);



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