From owner-svn-src-stable@freebsd.org Mon Jan 11 17:27:22 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44461A659A4; Mon, 11 Jan 2016 17:27:22 +0000 (UTC) (envelope-from jimharris@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 mx1.freebsd.org (Postfix) with ESMTPS id 07D2611C0; Mon, 11 Jan 2016 17:27:21 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BHRLHL029965; Mon, 11 Jan 2016 17:27:21 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BHRLRP029963; Mon, 11 Jan 2016 17:27:21 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601111727.u0BHRLRP029963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Mon, 11 Jan 2016 17:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293668 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 17:27:22 -0000 Author: jimharris Date: Mon Jan 11 17:27:20 2016 New Revision: 293668 URL: https://svnweb.freebsd.org/changeset/base/293668 Log: MFC r293325: nvme: remove per_cpu_io_queues from struct nvme_controller Instead just use num_io_queues to make this determination. This prepares for some future changes enabling use of multiple queues when we do not have enough queues or MSI-X vectors for one queue per CPU. Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c stable/10/sys/dev/nvme/nvme_private.h Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Mon Jan 11 17:26:06 2016 (r293667) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Mon Jan 11 17:27:20 2016 (r293668) @@ -160,7 +160,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv num_trackers, ctrlr); - if (ctrlr->per_cpu_io_queues) + if (ctrlr->num_io_queues > 1) bus_bind_intr(ctrlr->dev, qpair->res, i); } @@ -402,7 +402,6 @@ nvme_ctrlr_set_num_qpairs(struct nvme_co nvme_io_qpair_destroy(&ctrlr->ioq[i]); ctrlr->num_io_queues = 1; - ctrlr->per_cpu_io_queues = 0; } return (0); @@ -779,7 +778,6 @@ nvme_ctrlr_configure_intx(struct nvme_co { ctrlr->num_io_queues = 1; - ctrlr->per_cpu_io_queues = 0; ctrlr->rid = 0; ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); @@ -970,9 +968,8 @@ nvme_ctrlr_construct(struct nvme_control per_cpu_io_queues = 1; TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues); - ctrlr->per_cpu_io_queues = per_cpu_io_queues ? TRUE : FALSE; - if (ctrlr->per_cpu_io_queues) + if (per_cpu_io_queues) ctrlr->num_io_queues = mp_ncpus; else ctrlr->num_io_queues = 1; @@ -1003,7 +1000,6 @@ nvme_ctrlr_construct(struct nvme_control } if (pci_msix_count(dev) < num_vectors_requested) { - ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; num_vectors_requested = 2; /* one for admin, one for I/O */ } @@ -1021,7 +1017,6 @@ nvme_ctrlr_construct(struct nvme_control goto intx; } - ctrlr->per_cpu_io_queues = FALSE; ctrlr->num_io_queues = 1; /* * Release whatever vectors were allocated, and just @@ -1193,7 +1188,7 @@ nvme_ctrlr_submit_io_request(struct nvme { struct nvme_qpair *qpair; - if (ctrlr->per_cpu_io_queues) + if (ctrlr->num_io_queues > 1) qpair = &ctrlr->ioq[curcpu]; else qpair = &ctrlr->ioq[0]; Modified: stable/10/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/10/sys/dev/nvme/nvme_private.h Mon Jan 11 17:26:06 2016 (r293667) +++ stable/10/sys/dev/nvme/nvme_private.h Mon Jan 11 17:27:20 2016 (r293668) @@ -265,7 +265,6 @@ struct nvme_controller { uint32_t enable_aborts; uint32_t num_io_queues; - boolean_t per_cpu_io_queues; /* Fields for tracking progress during controller initialization. */ struct intr_config_hook config_hook;