All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] nvmet: fix PSDT field check in command format
@ 2018-01-17 17:06 Max Gurtovoy
  2018-01-18 10:37 ` Minwoo Im
  0 siblings, 1 reply; 2+ messages in thread
From: Max Gurtovoy @ 2018-01-17 17:06 UTC (permalink / raw)


PSDT field section according to NVM_Express-1.3:
"This field specifies whether PRPs or SGLs are used for any data
transfer associated with the command. PRPs shall be used for all
Admin commands for NVMe over PCIe. SGLs shall be used for all Admin
and I/O commands for NVMe over Fabrics. This field shall be set to
01b for NVMe over Fabrics 1.0 implementations.

Suggested-by: Idan Burstein <idanb at mellanox.com>
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/target/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index ab3a247..438e0ba 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -523,9 +523,12 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
 		goto fail;
 	}
 
-	/* either variant of SGLs is fine, as we don't support metadata */
-	if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF &&
-		     (flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METASEG)) {
+	/*
+         * For fabrics, PSDT field shall describe metadata pointer (MPTR) that
+         * contains an address of a single contiguous physical buffer that is
+         * byte aligned.
+         */
+	if (unlikely((flags & NVME_CMD_SGL_ALL) != NVME_CMD_SGL_METABUF)) {
 		status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
 		goto fail;
 	}
-- 
1.8.3.1

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

* [PATCH 1/1] nvmet: fix PSDT field check in command format
  2018-01-17 17:06 [PATCH 1/1] nvmet: fix PSDT field check in command format Max Gurtovoy
@ 2018-01-18 10:37 ` Minwoo Im
  0 siblings, 0 replies; 2+ messages in thread
From: Minwoo Im @ 2018-01-18 10:37 UTC (permalink / raw)


On Thu, Jan 18, 2018@2:06 AM, Max Gurtovoy <maxg@mellanox.com> wrote:
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index ab3a247..438e0ba 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -523,9 +523,12 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,

> +       /*
> +         * For fabrics, PSDT field shall describe metadata pointer (MPTR) that
> +         * contains an address of a single contiguous physical buffer that is
> +         * byte aligned.
> +         */

Hi Max,

Indentation of lines except the first one seems starts with
whitespaces instead of tab.

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

end of thread, other threads:[~2018-01-18 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 17:06 [PATCH 1/1] nvmet: fix PSDT field check in command format Max Gurtovoy
2018-01-18 10:37 ` Minwoo Im

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.