Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 17:27:21 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
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
Message-ID:  <201601111727.u0BHRLRP029963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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