qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Cc: fam@euphon.net, kwolf@redhat.com, qemu-block@nongnu.org,
	qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com,
	kbusch@kernel.org
Subject: Re: [PATCH v2] hw/nvme/ctrl: fix csi field for cns 0x00 and 0x11
Date: Mon, 31 May 2021 22:39:59 +0200	[thread overview]
Message-ID: <YLVJn0TT6LoKTEHZ@apples.localdomain> (raw)
In-Reply-To: <20210427063052.31078-1-anaidu.gollu@samsung.com>

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

On Apr 27 12:00, Gollu Appalanaidu wrote:
>As per the TP 4056d Namespace types CNS 0x00 and CNS 0x11
>CSI field shouldn't use but it is being used for these two
>Identify command CNS values, fix that.
>
>Remove 'nvme_csi_has_nvm_support()' helper as suggested by
>Klaus we can safely assume NVM command set support for all
>namespaces.
>
>Suggested-by: Klaus Jensen <its@irrelevant.dk>
>Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>

LGTM.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

>---
>-v2: add sugggestions from Klaus
>We can Remove 'nvme_csi_has_nvm_support()' helper, we can
>assume NVM command set support for all namespaces.
>
> hw/nvme/ctrl.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
>diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
>index 2e7498a73e..7fcd699235 100644
>--- a/hw/nvme/ctrl.c
>+++ b/hw/nvme/ctrl.c
>@@ -4178,16 +4178,6 @@ static uint16_t nvme_rpt_empty_id_struct(NvmeCtrl *n, NvmeRequest *req)
>     return nvme_c2h(n, id, sizeof(id), req);
> }
>
>-static inline bool nvme_csi_has_nvm_support(NvmeNamespace *ns)
>-{
>-    switch (ns->csi) {
>-    case NVME_CSI_NVM:
>-    case NVME_CSI_ZONED:
>-        return true;
>-    }
>-    return false;
>-}
>-
> static uint16_t nvme_identify_ctrl(NvmeCtrl *n, NvmeRequest *req)
> {
>     trace_pci_nvme_identify_ctrl();
>@@ -4244,7 +4234,7 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeRequest *req, bool active)
>         }
>     }
>
>-    if (c->csi == NVME_CSI_NVM && nvme_csi_has_nvm_support(ns)) {
>+    if (active || ns->csi == NVME_CSI_NVM) {
>         return nvme_c2h(n, (uint8_t *)&ns->id_ns, sizeof(NvmeIdNs), req);
>     }
>
>@@ -4315,7 +4305,7 @@ static uint16_t nvme_identify_ns_csi(NvmeCtrl *n, NvmeRequest *req,
>         }
>     }
>
>-    if (c->csi == NVME_CSI_NVM && nvme_csi_has_nvm_support(ns)) {
>+    if (c->csi == NVME_CSI_NVM) {
>         return nvme_rpt_empty_id_struct(n, req);
>     } else if (c->csi == NVME_CSI_ZONED && ns->csi == NVME_CSI_ZONED) {
>         return nvme_c2h(n, (uint8_t *)ns->id_ns_zoned, sizeof(NvmeIdNsZoned),
>-- 
>2.17.1
>

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

  reply	other threads:[~2021-05-31 20:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210427063530epcas5p4c260382227175e68d29da6d10957ad95@epcas5p4.samsung.com>
2021-04-27  6:30 ` [PATCH v2] hw/nvme/ctrl: fix csi field for cns 0x00 and 0x11 Gollu Appalanaidu
2021-05-31 20:39   ` Klaus Jensen [this message]
2021-06-09 20:10   ` Klaus Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLVJn0TT6LoKTEHZ@apples.localdomain \
    --to=its@irrelevant.dk \
    --cc=anaidu.gollu@samsung.com \
    --cc=fam@euphon.net \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).