All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Keith Busch <kbusch@kernel.org>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"hch@lst.de" <hch@lst.de>, "sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH] nvmet: use U32_MAX value to report NN
Date: Mon, 14 Jun 2021 21:23:07 +0000	[thread overview]
Message-ID: <BYAPR04MB496590CDFF6E7589895BE0F186319@BYAPR04MB4965.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20210614211840.GA646237@dhcp-10-100-145-180.wdc.com

On 6/14/21 14:19, Keith Busch wrote:
> On Mon, Jun 14, 2021 at 12:47:12PM -0700, Chaitanya Kulkarni wrote:
>> @@ -393,7 +393,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
>>  	/* no enforcement soft-limit for maxcmd - pick arbitrary high value */
>>  	id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
>>  
>> -	id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
>> +	id->nn = cpu_to_le32(U32_MAX);
> The NN field has to have the highest valid NSID, and FFFFFFFFh is not
> valid. That's reserved for the broadcast.
>

In that case we have to keep the dynamic id setting for the MNAN and
may have to keep the original proposed fix :-

 drivers/nvme/target/admin-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/admin-cmd.c
b/drivers/nvme/target/admin-cmd.c
index cd60a8184d04..a8ec377bb68d 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -394,7 +394,7 @@ static void nvmet_execute_identify_ctrl(struct
nvmet_req *req)
        id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
 
        id->nn = cpu_to_le32(ctrl->subsys->max_nsid);
-       id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES);
+       id->mnan = cpu_to_le32(ctrl->subsys->max_nsid);
        id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM |
                        NVME_CTRL_ONCS_WRITE_ZEROES);
 
-- 
2.22.1



_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

      reply	other threads:[~2021-06-14 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14 19:47 [PATCH] nvmet: use U32_MAX value to report NN Chaitanya Kulkarni
2021-06-14 21:18 ` Keith Busch
2021-06-14 21:23   ` Chaitanya Kulkarni [this message]

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=BYAPR04MB496590CDFF6E7589895BE0F186319@BYAPR04MB4965.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 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.