linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] nvmet: fix PSDT field check in command format
@ 2018-01-24 15:31 Max Gurtovoy
  2018-02-27 23:42 ` Max Gurtovoy
  2018-02-28 17:00 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Max Gurtovoy @ 2018-01-24 15:31 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>
---

Changes from v1:
 - use tabs for comment indentation

---
 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 0bd7371..a78029e 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -520,9 +520,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] 4+ messages in thread

* [PATCH v2 1/1] nvmet: fix PSDT field check in command format
  2018-01-24 15:31 [PATCH v2 1/1] nvmet: fix PSDT field check in command format Max Gurtovoy
@ 2018-02-27 23:42 ` Max Gurtovoy
  2018-02-28 17:00 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Max Gurtovoy @ 2018-02-27 23:42 UTC (permalink / raw)


ping :)

On 1/24/2018 5:31 PM, Max Gurtovoy wrote:
> 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>
> ---
> 
> Changes from v1:
>   - use tabs for comment indentation
> 
> ---
>   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 0bd7371..a78029e 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -520,9 +520,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;
>   	}
> 

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

* [PATCH v2 1/1] nvmet: fix PSDT field check in command format
  2018-01-24 15:31 [PATCH v2 1/1] nvmet: fix PSDT field check in command format Max Gurtovoy
  2018-02-27 23:42 ` Max Gurtovoy
@ 2018-02-28 17:00 ` Christoph Hellwig
  2018-02-28 17:11   ` Keith Busch
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2018-02-28 17:00 UTC (permalink / raw)


Looks fine,

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

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

* [PATCH v2 1/1] nvmet: fix PSDT field check in command format
  2018-02-28 17:00 ` Christoph Hellwig
@ 2018-02-28 17:11   ` Keith Busch
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2018-02-28 17:11 UTC (permalink / raw)


Thanks, applied.

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

end of thread, other threads:[~2018-02-28 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24 15:31 [PATCH v2 1/1] nvmet: fix PSDT field check in command format Max Gurtovoy
2018-02-27 23:42 ` Max Gurtovoy
2018-02-28 17:00 ` Christoph Hellwig
2018-02-28 17:11   ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).