Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 2016 16:09:57 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293325 - head/sys/dev/nvme
Message-ID:  <201601071609.u07G9v81050869@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jimharris
Date: Thu Jan  7 16:09:56 2016
New Revision: 293325
URL: https://svnweb.freebsd.org/changeset/base/293325

Log:
  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.
  
  MFC after:	3 days
  Sponsored by:	Intel

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Thu Jan  7 16:08:04 2016	(r293324)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Thu Jan  7 16:09:56 2016	(r293325)
@@ -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);
@@ -969,9 +967,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;
@@ -1002,7 +999,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 */
 	}
@@ -1020,7 +1016,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
@@ -1192,7 +1187,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: head/sys/dev/nvme/nvme_private.h
==============================================================================
--- head/sys/dev/nvme/nvme_private.h	Thu Jan  7 16:08:04 2016	(r293324)
+++ head/sys/dev/nvme/nvme_private.h	Thu Jan  7 16:09:56 2016	(r293325)
@@ -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?201601071609.u07G9v81050869>