nvme-fabrics: allow duplicate connections to the discovery controller
authorHannes Reinecke <hare@suse.de>
Thu, 24 May 2018 14:18:17 +0000 (16:18 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 May 2018 14:50:12 +0000 (16:50 +0200)
The whole point of the discovery controller is that it can accept
multiple connections. Additionally the cmic field is not even defined for
the discovery controller identify page.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/fabrics.c

index dc8aa2c1c22ade11ff0998f146988d2e6f1a5129..fd206a6adad591f6b75de41e9d79c0e46a347cc0 100644 (file)
@@ -2184,7 +2184,8 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
                 * Verify that the subsystem actually supports multiple
                 * controllers, else bail out.
                 */
-               if (nvme_active_ctrls(found) && !(id->cmic & (1 << 1))) {
+               if (!ctrl->opts->discovery_nqn &&
+                   nvme_active_ctrls(found) && !(id->cmic & (1 << 1))) {
                        dev_err(ctrl->device,
                                "ignoring ctrl due to duplicate subnqn (%s).\n",
                                found->subnqn);
index 5ad6104577f0245a40679afda9b44a50edb1d9a7..8cb3d73e957dbe15333ba42d833e3b292fe24f34 100644 (file)
@@ -850,6 +850,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
        if (opts->discovery_nqn) {
                opts->kato = 0;
                opts->nr_io_queues = 0;
+               opts->duplicate_connect = true;
        }
        if (ctrl_loss_tmo < 0)
                opts->max_reconnects = -1;