From owner-svn-src-head@freebsd.org Mon Aug 20 04:50:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6126B1083013; Mon, 20 Aug 2018 04:50:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16C187A00D; Mon, 20 Aug 2018 04:50:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E769410971; Mon, 20 Aug 2018 04:50:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7K4oBpT099208; Mon, 20 Aug 2018 04:50:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7K4oBbN099207; Mon, 20 Aug 2018 04:50:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808200450.w7K4oBbN099207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 20 Aug 2018 04:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338088 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 338088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 04:50:12 -0000 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);