All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] hw/nvme: Return error for fused operations
       [not found] <CGME20210915154333eucas1p2baf6aabb3bd0325233dae156f8bbbb32@eucas1p2.samsung.com>
@ 2021-09-15 15:43 ` Pankaj Raghav
  2021-09-15 15:55   ` Keith Busch
  2021-09-23 20:26   ` Klaus Jensen
  0 siblings, 2 replies; 3+ messages in thread
From: Pankaj Raghav @ 2021-09-15 15:43 UTC (permalink / raw)
  To: kbusch, its, qemu-block; +Cc: qemu-devel

Currently, FUSED operations are not supported by QEMU. As per the 1.4 SPEC,
controller should abort the command that requested a fused operation with 
an INVALID FIELD error code if they are not supported.

Changes from v1:
Added FUSE flag check also to the admin cmd processing as the FUSED 
operations are mentioned in the general SQE section in the SPEC. 

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 hw/nvme/ctrl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index dc0e7b0030..2f247a9275 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -3893,6 +3893,10 @@ static uint16_t nvme_io_cmd(NvmeCtrl *n, NvmeRequest *req)
         return ns->status;
     }
 
+    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
+        return NVME_INVALID_FIELD;
+    }
+
     req->ns = ns;
 
     switch (req->cmd.opcode) {
@@ -5475,6 +5479,10 @@ static uint16_t nvme_admin_cmd(NvmeCtrl *n, NvmeRequest *req)
         return NVME_INVALID_FIELD | NVME_DNR;
     }
 
+    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
+        return NVME_INVALID_FIELD;
+    }
+
     switch (req->cmd.opcode) {
     case NVME_ADM_CMD_DELETE_SQ:
         return nvme_del_sq(n, req);
-- 
2.25.1


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

* Re: [PATCH v2] hw/nvme: Return error for fused operations
  2021-09-15 15:43 ` [PATCH v2] hw/nvme: Return error for fused operations Pankaj Raghav
@ 2021-09-15 15:55   ` Keith Busch
  2021-09-23 20:26   ` Klaus Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2021-09-15 15:55 UTC (permalink / raw)
  To: Pankaj Raghav; +Cc: its, qemu-devel, qemu-block

On Wed, Sep 15, 2021 at 05:43:30PM +0200, Pankaj Raghav wrote:
> Currently, FUSED operations are not supported by QEMU. As per the 1.4 SPEC,
> controller should abort the command that requested a fused operation with 
> an INVALID FIELD error code if they are not supported.
> 
> Changes from v1:
> Added FUSE flag check also to the admin cmd processing as the FUSED 
> operations are mentioned in the general SQE section in the SPEC. 

Just for future reference, the changes from previous versions should go
below the "---" line so that they don't get included in the official
changelog.

> +    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
> +        return NVME_INVALID_FIELD;
> +    }
> +
>      req->ns = ns;
>  
>      switch (req->cmd.opcode) {
> @@ -5475,6 +5479,10 @@ static uint16_t nvme_admin_cmd(NvmeCtrl *n, NvmeRequest *req)
>          return NVME_INVALID_FIELD | NVME_DNR;
>      }
>  
> +    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
> +        return NVME_INVALID_FIELD;
> +    }

I'm a little surprised this macro exists considering this is the first
time it's used! But this looks fine, I really hope hosts weren't
actually trying fused commands on this target, but it's good to confirm.

Reviewed-by: Keith Busch <kbusch@kernel.org>


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

* Re: [PATCH v2] hw/nvme: Return error for fused operations
  2021-09-15 15:43 ` [PATCH v2] hw/nvme: Return error for fused operations Pankaj Raghav
  2021-09-15 15:55   ` Keith Busch
@ 2021-09-23 20:26   ` Klaus Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: Klaus Jensen @ 2021-09-23 20:26 UTC (permalink / raw)
  To: Pankaj Raghav; +Cc: kbusch, qemu-devel, qemu-block

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

On Sep 15 17:43, Pankaj Raghav wrote:
> Currently, FUSED operations are not supported by QEMU. As per the 1.4 SPEC,
> controller should abort the command that requested a fused operation with 
> an INVALID FIELD error code if they are not supported.
> 
> Changes from v1:
> Added FUSE flag check also to the admin cmd processing as the FUSED 
> operations are mentioned in the general SQE section in the SPEC. 
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>  hw/nvme/ctrl.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index dc0e7b0030..2f247a9275 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -3893,6 +3893,10 @@ static uint16_t nvme_io_cmd(NvmeCtrl *n, NvmeRequest *req)
>          return ns->status;
>      }
>  
> +    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
> +        return NVME_INVALID_FIELD;
> +    }
> +
>      req->ns = ns;
>  
>      switch (req->cmd.opcode) {
> @@ -5475,6 +5479,10 @@ static uint16_t nvme_admin_cmd(NvmeCtrl *n, NvmeRequest *req)
>          return NVME_INVALID_FIELD | NVME_DNR;
>      }
>  
> +    if (NVME_CMD_FLAGS_FUSE(req->cmd.flags)) {
> +        return NVME_INVALID_FIELD;
> +    }
> +
>      switch (req->cmd.opcode) {
>      case NVME_ADM_CMD_DELETE_SQ:
>          return nvme_del_sq(n, req);
> -- 
> 2.25.1

Applied to nvme-next. Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-09-23 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210915154333eucas1p2baf6aabb3bd0325233dae156f8bbbb32@eucas1p2.samsung.com>
2021-09-15 15:43 ` [PATCH v2] hw/nvme: Return error for fused operations Pankaj Raghav
2021-09-15 15:55   ` Keith Busch
2021-09-23 20:26   ` Klaus Jensen

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.