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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to