All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed
@ 2017-05-02  1:13 Guan Junxiong
  2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Guan Junxiong @ 2017-05-02  1:13 UTC (permalink / raw)


nvmf target shall return NVME_SC_CONNECT_INVALID_HOST instead of
the gereal code INVALID_PARAM when the given host nqn is not allowed
to connect. Refer to the 2.2.1 section of the NVMe over Fabrics Spec.
---
 drivers/nvme/target/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index fc5ba2f9..e6c5a47f 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -713,6 +713,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
 			hostnqn, subsysnqn);
 		req->rsp->result.u32 = IPO_IATTR_CONNECT_DATA(hostnqn);
 		up_read(&nvmet_config_sem);
+		status = NVME_SC_CONNECT_INVALID_HOST | NVME_SC_DNR;
 		goto out_put_subsystem;
 	}
 	up_read(&nvmet_config_sem);
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] nvmf: keep track of nvmet connect error status
  2017-05-02  1:13 [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Guan Junxiong
@ 2017-05-02  1:13 ` Guan Junxiong
  2017-05-02  8:17   ` Christoph Hellwig
  2017-05-03  7:54   ` Sagi Grimberg
  2017-05-02  8:16 ` [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Christoph Hellwig
  2017-05-03  7:54 ` Sagi Grimberg
  2 siblings, 2 replies; 6+ messages in thread
From: Guan Junxiong @ 2017-05-02  1:13 UTC (permalink / raw)


To let the host know what happends to the connection establishment,
adjust the behavior of nvmf_log_connect_error to make more connect
specifig error codes human-readble.
---
 drivers/nvme/host/fabrics.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 916d1360..1f315987 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -337,6 +337,24 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 			}
 		}
 		break;
+
+	case NVME_SC_CONNECT_INVALID_HOST:
+		dev_err(ctrl->device,
+				"Connect for subsystem %s is not allowed, hostnqn : %s\n",
+				data->subsysnqn, data->hostnqn);
+		break;
+
+	case NVME_SC_CONNECT_CTRL_BUSY:
+		dev_err(ctrl->device,
+				"Connect command failed : controller is busy or not available\n");
+		break;
+
+	case NVME_SC_CONNECT_FORMAT:
+		dev_err(ctrl->device,
+				"Connect incompatible format : %d",
+				cmd->connect.recfmt);
+		break;
+
 	default:
 		dev_err(ctrl->device,
 			"Connect command failed, error wo/DNR bit: %d\n",
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed
  2017-05-02  1:13 [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Guan Junxiong
  2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
@ 2017-05-02  8:16 ` Christoph Hellwig
  2017-05-03  7:54 ` Sagi Grimberg
  2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2017-05-02  8:16 UTC (permalink / raw)


Looks fine,

Reviewed-by: Christoph Hellwig <hch at lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] nvmf: keep track of nvmet connect error status
  2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
@ 2017-05-02  8:17   ` Christoph Hellwig
  2017-05-03  7:54   ` Sagi Grimberg
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2017-05-02  8:17 UTC (permalink / raw)


On Tue, May 02, 2017@09:13:15AM +0800, Guan Junxiong wrote:
> To let the host know what happends to the connection establishment,
> adjust the behavior of nvmf_log_connect_error to make more connect
> specifig error codes human-readble.

Looks fine (module a few indentation issue that can easily be fixed up
when applying).

Looks fine:

Reviewed-by: Christoph Hellwig <hch at lst.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed
  2017-05-02  1:13 [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Guan Junxiong
  2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
  2017-05-02  8:16 ` [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Christoph Hellwig
@ 2017-05-03  7:54 ` Sagi Grimberg
  2 siblings, 0 replies; 6+ messages in thread
From: Sagi Grimberg @ 2017-05-03  7:54 UTC (permalink / raw)


Looks good,

Reviewed-by: Sagi Grimbrg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] nvmf: keep track of nvmet connect error status
  2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
  2017-05-02  8:17   ` Christoph Hellwig
@ 2017-05-03  7:54   ` Sagi Grimberg
  1 sibling, 0 replies; 6+ messages in thread
From: Sagi Grimberg @ 2017-05-03  7:54 UTC (permalink / raw)


Looks good,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-03  7:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02  1:13 [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Guan Junxiong
2017-05-02  1:13 ` [PATCH 2/2] nvmf: keep track of nvmet connect error status Guan Junxiong
2017-05-02  8:17   ` Christoph Hellwig
2017-05-03  7:54   ` Sagi Grimberg
2017-05-02  8:16 ` [PATCH 1/2] nvmf: fix the return error code of target if host is not allowed Christoph Hellwig
2017-05-03  7:54 ` Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.