aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2018-03-05 14:59:53 -0500
committerKeith Busch <keith.busch@intel.com>2018-03-08 11:19:17 -0500
commit0475821e229cfd9954b7501113d1acbc57b68689 (patch)
treefdf813d8b60669383cff0a9e92752ea91e763552 /drivers
parent8a30ecc6e0ecbb9ae95daf499b2680b885ed0349 (diff)
nvme-fabrics: Ignore nr_io_queues option for discovery controllers
This removes a dependency on the order options are passed when creating a fabrics controller. With the old code, if "nr_io_queues" appears before an "nqn" option specifying the discovery controller, then nr_io_queues is overridden with zero. If "nr_io_queues" appears after specifying the discovery controller, then the nr_io_queues option is used to set the number of queues, and the driver attempts to establish IO connections to the discovery controller (which doesn't work). It seems better to ignore (and warn about) the "nr_io_queues" option if userspace has already asked to connect to the discovery controller. Signed-off-by: Roland Dreier <roland@purestorage.com> Reviewed-by: James Smart <james.smart@broadcom.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/fabrics.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index a1c58e35075e..8f0f34d06d46 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -650,6 +650,11 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
650 ret = -EINVAL; 650 ret = -EINVAL;
651 goto out; 651 goto out;
652 } 652 }
653 if (opts->discovery_nqn) {
654 pr_debug("Ignoring nr_io_queues value for discovery controller\n");
655 break;
656 }
657
653 opts->nr_io_queues = min_t(unsigned int, 658 opts->nr_io_queues = min_t(unsigned int,
654 num_online_cpus(), token); 659 num_online_cpus(), token);
655 break; 660 break;