[PATCH] block: account statistics for passthrough requests

2019-10-10 Thread Logan Gunthorpe
call blk_account_io_start() in blk_execute_rq_nowait() and remove the passthrough check in blk_do_io_stat(). Link: https://lore.kernel.org/linux-block/20191010100526.ga27...@lst.de/ Signed-off-by: Logan Gunthorpe Cc: Jens Axboe Cc: Christoph Hellwig --- This change is needed for the NVMe-of pas

Re: [PATCH v9 10/12] block: don't check blk_rq_is_passthrough() in blk_do_io_stat()

2019-10-10 Thread Logan Gunthorpe
Hey, Thanks for the thorough review, lots here to go through. I'll address it all as I have time and try to get the prep work done first, as soon as I can. On 2019-10-10 4:05 a.m., Christoph Hellwig wrote: >> @@ -319,7 +319,7 @@ static struct request *blk_mq_rq_ctx_init(struct >> blk_mq_alloc_da

[PATCH v9 09/12] nvmet-configfs: introduce passthru configfs interface

2019-10-09 Thread Logan Gunthorpe
subsystem to use passthru. Any given subsystem is prevented from enabling both a regular namespace and the passthru device. If one is enabled, enabling the other will produce an error. Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- drivers/nv

[PATCH v9 04/12] nvmet: make nvmet_copy_ns_identifier() non-static

2019-10-09 Thread Logan Gunthorpe
by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- drivers/nvme/target/admin-cmd.c | 4 ++-- drivers/nvme/target/nvmet.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/admin-cmd.c b/drivers

[PATCH v9 12/12] nvmet-passthru: support block accounting

2019-10-09 Thread Logan Gunthorpe
Support block disk accounting by setting the RQF_IO_STAT flag and gendisk in the request. After this change, IO counts will be reflected correctly in /proc/diskstats for drives being used by passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/io-cmd-passthru.c | 5 - 1 file

[PATCH v9 11/12] block: call blk_account_io_start() in blk_execute_rq_nowait()

2019-10-09 Thread Logan Gunthorpe
All existing users of blk_execute_rq[_nowait]() are for passthrough commands and will thus be rejected by blk_do_io_stat(). This allows passthrough requests to opt-in to IO accounting by setting RQF_IO_STAT. Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- block/blk-exec.c | 2

[PATCH v9 03/12] nvmet: add return value to nvmet_add_async_event()

2019-10-09 Thread Logan Gunthorpe
...@deltatee.com: * fleshed out commit message * change to using int as a return type instead of bool ] Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- drivers/nvme/target/core.c | 6 -- drivers/nvme/target/nvmet.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff

[PATCH v9 05/12] Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed some of the wording in the help message] Signed-off-by: Logan Gunthorpe

2019-10-09 Thread Logan Gunthorpe
dropped le16_to_cpu() conversion in nvmet_passthru_req_done() as it's currently already done in nvme_end_request() * unabbreviated 'VUC' in a comment as it's not a commonly known acronym * removed unnecessary inline tags on static functions * minor edits to commit mess

[PATCH v9 02/12] nvme-core: export existing ctrl and ns interfaces

2019-10-09 Thread Logan Gunthorpe
From: Chaitanya Kulkarni We export existing nvme ctrl and ns management APIs so that target passthru code can manage the nvme ctrl. This is a preparation patch for implementing NVMe Over Fabric target passthru feature. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe Reviewed

[PATCH v9 00/12] nvmet: add target passthru commands support

2019-10-09 Thread Logan Gunthorpe
passthru subsystem. 6. Use the passthru ctrl cntlid when creating the target controller. Chaitanya Kulkarni (4): nvme-core: export existing ctrl and ns interfaces nvmet: add return value to nvmet_add_async_event() nvmet-passthru: add passthru code to process commands

[PATCH v9 07/12] nvmet-core: don't check the data len for pt-ctrl

2019-10-09 Thread Logan Gunthorpe
rence subsys->passthru_ctrl if CONFIG_NVME_TARGET_PASSTHRU is not set] Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- drivers/nvme/target/core.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core

[PATCH v9 06/12] nvmet-passthru: add enable/disable helpers

2019-10-09 Thread Logan Gunthorpe
similar one by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 8 +++ drivers/nvme/target/io-cmd-passthru.c | 77 +++ drivers/nvme/target/nvmet.h | 10 3 files changed, 95 insertions

[PATCH v9 10/12] block: don't check blk_rq_is_passthrough() in blk_do_io_stat()

2019-10-09 Thread Logan Gunthorpe
Instead of checking blk_rq_is_passthruough() for every call to blk_do_io_stat(), don't set RQF_IO_STAT for passthrough requests. This should be equivalent, and opens the possibility of passthrough requests specifically requesting statistics tracking. Signed-off-by: Logan Gunthorpe Review

[PATCH v9 05/12] nvmet-passthru: add passthru code to process commands

2019-10-09 Thread Logan Gunthorpe
it's currently already done in nvme_end_request() * unabbreviated 'VUC' in a comment as it's not a commonly known acronym * removed unnecessary inline tags on static functions * minor edits to commit message ] Signed-off-by: Logan Gunthorpe --- drivers/nvm

[PATCH v9 01/12] nvme-core: introduce nvme_ctrl_get_by_path()

2019-10-09 Thread Logan Gunthorpe
, -EINVAL is returned. The purpose of this function is to support NVMe-OF target passthru. Signed-off-by: Logan Gunthorpe Reviewed-by: Max Gurtovoy Reviewed-by: Sagi Grimberg --- drivers/nvme/host/core.c | 24 drivers/nvme/host/nvme.h | 2 ++ 2 files changed, 26 insertions

[PATCH v9 08/12] nvmet-tcp: don't check data_len in nvmet_tcp_map_data()

2019-10-09 Thread Logan Gunthorpe
With passthru, the data_len is no longer guaranteed to be set for all requests. Therefore, we should not check for it to be non-zero. Instead check if the SGL length is zero and map when appropriate. None of the other transports check data_len which is verified in core code. Signed-off-by: Logan

[PATCH blktests v3] nvme/031: Add test to check controller deletion after setup

2019-09-11 Thread Logan Gunthorpe
A number of bug fixes have been submitted to the kernel to fix bugs when a controller is removed immediately after it is set up. This new test ensures this doesn't regress. Signed-off-by: Logan Gunthorpe Reviewed-by: Sagi Grimberg --- Changes for v3: * Drops the double loop_dev declar

Re: [PATCH v8 13/13] nvmet-passthru: support block accounting

2019-09-11 Thread Logan Gunthorpe
ected correctly in >>>>>> /proc/diskstats for drives being used by passthru. >>>>>> >>>>>> Signed-off-by: Logan Gunthorpe >>>>>> --- >>>>>>     drivers/nvme/target/io-cmd-passthru.c | 5 - >>>>&

Re: [PATCH v8 13/13] nvmet-passthru: support block accounting

2019-09-09 Thread Logan Gunthorpe
skstats for drives being used by passthru. >>>> >>>> Signed-off-by: Logan Gunthorpe >>>> --- >>>>drivers/nvme/target/io-cmd-passthru.c | 5 - >>>>1 file changed, 4 insertions(+), 1 deletion(-) >>>> >>>

Re: [PATCH blktests] nvme/031: Add test to check controller deletion after setup

2019-09-09 Thread Logan Gunthorpe
On 2019-09-07 12:19 p.m., Chaitanya Kulkarni wrote: > On 09/05/2019 10:44 AM, Logan Gunthorpe wrote: >> A number of bug fixes have been submitted to the kernel to >> fix bugs when a controller is removed immediately after it is >> set up. This new test ensures this doesn&#x

Re: [PATCH v8 13/13] nvmet-passthru: support block accounting

2019-09-09 Thread Logan Gunthorpe
On 2019-09-06 6:00 p.m., Sagi Grimberg wrote: > >> Support block disk accounting by setting the RQF_IO_STAT flag >> and gendisk in the request. >> >> After this change, IO counts will be reflected correctly in >> /proc/diskstats for drives being used by pas

[PATCH blktests] nvme/031: Add test to check controller deletion after setup

2019-09-05 Thread Logan Gunthorpe
A number of bug fixes have been submitted to the kernel to fix bugs when a controller is removed immediately after it is set up. This new test ensures this doesn't regress. Signed-off-by: Logan Gunthorpe --- This is reallly just a resend. The patches this tests for are all in 5.3-r

[PATCH v8 13/13] nvmet-passthru: support block accounting

2019-08-28 Thread Logan Gunthorpe
Support block disk accounting by setting the RQF_IO_STAT flag and gendisk in the request. After this change, IO counts will be reflected correctly in /proc/diskstats for drives being used by passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/io-cmd-passthru.c | 5 - 1 file

[PATCH v8 01/13] nvme-core: introduce nvme_ctrl_get_by_path()

2019-08-28 Thread Logan Gunthorpe
, -EINVAL is returned. The purpose of this function is to support NVMe-OF target passthru. Signed-off-by: Logan Gunthorpe Reviewed-by: Max Gurtovoy --- drivers/nvme/host/core.c | 24 drivers/nvme/host/nvme.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/drivers/nvme

[PATCH v8 04/13] nvmet: make nvmet_copy_ns_identifier() non-static

2019-08-28 Thread Logan Gunthorpe
by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/admin-cmd.c | 4 ++-- drivers/nvme/target/nvmet.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c

[PATCH v8 00/13] nvmet: add target passthru commands support

2019-08-28 Thread Logan Gunthorpe
dd_async_event() nvmet-passthru: update KConfig with config passthru option nvmet-passthru: add passthru code to process commands nvmet-core: don't check the data len for pt-ctrl Logan Gunthorpe (8): nvme-core: introduce nvme_ctrl_get_by_path() nvmet: make nvmet_copy_ns_identifier() no

[PATCH v8 11/13] block: don't check blk_rq_is_passthrough() in blk_do_io_stat()

2019-08-28 Thread Logan Gunthorpe
Instead of checking blk_rq_is_passthruough() for every call to blk_do_io_stat(), don't set RQF_IO_STAT for passthrough requests. This should be equivalent, and opens the possibility of passthrough requests specifically requesting statistics tracking. Signed-off-by: Logan Gunthorpe --- bloc

[PATCH v8 12/13] block: call blk_account_io_start() in blk_execute_rq_nowait()

2019-08-28 Thread Logan Gunthorpe
All existing users of blk_execute_rq[_nowait]() are for passthrough commands and will thus be rejected by blk_do_io_stat(). This allows passthrough requests to opt-in to IO accounting by setting RQF_IO_STAT. Signed-off-by: Logan Gunthorpe --- block/blk-exec.c | 2 ++ 1 file changed, 2

[PATCH v8 06/13] nvmet-passthru: add passthru code to process commands

2019-08-28 Thread Logan Gunthorpe
d unnecessary inline tags on static functions * minor edits to commit message ] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/Makefile | 1 + drivers/nvme/target/core.c| 11 +- drivers/nvme/target/io-cmd-passthru.c | 564 ++ drivers/nvm

[PATCH v8 02/13] nvme-core: export existing ctrl and ns interfaces

2019-08-28 Thread Logan Gunthorpe
From: Chaitanya Kulkarni We export existing nvme ctrl and ns management APIs so that target passthru code can manage the nvme ctrl. This is a preparation patch for implementing NVMe Over Fabric target passthru feature. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe

[PATCH v8 07/13] nvmet-passthru: add enable/disable helpers

2019-08-28 Thread Logan Gunthorpe
similar one by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 8 +++ drivers/nvme/target/io-cmd-passthru.c | 77 +++ drivers/nvme/target/nvmet.h | 10 3 files changed, 95 insertions

[PATCH v8 10/13] nvmet-configfs: introduce passthru configfs interface

2019-08-28 Thread Logan Gunthorpe
subsystem to use passthru. Any given subsystem is prevented from enabling both a regular namespace and the passthru device. If one is enabled, enabling the other will produce an error. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/configfs.c | 99 ++ dr

[PATCH v8 09/13] nvmet-tcp: don't check data_len in nvmet_tcp_map_data()

2019-08-28 Thread Logan Gunthorpe
With passthru, the data_len is no longer guaranteed to be set for all requests. Therefore, we should not check for it to be non-zero. Instead check if the SGL length is zero and map when appropriate. None of the other transports check data_len which is verified in core code. Signed-off-by: Logan

[PATCH v8 08/13] nvmet-core: don't check the data len for pt-ctrl

2019-08-28 Thread Logan Gunthorpe
rence subsys->passthru_ctrl if CONFIG_NVME_TARGET_PASSTHRU is not set] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 986b2511d284..f9d46354f9a

[PATCH v8 03/13] nvmet: add return value to nvmet_add_async_event()

2019-08-28 Thread Logan Gunthorpe
...@deltatee.com: * fleshed out commit message * change to using int as a return type instead of bool ] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c | 6 -- drivers/nvme/target/nvmet.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/target

[PATCH v8 05/13] nvmet-passthru: update KConfig with config passthru option

2019-08-28 Thread Logan Gunthorpe
From: Chaitanya Kulkarni This patch updates KConfig file for the NVMeOF target where we add new option so that user can selectively enable/disable passthru code. Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed some of the wording in the help message] Signed-off-by: Logan

Re: [PATCH v7 08/14] nvmet-core: allow one host per passthru-ctrl

2019-08-22 Thread Logan Gunthorpe
On 2019-08-22 1:17 p.m., Sagi Grimberg wrote: > > I don't understand why we don't limit a regular ctrl to single > access and we do it for the PT ctrl. > > I guess the block layer helps to sync between multiple access in > parallel but we can do it as well. > > Also,

Re: [PATCH v7 08/14] nvmet-core: allow one host per passthru-ctrl

2019-08-15 Thread Logan Gunthorpe
On 2019-08-15 6:36 a.m., Max Gurtovoy wrote: > > On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: >> This patch rejects any new connection to the passthru-ctrl if this >> controller is already connected to a different host. At the time of >> allocating the controlle

Re: [PATCH v7 07/14] nvmet-passthru: add enable/disable helpers

2019-08-15 Thread Logan Gunthorpe
On 2019-08-15 6:20 a.m., Max Gurtovoy wrote: > > On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: >> This patch adds helper functions which are used in the NVMeOF configfs >> when the user is configuring the passthru subsystem. Here we ensure >> that only one subsys is assig

Re: [PATCH v7 01/14] nvme-core: introduce nvme_ctrl_get_by_path()

2019-08-15 Thread Logan Gunthorpe
On 2019-08-15 5:46 a.m., Max Gurtovoy wrote: > > On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: >> nvme_ctrl_get_by_path() is analagous to blkdev_get_by_path() except it >> gets a struct nvme_ctrl from the path to its char dev (/dev/nvme0). >> It makes use of filp_open() t

Re: [PATCH v7 03/14] nvmet: add return value to nvmet_add_async_event()

2019-08-14 Thread Logan Gunthorpe
On 2019-08-14 8:26 a.m., Max Gurtovoy wrote: > > On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: >> From: Chaitanya Kulkarni >> >> Change the return value for nvmet_add_async_event(). >> >> This change is needed for the target passthru code to generate as

Re: [PATCH blktests 1/4] tests/nvme/rc: Modify the approach for disabling and re-enabling Ctrl-C

2019-08-08 Thread Logan Gunthorpe
On 2019-08-08 3:00 p.m., Bart Van Assche wrote: > On 8/8/19 1:08 PM, Logan Gunthorpe wrote: >> On 2019-08-08 2:05 p.m., Bart Van Assche wrote: >>> Avoid that the following error messages are reported when redirecting >>> stdin: >>> >>> stty: &#x

Re: [PATCH blktests 1/4] tests/nvme/rc: Modify the approach for disabling and re-enabling Ctrl-C

2019-08-08 Thread Logan Gunthorpe
On 2019-08-08 2:05 p.m., Bart Van Assche wrote: > Avoid that the following error messages are reported when redirecting stdin: > > stty: 'standard input': Inappropriate ioctl for device > stty: 'standard input': Inappropriate ioctl for device > > Cc: Log

Re: [PATCH blktests] Make the NVMe tests more reliable

2019-08-06 Thread Logan Gunthorpe
s/block/nvme1n1/uuid: No such file or directory > +cat: /sys/block/nvme1n1/wwid: No such file or directory > > Cc: Logan Gunthorpe > Cc: Chaitanya Kulkarni > Cc: Johannes Thumshirn > Signed-off-by: Bart Van Assche Makes sense to me. Reviewed-by: Logan Gunthorpe > --- >

[PATCH v7 03/14] nvmet: add return value to nvmet_add_async_event()

2019-08-01 Thread Logan Gunthorpe
From: Chaitanya Kulkarni Change the return value for nvmet_add_async_event(). This change is needed for the target passthru code to generate async events. Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed up commit message that was no longer accurate] Signed-off-by: Logan

[PATCH v7 01/14] nvme-core: introduce nvme_ctrl_get_by_path()

2019-08-01 Thread Logan Gunthorpe
, -EINVAL is returned. The purpose of this function is to support NVMe-OF target passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/host/core.c | 24 drivers/nvme/host/nvme.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme

[PATCH v7 04/14] nvmet: make nvmet_copy_ns_identifier() non-static

2019-08-01 Thread Logan Gunthorpe
This function will be needed by the upcoming passthru code. [chaitanya.kulka...@wdc.com: this was factored out of a patch originally authored by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/admin-cmd.c | 4 ++-- drivers/nvme/target

[PATCH v7 14/14] nvmet-passthru: support block accounting

2019-08-01 Thread Logan Gunthorpe
Support block disk accounting by setting the RQF_IO_STAT flag and gendisk in the request. After this change, IO counts will be reflected correctly in /proc/diskstats for drives being used by passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/io-cmd-passthru.c | 5 - 1 file

[PATCH v7 12/14] block: don't check blk_rq_is_passthrough() in blk_do_io_stat()

2019-08-01 Thread Logan Gunthorpe
Instead of checking blk_rq_is_passthruough() for every call to blk_do_io_stat(), don't set RQF_IO_STAT for passthrough requests. This should be equivalent, and opens the possibility of passthrough requests specifically requesting statistics tracking. Signed-off-by: Logan Gunthorpe --- bloc

[PATCH v7 13/14] block: call blk_account_io_start() in blk_execute_rq_nowait()

2019-08-01 Thread Logan Gunthorpe
All existing users of blk_execute_rq[_nowait]() are for passthrough commands and will thus be rejected by blk_do_io_stat(). This allows passthrough requests to opt-in to IO accounting by setting RQF_IO_STAT. Signed-off-by: Logan Gunthorpe --- block/blk-exec.c | 2 ++ 1 file changed, 2

[PATCH v7 00/14] nvmet: add target passthru commands support

2019-08-01 Thread Logan Gunthorpe
code to process commands nvmet-core: don't check the data len for pt-ctrl Logan Gunthorpe (9): nvme-core: introduce nvme_ctrl_get_by_path() nvmet: make nvmet_copy_ns_identifier() non-static nvmet-passthru: add enable/disable helpers nvmet-core: allow one host per passthru-ctrl

[PATCH v7 06/14] nvmet-passthru: add passthru code to process commands

2019-08-01 Thread Logan Gunthorpe
o the target * dropped le16_to_cpu() conversion in nvmet_passthru_req_done() as it's currently already done in nvme_end_request() * unabbreviated 'VUC' in a comment as it's not a commonly known acronym * removed unnecessary inline tags on static functions * minor e

[PATCH v7 05/14] nvmet-passthru: update KConfig with config passthru option

2019-08-01 Thread Logan Gunthorpe
From: Chaitanya Kulkarni This patch updates KConfig file for the NVMeOF target where we add new option so that user can selectively enable/disable passthru code. Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed some of the wording in the help message] Signed-off-by: Logan

[PATCH v7 11/14] nvmet-configfs: introduce passthru configfs interface

2019-08-01 Thread Logan Gunthorpe
subsystem to use passthru. Any given subsystem is prevented from enabling both a regular namespace and the passthru device. If one is enabled, enabling the other will produce an error. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/configfs.c | 99 ++ dr

[PATCH v7 07/14] nvmet-passthru: add enable/disable helpers

2019-08-01 Thread Logan Gunthorpe
similar one by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 8 +++ drivers/nvme/target/io-cmd-passthru.c | 77 +++ drivers/nvme/target/nvmet.h | 10 3 files changed, 95 insertions

[PATCH v7 08/14] nvmet-core: allow one host per passthru-ctrl

2019-08-01 Thread Logan Gunthorpe
. Connections from the same host (by hostnqn) are supported to allow for multipath. [chaitanya.kulka...@wdc.com: based conceptually on a similar patch but different implementation] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 4 drivers

[PATCH v7 09/14] nvmet-core: don't check the data len for pt-ctrl

2019-08-01 Thread Logan Gunthorpe
rence subsys->passthru_ctrl if CONFIG_NVME_TARGET_PASSTHRU is not set] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index c655f26db3da..1cda94437fb

[PATCH v7 02/14] nvme-core: export existing ctrl and ns interfaces

2019-08-01 Thread Logan Gunthorpe
From: Chaitanya Kulkarni We export existing nvme ctrl and ns management APIs so that target passthru code can manage the nvme ctrl. This is a preparation patch for implementing NVMe Over Fabric target passthru feature. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe

[PATCH v7 10/14] nvmet-tcp: don't check data_len in nvmet_tcp_map_data()

2019-08-01 Thread Logan Gunthorpe
With passthru, the data_len is no longer guaranteed to be set for all requests. Therefore, we should not check for it to be non-zero. Instead check if the SGL length is zero and map when appropriate. None of the other transports check data_len which is verified in core code. Signed-off-by: Logan

[PATCH blktests] nvme/031: Add test to check controller deletion after setup

2019-07-31 Thread Logan Gunthorpe
A number of bug fixes have been submitted to the kernel to fix bugs when a controller is removed immediately after it is set up. This new test ensures this doesn't regress. Signed-off-by: Logan Gunthorpe --- All of the fixes required for this test to pass have been on the list for a c

Re: [PATCH v6 00/16] nvmet: add target passthru commands support

2019-07-29 Thread Logan Gunthorpe
On 2019-07-29 10:15 a.m., Sagi Grimberg wrote: > >>> This is different from multipath on say a multi-controller PCI device >>> and trying to expose both those controllers through passthru. this is >>> where the problems we are discussing come up. >> >> I *think* there is some confusion. I *thin

Re: [PATCH v6 00/16] nvmet: add target passthru commands support

2019-07-26 Thread Logan Gunthorpe
On 2019-07-26 5:13 p.m., Sagi Grimberg wrote: > >>> Why? if nvmet is capable, why shouldn't we support it? >> >> I'm saying that passthru is exporting a specific controller and submits >> commands (both admin and IO) straight to the nvme_ctrl's queues. It's >> not exporting an nvme_subsys and I

Re: [PATCH v6 00/16] nvmet: add target passthru commands support

2019-07-26 Thread Logan Gunthorpe
On 2019-07-26 4:21 p.m., Sagi Grimberg wrote: >> I don't think it necessarily makes sense for the target subsynqn and the >> target's device nqn to be the same. It would be weird for a user to want >> to use the same device and a passed through device (through a loop) as >> part of the same subs

Re: [PATCH v6 00/16] nvmet: add target passthru commands support

2019-07-26 Thread Logan Gunthorpe
On 2019-07-26 12:23 a.m., Hannes Reinecke wrote: > How do you handle subsystem naming? > If you enable the 'passthru' device, the (nvmet) subsystem (and its > name) is already created. Yet the passthru device will have its own > internal subsystem naming, so if you're not extra careful you'll en

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-26 Thread Logan Gunthorpe
On 2019-07-25 10:29 p.m., Sagi Grimberg wrote: > NVMe-OF is configured using configfs. The target is specified by the user writing a path to a configfs attribute. This is the way it works today but with blkdev_get_by_path()[1]. For the passthru code,

Re: [PATCH v6 04/16] nvme-core: introduce nvme_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 2:31 p.m., Keith Busch wrote: > On Thu, Jul 25, 2019 at 02:28:28PM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 1:58 p.m., Keith Busch wrote: >>> On Thu, Jul 25, 2019 at 11:54:18AM -0600, Logan Gunthorpe wrote: >>>> >>>&g

Re: [PATCH v6 04/16] nvme-core: introduce nvme_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 1:58 p.m., Keith Busch wrote: > On Thu, Jul 25, 2019 at 11:54:18AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 11:50 a.m., Matthew Wilcox wrote: >>> On Thu, Jul 25, 2019 at 11:23:23AM -0600, Logan Gunthorpe wrote: >>>> nvme_get_by

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 1:34 p.m., Greg Kroah-Hartman wrote: > On Thu, Jul 25, 2019 at 12:02:30PM -0700, Sagi Grimberg wrote: >> >> Why do you have a "string" within the kernel and are not using the >> normal open() call from userspace on the character device node on the >> filesystem in your

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 1:26 p.m., Matthew Wilcox wrote: > On Thu, Jul 25, 2019 at 01:24:22PM -0600, Logan Gunthorpe wrote: >>>> Assuming that there is a open handle somewhere out there... >> >> Yes, that would be a step backwards from an interface. The user would >> th

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 1:11 p.m., Matthew Wilcox wrote: > On Thu, Jul 25, 2019 at 12:05:29PM -0700, Sagi Grimberg wrote: >> > NVMe-OF is configured using configfs. The target is specified by the > user writing a path to a configfs attribute. This is the way it works > today but with blkdev_ge

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 12:27 p.m., Greg Kroah-Hartman wrote: >>> Why do you have a "string" within the kernel and are not using the >>> normal open() call from userspace on the character device node on the >>> filesystem in your namespace/mount/whatever? >> >> NVMe-OF is configured using configfs. The ta

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 12:10 p.m., Greg Kroah-Hartman wrote: > On Thu, Jul 25, 2019 at 11:53:20AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 11:40 a.m., Greg Kroah-Hartman wrote: >>> On Thu, Jul 25, 2019 at 11:23:21AM -0600, Logan Gunthorpe wrote: >>>>

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 12:08 p.m., Greg Kroah-Hartman wrote: > On Thu, Jul 25, 2019 at 11:53:20AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 11:40 a.m., Greg Kroah-Hartman wrote: >>> On Thu, Jul 25, 2019 at 11:23:21AM -0600, Logan Gunthorpe wrote: >>>>

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 11:58 a.m., Matthew Wilcox wrote: > On Thu, Jul 25, 2019 at 11:53:20AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 11:40 a.m., Greg Kroah-Hartman wrote: >>> On Thu, Jul 25, 2019 at 11:23:21AM -0600, Logan Gunthorpe wrote: >>>>

Re: [PATCH v6 04/16] nvme-core: introduce nvme_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 11:50 a.m., Matthew Wilcox wrote: > On Thu, Jul 25, 2019 at 11:23:23AM -0600, Logan Gunthorpe wrote: >> nvme_get_by_path() is analagous to blkdev_get_by_path() except it >> gets a struct nvme_ctrl from the path to its char dev (/dev/nvme0). >> >> The pur

Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
On 2019-07-25 11:40 a.m., Greg Kroah-Hartman wrote: > On Thu, Jul 25, 2019 at 11:23:21AM -0600, Logan Gunthorpe wrote: >> cdev_get_by_path() attempts to retrieve a struct cdev from >> a path name. It is analagous to blkdev_get_by_path(). >> >> This wi

[PATCH v6 09/16] nvmet-passthru: add passthru code to process commands

2019-07-25 Thread Logan Gunthorpe
's currently already done in nvme_end_request() * unabbreviated 'VUC' in a comment as it's not a commonly known acronym * removed unnecessary inline tags on static functions * minor edits to commit message ] Signed-off-by: Logan Gunthorpe squash! nvmet-pa

[PATCH v6 05/16] nvme-core: export existing ctrl and ns interfaces

2019-07-25 Thread Logan Gunthorpe
From: Chaitanya Kulkarni We export existing nvme ctrl and ns management APIs so that target passthru code can manage the nvme ctrl. This is a preparation patch for implementing NVMe Over Fabric target passthru feature. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe

[PATCH v6 15/16] block: call blk_account_io_start() in blk_execute_rq_nowait()

2019-07-25 Thread Logan Gunthorpe
All existing users of blk_execute_rq[_nowait]() are for passthrough commands and will thus be rejected by blk_do_io_stat(). This allows passthrough requests to opt-in to IO accounting by setting RQF_IO_STAT. Signed-off-by: Logan Gunthorpe --- block/blk-exec.c | 2 ++ 1 file changed, 2

[PATCH v6 10/16] nvmet-passthru: add enable/disable helpers

2019-07-25 Thread Logan Gunthorpe
similar one by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 8 +++ drivers/nvme/target/io-cmd-passthru.c | 77 +++ drivers/nvme/target/nvmet.h | 10 3 files changed, 95 insertions

[PATCH v6 04/16] nvme-core: introduce nvme_get_by_path()

2019-07-25 Thread Logan Gunthorpe
nvme_get_by_path() is analagous to blkdev_get_by_path() except it gets a struct nvme_ctrl from the path to its char dev (/dev/nvme0). The purpose of this function is to support NVMe-OF target passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/host/core.c | 23

[PATCH v6 12/16] nvmet-core: don't check the data len for pt-ctrl

2019-07-25 Thread Logan Gunthorpe
rence subsys->passthru_ctrl if CONFIG_NVME_TARGET_PASSTHRU is not set] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 9e92486e2ee9..77660dfc6c8

[PATCH v6 14/16] block: don't check blk_rq_is_passthrough() in blk_do_io_stat()

2019-07-25 Thread Logan Gunthorpe
Instead of checking blk_rq_is_passthruough() for every call to blk_do_io_stat(), don't set RQF_IO_STAT for passthrough requests. This should be equivalent, and opens the possibility of passthrough requests specifically requesting statistics tracking. Signed-off-by: Logan Gunthorpe --- bloc

[PATCH v6 16/16] nvmet-passthru: support block accounting

2019-07-25 Thread Logan Gunthorpe
Support block disk accounting by setting the RQF_IO_STAT flag and gendisk in the request. After this change, IO counts will be reflected correctly in /proc/diskstats for drives being used by passthru. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/io-cmd-passthru.c | 5 - 1 file

[PATCH v6 03/16] chardev: export cdev_put()

2019-07-25 Thread Logan Gunthorpe
In order to use the new cdev_get_by_path() helper in a module, cdev_put() must be exported as well. Signed-off-by: Logan Gunthorpe Cc: Greg Kroah-Hartman Cc: Alexander Viro --- fs/char_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/char_dev.c b/fs/char_dev.c index 25037d642ff8

[PATCH v6 13/16] nvmet-configfs: introduce passthru configfs interface

2019-07-25 Thread Logan Gunthorpe
subsystem to use passthru. Any given subsystem is prevented from enabling both a regular namespace and the passthru device. If one is enabled, enabling the other will produce an error. Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/configfs.c | 99 ++ dr

[PATCH v6 00/16] nvmet: add target passthru commands support

2019-07-25 Thread Logan Gunthorpe
) nvmet-passthru: update KConfig with config passthru option nvmet-passthru: add passthru code to process commands nvmet-core: allow one host per passthru-ctrl nvmet-core: don't check the data len for pt-ctrl Logan Gunthorpe (10): chardev: factor out cdev_lookup() helper cha

[PATCH v6 01/16] chardev: factor out cdev_lookup() helper

2019-07-25 Thread Logan Gunthorpe
-off-by: Logan Gunthorpe Cc: Greg Kroah-Hartman Cc: Alexander Viro --- fs/char_dev.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/char_dev.c b/fs/char_dev.c index 00dfe17871ac..5cc53bd5f654 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c

[PATCH v6 11/16] nvmet-core: allow one host per passthru-ctrl

2019-07-25 Thread Logan Gunthorpe
subsys into functions in passthru-cmd.c to avoid excess inline #ifdefs ] Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/core.c| 6 + drivers/nvme/target/io-cmd-passthru.c | 32 +++ drivers/nvme/target/nvmet.h | 10 + 3 files

[PATCH v6 08/16] nvmet-passthru: update KConfig with config passthru option

2019-07-25 Thread Logan Gunthorpe
From: Chaitanya Kulkarni This patch updates KConfig file for the NVMeOF target where we add new option so that user can selectively enable/disable passthru code. Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed some of the wording in the help message] Signed-off-by: Logan

[PATCH v6 02/16] chardev: introduce cdev_get_by_path()

2019-07-25 Thread Logan Gunthorpe
cdev_get_by_path() attempts to retrieve a struct cdev from a path name. It is analagous to blkdev_get_by_path(). This will be necessary to create a nvme_ctrl_get_by_path()to support NVMe-OF passthru. Signed-off-by: Logan Gunthorpe Cc: Greg Kroah-Hartman Cc: Alexander Viro --- fs/char_dev.c

[PATCH v6 07/16] nvmet: make nvmet_copy_ns_identifier() non-static

2019-07-25 Thread Logan Gunthorpe
This function will be needed by the upcoming passthru code. [chaitanya.kulka...@wdc.com: this was factored out of a patch originally authored by Chaitanya] Signed-off-by: Chaitanya Kulkarni Signed-off-by: Logan Gunthorpe --- drivers/nvme/target/admin-cmd.c | 4 ++-- drivers/nvme/target

[PATCH v6 06/16] nvmet: add return value to nvmet_add_async_event()

2019-07-25 Thread Logan Gunthorpe
From: Chaitanya Kulkarni Change the return value for nvmet_add_async_event(). This change is needed for the target passthru code to generate async events. Signed-off-by: Chaitanya Kulkarni [log...@deltatee.com: fixed up commit message that was no longer accurate] Signed-off-by: Logan

Re: [PATCH blktests v2 03/12] nvme: Add new test to verify the generation counter

2019-07-18 Thread Logan Gunthorpe
On 2019-07-18 1:03 a.m., Johannes Thumshirn wrote: > On Wed, Jul 17, 2019 at 11:12:50AM -0600, Logan Gunthorpe wrote: > [...] >> +_discovery_genctr() { >> +nvme discover -t loop | >> +sed -n -e 's/^.*Generation counter \([0-9]\+\).*$/\1/p' >&

[PATCH blktests v2 11/12] common: Use sysfs instead of modinfo for _have_module_param()

2019-07-17 Thread Logan Gunthorpe
Using modinfo fails if the given module is built-in. Instead, if the module is already in the kernel, check for the parameter in sysfs. Signed-off-by: Logan Gunthorpe --- common/rc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/common/rc b/common/rc index a487cc69026c..41aee3aaa735

[PATCH blktests v2 04/12] nvme/003,004: Add missing calls to nvme disconnect

2019-07-17 Thread Logan Gunthorpe
Tests 003 and 004 do not call nvme disconnect. In most cases it is cleaned up by removing the modules but it should be made explicit. Signed-off-by: Logan Gunthorpe --- tests/nvme/003 | 1 + tests/nvme/003.out | 1 + tests/nvme/004 | 1 + tests/nvme/004.out | 1 + 4 files changed, 4

[PATCH blktests v2 12/12] nvme: Ignore errors when removing modules

2019-07-17 Thread Logan Gunthorpe
developers that want to run the tests in a simple VM. Signed-off-by: Logan Gunthorpe --- tests/nvme/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index a6b4d5938680..348b4a3c2cbc 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -68,8 +68,8

[PATCH blktests v2 03/12] nvme: Add new test to verify the generation counter

2019-07-17 Thread Logan Gunthorpe
Now that the other discovery tests ignore the generation counter value, create a new test to specifically check that it increments when subsystems are added or removed from ports and when allow_any_host is set/unset. Signed-off-by: Logan Gunthorpe --- tests/nvme/030 | 76

[PATCH blktests v2 01/12] Add filter function for nvme discover

2019-07-17 Thread Logan Gunthorpe
greater than 1, so the new filter function was expanded to replace the Generation counter with 'X'. Signed-off-by: Michael Moese [log...@deltatee.com: added missing changes to 002.out and 017.out] Signed-off-by: Logan Gunthorpe --- tests/nvme/002 | 2 +- tests/nvme/002.out | 2 +- test

[PATCH blktests v2 07/12] nvme/018: Ignore error message generated by nvme read

2019-07-17 Thread Logan Gunthorpe
message content, it's only important that a read past the end of the file fails. Therefore, pipe stderr of nvme-cli to /dev/null. Signed-off-by: Logan Gunthorpe --- tests/nvme/018 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/nvme/018 b/tests/nvme/018

  1   2   3   4   >