All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] nvmet: use subsys->max_nsid to report MNAN value
@ 2021-06-14  1:37 Chaitanya Kulkarni
  2021-06-14  1:37 ` [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN Chaitanya Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-06-14  1:37 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, dwagner, sagi, Chaitanya Kulkarni

Hi,

Instaed of using the NVMET_MAX_NAMESPACS use subsys->nax_nsid to set
the MNAN value since nvmet controller supports the ANA Reporting.

Without this patch we get following error with connect command :-

[337976.409142] nvme nvme1: Invalid MNAN value 1024

I've ran blocktests [1] and they pass on the top of this patch on
nvme-5.14.

-ck

Chaitanya Kulkarni (1):
  nvmet: use subsys->max_nsid to report MNAN

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

# git log -1
commit 353d099f43f8372010bdfa16a9b6ef1cc0233b6f (HEAD -> nvme-5.14)
Author: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Date:   Sat Jun 12 15:10:43 2021 -0700

    nvmet: use subsys->max_nsid to report MNAN
    
    For Spec regarding MNAN value:-
    
    If the controller supports Asymmetric Namespace Access Reporting, then
    this field shall be set to a non-zero value that is less than or equal
    to the NN value.
    
    Instead of using NVMET_MAX_NAMESPACES use subsys->max_nsid to set the
    MNAN value.
    
    Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
# git format-patch HEAD~1 --signoff 
0001-nvmet-use-subsys-max_nsid-to-report-MNAN.patch
# ./compile_nvme.sh 
+ umount /mnt/nvme0n1
+ clear_dmesg
umount: /mnt/nvme0n1: not mounted
+ modprobe -r nvme-fabrics
+ modprobe -r nvme_loop
+ modprobe -r nvmet
+ modprobe -r nvme
+ sleep 1
+ modprobe -r nvme-core
+ lsmod
+ grep nvme
+ git apply ./all-fixes.diff
+ sleep 1
+ git diff
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index cb30cb942e1d..a7f7b4dd8d37 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -692,7 +692,8 @@ static struct nvmf_transport_ops nvme_loop_transport = {
        .name           = "loop",
        .module         = THIS_MODULE,
        .create_ctrl    = nvme_loop_create_ctrl,
-       .allowed_opts   = NVMF_OPT_TRADDR,
+       .allowed_opts   = NVMF_OPT_TRADDR | NVMF_OPT_CTRL_LOSS_TMO,
+
 };
 
 static int __init nvme_loop_init_module(void)
+ sleep 1
++ nproc
+ make -j 64 M=drivers/nvme/ modules
  CC [M]  drivers/nvme//target/loop.o
  LD [M]  drivers/nvme//target/nvme-loop.o
  MODPOST drivers/nvme//Module.symvers
  LD [M]  drivers/nvme//target/nvme-loop.ko
+ HOST=drivers/nvme/host
+ TARGET=drivers/nvme/target
++ uname -r
+ HOST_DEST=/lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/host/
++ uname -r
+ TARGET_DEST=/lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/target/
+ cp drivers/nvme/host/nvme-core.ko drivers/nvme/host/nvme-fabrics.ko drivers/nvme/host/nvme-fc.ko drivers/nvme/host/nvme.ko drivers/nvme/host/nvme-rdma.ko drivers/nvme/host/nvme-tcp.ko /lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/host//
+ cp drivers/nvme/target/nvme-fcloop.ko drivers/nvme/target/nvme-loop.ko drivers/nvme/target/nvmet-fc.ko drivers/nvme/target/nvmet.ko drivers/nvme/target/nvmet-rdma.ko drivers/nvme/target/nvmet-tcp.ko /lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/target//
+ ls -lrth /lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/host/ /lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/target//
/lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/host/:
total 9.1M
-rw-r--r--. 1 root root 4.0M Jun 13 14:23 nvme-core.ko
-rw-r--r--. 1 root root 639K Jun 13 14:23 nvme-fabrics.ko
-rw-r--r--. 1 root root 1.2M Jun 13 14:23 nvme-fc.ko
-rw-r--r--. 1 root root 1.1M Jun 13 14:23 nvme.ko
-rw-r--r--. 1 root root 1.2M Jun 13 14:23 nvme-rdma.ko
-rw-r--r--. 1 root root 1.1M Jun 13 14:23 nvme-tcp.ko

/lib/modules/5.13.0-rc3nvme+/kernel/drivers/nvme/target//:
total 8.3M
-rw-r--r--. 1 root root 718K Jun 13 14:23 nvme-fcloop.ko
-rw-r--r--. 1 root root 623K Jun 13 14:23 nvme-loop.ko
-rw-r--r--. 1 root root 1.1M Jun 13 14:23 nvmet-fc.ko
-rw-r--r--. 1 root root 4.0M Jun 13 14:23 nvmet.ko
-rw-r--r--. 1 root root 1.1M Jun 13 14:23 nvmet-rdma.ko
-rw-r--r--. 1 root root 868K Jun 13 14:23 nvmet-tcp.ko
+ modprobe nvme
+ git co drivers/nvme/target/loop.c
Updated 1 path from the index
# cdblktests 
 blktests (master) # ./check nvme-
./check: no group or test named nvme-
 blktests (master) # ./check nvme
nvme/002 (create many subsystems and test discovery)         [passed]
    runtime  41.158s  ...  40.884s
nvme/003 (test if we're sending keep-alives to a discovery controller) [passed]
    runtime  10.194s  ...  10.179s
nvme/004 (test nvme and nvmet UUID NS descriptors)           [passed]
    runtime  1.780s  ...  1.790s
nvme/005 (reset local loopback target)                       [passed]
    runtime  2.249s  ...  2.229s
nvme/006 (create an NVMeOF target with a block device-backed ns) [passed]
    runtime  0.156s  ...  0.157s
nvme/007 (create an NVMeOF target with a file-backed ns)     [passed]
    runtime  0.107s  ...  0.100s
nvme/008 (create an NVMeOF host with a block device-backed ns) [passed]
    runtime  1.794s  ...  1.810s
nvme/009 (create an NVMeOF host with a file-backed ns)       [passed]
    runtime  1.745s  ...  1.758s
nvme/010 (run data verification fio job on NVMeOF block device-backed ns) [passed]
    runtime  42.438s  ...  36.312s
nvme/011 (run data verification fio job on NVMeOF file-backed ns) [passed]
    runtime  325.840s  ...  305.214s
nvme/012 (run mkfs and data verification fio job on NVMeOF block device-backed ns) [passed]
    runtime  9.217s  ...  9.089s
nvme/013 (run mkfs and data verification fio job on NVMeOF file-backed ns) [passed]
    runtime  25.653s  ...  23.342s
nvme/014 (flush a NVMeOF block device-backed ns)             [passed]
    runtime  21.644s  ...  20.553s
nvme/015 (unit test for NVMe flush for file backed ns)       [passed]
    runtime  21.054s  ...  20.377s
nvme/016 (create/delete many NVMeOF block device-backed ns and test discovery) [passed]
    runtime  21.955s  ...  21.895s
nvme/017 (create/delete many file-ns and test discovery)     [passed]
    runtime  22.402s  ...  21.234s
nvme/018 (unit test NVMe-oF out of range access on a file backend) [passed]
    runtime  1.782s  ...  1.755s
nvme/019 (test NVMe DSM Discard command on NVMeOF block-device ns) [passed]
    runtime  2.332s  ...  1.785s
nvme/020 (test NVMe DSM Discard command on NVMeOF file-backed ns) [passed]
    runtime  1.952s  ...  1.747s
nvme/021 (test NVMe list command on NVMeOF file-backed ns)   [passed]
    runtime  1.966s  ...  1.790s
nvme/022 (test NVMe reset command on NVMeOF file-backed ns)  [passed]
    runtime  2.183s  ...  2.192s
nvme/023 (test NVMe smart-log command on NVMeOF block-device ns) [passed]
    runtime  1.831s  ...  1.828s
nvme/024 (test NVMe smart-log command on NVMeOF file-backed ns) [passed]
    runtime  1.748s  ...  1.734s
nvme/025 (test NVMe effects-log command on NVMeOF file-backed ns) [passed]
    runtime  1.749s  ...  1.748s
nvme/026 (test NVMe ns-descs command on NVMeOF file-backed ns) [passed]
    runtime  1.859s  ...  1.745s
nvme/027 (test NVMe ns-rescan command on NVMeOF file-backed ns) [passed]
    runtime  1.777s  ...  1.745s
nvme/028 (test NVMe list-subsys command on NVMeOF file-backed ns) [passed]
    runtime  1.764s  ...  1.740s
nvme/029 (test userspace IO via nvme-cli read/write interface) [passed]
    runtime  2.277s  ...  2.245s
nvme/030 (ensure the discovery generation counter is updated appropriately) [passed]
    runtime  0.422s  ...  0.414s
nvme/031 (test deletion of NVMeOF controllers immediately after setup) [passed]
    runtime  5.982s  ...  6.045s
nvme/038 (test deletion of NVMeOF subsystem without enabling) [passed]
    runtime  0.060s  ...  0.063s


-- 
2.22.1


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

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

* [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN
  2021-06-14  1:37 [PATCH 0/1] nvmet: use subsys->max_nsid to report MNAN value Chaitanya Kulkarni
@ 2021-06-14  1:37 ` Chaitanya Kulkarni
  2021-06-14 11:21   ` Daniel Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-06-14  1:37 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, dwagner, sagi, Chaitanya Kulkarni

For Spec regarding MNAN value:-

If the controller supports Asymmetric Namespace Access Reporting, then
this field shall be set to a non-zero value that is less than or equal
to the NN value.

Instead of using NVMET_MAX_NAMESPACES use subsys->max_nsid to set the
MNAN value.

Without this patch it results in the following error :- 

[337976.409142] nvme nvme1: Invalid MNAN value 1024

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 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

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

* Re: [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN
  2021-06-14  1:37 ` [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN Chaitanya Kulkarni
@ 2021-06-14 11:21   ` Daniel Wagner
  2021-06-14 19:16     ` Chaitanya Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Wagner @ 2021-06-14 11:21 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, sagi

On Sun, Jun 13, 2021 at 06:37:54PM -0700, Chaitanya Kulkarni wrote:
> For Spec regarding MNAN value:-
> 
> If the controller supports Asymmetric Namespace Access Reporting, then
> this field shall be set to a non-zero value that is less than or equal
> to the NN value.
> 
> Instead of using NVMET_MAX_NAMESPACES use subsys->max_nsid to set the
> MNAN value.
> 
> Without this patch it results in the following error :- 
> 
> [337976.409142] nvme nvme1: Invalid MNAN value 1024

Is this not the very same patch on which Christoph commented?

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

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

* Re: [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN
  2021-06-14 11:21   ` Daniel Wagner
@ 2021-06-14 19:16     ` Chaitanya Kulkarni
  0 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-06-14 19:16 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: linux-nvme, hch, sagi

On 6/14/21 04:21, Daniel Wagner wrote:
> On Sun, Jun 13, 2021 at 06:37:54PM -0700, Chaitanya Kulkarni wrote:
>> For Spec regarding MNAN value:-
>>
>> If the controller supports Asymmetric Namespace Access Reporting, then
>> this field shall be set to a non-zero value that is less than or equal
>> to the NN value.
>>
>> Instead of using NVMET_MAX_NAMESPACES use subsys->max_nsid to set the
>> MNAN value.
>>
>> Without this patch it results in the following error :- 
>>
>> [337976.409142] nvme nvme1: Invalid MNAN value 1024
> Is this not the very same patch on which Christoph commented?
>

Yes without the rest of the patches.



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

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

end of thread, other threads:[~2021-06-14 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14  1:37 [PATCH 0/1] nvmet: use subsys->max_nsid to report MNAN value Chaitanya Kulkarni
2021-06-14  1:37 ` [PATCH 1/1] nvmet: use subsys->max_nsid to report MNAN Chaitanya Kulkarni
2021-06-14 11:21   ` Daniel Wagner
2021-06-14 19:16     ` Chaitanya Kulkarni

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.