[PATCH 1/2] block: move dif_prepare/dif_complete functions to block layer

2018-07-22 Thread Max Gurtovoy
Currently these functions are implemented in the scsi layer, but their actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max

[PATCH 2/2] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-22 Thread Max Gurtovoy
ersen Signed-off-by: Max Gurtovoy --- drivers/nvme/host/core.c | 23 +-- drivers/nvme/host/nvme.h | 9 +- drivers/nvme/host/pci.c | 75 +--- 3 files changed, 23 insertions(+), 84 deletions(-) diff --git a/drivers/nvme/host/core.c b/dr

Re: [PATCH 1/2] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 4:54 AM, Martin K. Petersen wrote: Christoph, +void blk_integrity_dif_prepare(struct request *rq, u8 protection_type, + u32 ref_tag) +{ Maybe call this blk_t10_pi_prepare? The rest of these functions have a blk_integrity_ prefix. So either stick

[PATCH 1/3] block: move ref_tag calculation func to the block layer

2018-07-24 Thread Max Gurtovoy
Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by

[PATCH 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-24 Thread Max Gurtovoy
ersen Signed-off-by: Max Gurtovoy --- changes from v1: - check status of nvme_req instead of converting to BLK_STS --- drivers/nvme/host/core.c | 18 drivers/nvme/host/nvme.h | 9 +- drivers/nvme/host/pci.c | 75 +--- 3 files ch

[PATCH 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Max Gurtovoy
. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v1 (Christoph, Martin and Keith comments): - moved the functions to t10-pi.c - updated tuple size - changed local variables scope - remove/add new lines --- block/t10-pi.c

Re: [PATCH 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 4:55 PM, Christoph Hellwig wrote: +/* + * The virtual start sector is the one that was originally submitted + * by the block layer. Due to partitioning, MD/DM cloning, etc. the + * actual physical start sector is likely to be different. Remap + * protection information to match t

Re: [PATCH 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 11:33 PM, Keith Busch wrote: On Tue, Jul 24, 2018 at 04:33:41PM +0300, Max Gurtovoy wrote: +void t10_pi_prepare(struct request *rq, u8 protection_type) +{ + const int tuple_sz = rq->q->integrity.tuple_size; + u32 ref_tag = t10_pi_ref_tag(rq); + struct bi

[PATCH v3 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-25 Thread Max Gurtovoy
g Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v2: - add Reviewed-by tag changes from v1: - check status of nvme_req instead of converting to BLK_STS --- drivers/nvme/host/core.c | 18 drivers/nvme/host/nvme.h | 9 +- drivers/nvme/host/

[PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Max Gurtovoy
. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v2: - convert comments to kerneldoc format - removed SCSI specific comment - fix kmap_atomic/kunmap_atomic addresses - fix iteration over t10_pi_tuple's changes fr

[PATCH v3 1/3] block: move ref_tag calculation func to the block layer

2018-07-25 Thread Max Gurtovoy
Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by

Re: [PATCH v3 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Max Gurtovoy
On 7/25/2018 2:22 PM, Christoph Hellwig wrote: + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; + p = pmap; Maybe: pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; + for (j = 0; j < iv.bv_len; j +=

[PATCH v4 1/3] block: move ref_tag calculation func to the block layer

2018-07-25 Thread Max Gurtovoy
Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by

[PATCH v4 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-25 Thread Max Gurtovoy
ersen Signed-off-by: Max Gurtovoy --- drivers/nvme/host/core.c | 18 drivers/nvme/host/nvme.h | 9 +- drivers/nvme/host/pci.c | 75 +--- 3 files changed, 20 insertions(+), 82 deletions(-) diff --git a/drivers/nvme/host/core.c b/dr

[PATCH v4 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-25 Thread Max Gurtovoy
. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v3: - kmap_atomic/kunmap_atomic the same address - declare pi struct inside the inner for loop - check "intervals" inside the for loop condition changes from v2:

Re: [PATCH v4 1/3] block: move ref_tag calculation func to the block layer

2018-07-28 Thread Max Gurtovoy
On 7/27/2018 6:38 PM, Jens Axboe wrote: On 7/27/18 9:21 AM, Jens Axboe wrote: On 7/25/18 9:46 AM, Max Gurtovoy wrote: Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is us

[PATCH v5 1/3] block: move ref_tag calculation func to the block layer

2018-07-29 Thread Max Gurtovoy
Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by

[PATCH v5 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-29 Thread Max Gurtovoy
. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v4: - added Martin's Reviewed-by. changes from v3: - kmap_atomic/kunmap_atomic the same address - declare pi struct inside the inner for

[PATCH v5 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-29 Thread Max Gurtovoy
ersen Reviewed-by: Martin K. Petersen Acked-by: Keith Busch Signed-off-by: Max Gurtovoy --- changes from v4: - Added Martin's and Keith's signatures --- drivers/nvme/host/core.c | 18 drivers/nvme/host/nvme.h | 9 +- drivers/nvme/h

Re: [PATCH] block: fix rdma queue mapping

2018-08-19 Thread Max Gurtovoy
Hi Sagi, did you have a chance to look on Israel's and mine fixes that we attached to the first thread ? there are few issues with this approach. For example in case you don't have a "free" cpu in the mask for Qi and you take cpu from Qi+j mask. Also in case we have a non-symetrical affinity

Re: [PATCH 1/6] nvme: don't disable local ints for polled queue

2018-11-14 Thread Max Gurtovoy
On 11/10/2018 5:13 PM, Jens Axboe wrote: A polled queued doesn't trigger interrupts, so it's always safe to grab the queue lock without disabling interrupts. Jens, can you share the added value in performance for this change ? Cc: Keith Busch Cc: linux-n...@lists.infradead.org Signed-o

Re: [PATCH 07/17] nvme-fc: use nr_phys_segments to determine existence of sgl

2019-03-14 Thread Max Gurtovoy
On 3/13/2019 7:55 PM, Christoph Hellwig wrote: From: James Smart For some nvme command, when issued by the nvme core layer, there is an internal buffer which can cause blk_rq_payload_bytes() to return a non-zero value yet there is no actual/real command payload and sg list. An example is the

Re: [RFC/PATCH net-next 0/9] net/dim: Support for multiple implementations

2019-03-14 Thread Max Gurtovoy
On 3/7/2019 3:56 AM, Sagi Grimberg wrote: net_dim.h lib exposes an implementation of the DIM algorithm for dynamically-tuned interrupt moderation for networking interfaces. We need the same behavior for any block CQ. The main motivation is two benefit from maximized completion rate and re

Re: [RFC/PATCH net-next 0/9] net/dim: Support for multiple implementations

2019-03-18 Thread Max Gurtovoy
On 3/18/2019 11:24 AM, Yamin Friedman wrote: On 3/14/2019 1:45 PM, Max Gurtovoy wrote: On 3/7/2019 3:56 AM, Sagi Grimberg wrote: net_dim.h lib exposes an implementation of the DIM algorithm for dynamically-tuned interrupt moderation for networking interfaces. We need the same behavior for

Re: [RFC/PATCH net-next 0/9] net/dim: Support for multiple implementations

2019-03-18 Thread Max Gurtovoy
On 3/18/2019 1:08 PM, Max Gurtovoy wrote: On 3/18/2019 11:24 AM, Yamin Friedman wrote: On 3/14/2019 1:45 PM, Max Gurtovoy wrote: On 3/7/2019 3:56 AM, Sagi Grimberg wrote: net_dim.h lib exposes an implementation of the DIM algorithm for dynamically-tuned interrupt moderation for networking

Re: [RFC/PATCH net-next 0/9] net/dim: Support for multiple implementations

2019-03-20 Thread Max Gurtovoy
On 3/18/2019 11:34 PM, Sagi Grimberg wrote: As we discussed, let's check with RDMA maintainers if it's better to extend alloc_cq API or create alloc_cq_dim API function. Sagi/Christoph, how about adding a module param per ULP ? as we use register_always today, create a use_dimm module par

Re: [PATCH rfc 5/6] block: Add rdma affinity based queue mapping helper

2017-04-04 Thread Max Gurtovoy
_GPL(blk_mq_rdma_map_queues); Otherwise, Looks good. Reviewed-by: Max Gurtovoy

Re: [PATCH rfc 0/6] Automatic affinity settings for nvme over rdma

2017-04-04 Thread Max Gurtovoy
Any feedback is welcome. Hi Sagi, the patchset looks good and of course we can add support for more drivers in the future. have you run some performance testing with the nvmf initiator ? Sagi Grimberg (6): mlx5: convert to generic pci_alloc_irq_vectors mlx5: move affinity hints assig

[PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

2017-06-28 Thread Max Gurtovoy
2142.8K/2152.2K 1395.5K/1374.2K Signed-off-by: Max Gurtovoy --- block/blk-mq-cpumap.c | 68 - 1 files changed, 22 insertions(+), 46 deletions(-) diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index 8e61e86..2cca4fc 100644

Re: [PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

2017-06-28 Thread Max Gurtovoy
On 6/28/2017 5:38 PM, Sagi Grimberg wrote: Hi Max, Hi Sagi, This patch performs sequential mapping between CPUs and queues. In case the system has more CPUs than HWQs then there are still CPUs to map to HWQs. In hyperthreaded system, map the unmapped CPUs and their siblings to the same HW

Re: [PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

2017-06-28 Thread Max Gurtovoy
On 6/28/2017 5:58 PM, Sagi Grimberg wrote: +static int cpu_to_queue_index(unsigned int nr_queues, const int cpu, + const struct cpumask *online_mask) { -return cpu * nr_queues / nr_cpus; +/* + * Non online CPU will be mapped to queue index 0. + */ +if (!

Re: [PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

2017-06-28 Thread Max Gurtovoy
336.6K/1355.1K/1361.6K 16k690K/690K/691K 32k348K/348K/348K 64k174K/174K/174K 128k 87K/87K/87K My conclusion is that Sagi's patch is correct (although we see little bit less performance: 100K-200K less for small block sizes) so you can add: Tested-by: Max Gurtovoy Nevertheless

Re: block and nvme polling improvements

2018-11-26 Thread Max Gurtovoy
On 11/21/2018 6:23 PM, Christoph Hellwig wrote: Hi all, this series optimizes a few bits in the block layer and nvme code related to polling. It starts by moving the queue types recently introduce entirely into the block layer instead of requiring an indirect call for them. It then switches

Re: [PATCH 04/11] nvme-core: add work elements to struct nvme_ctrl

2018-11-17 Thread Max Gurtovoy
On 11/15/2018 7:16 PM, Sagi Grimberg wrote: connect_work and err_work will be reused by nvme-tcp so share those in nvme_ctrl for rdma and fc to share. Signed-off-by: Sagi Grimberg looks good (and I see that more sharing should be made in the future as well :) ) Reviewed-by: Max

Re: [PATCH 05/11] nvmet: Add install_queue callout

2018-11-17 Thread Max Gurtovoy
sure regarding the INVALID_PARAM rc. maybe use NVME_SC_INTERNAL ? otherwise, look fine, Reviewed-by: Max Gurtovoy

Re: [PATCH 06/11] nvmet: allow configfs tcp trtype configuration

2018-11-17 Thread Max Gurtovoy
}, { NVMF_TRTYPE_LOOP, "loop" }, }; looks good, Reviewed-by: Max Gurtovoy

Re: [PATCH 10/11] nvmet-tcp: add NVMe over TCP target driver

2018-11-17 Thread Max Gurtovoy
On 11/17/2018 10:15 PM, David Miller wrote: From: Sagi Grimberg Date: Thu, 15 Nov 2018 09:16:22 -0800 +static unsigned nvmet_tcp_recv_budget = 8; +module_param_named(recv_budget, nvmet_tcp_recv_budget, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(recv_budget, "recvs budget"); + +static unsigne

Re: [PATCH v3 13/13] nvme-tcp: add NVMe over TCP host driver

2018-11-26 Thread Max Gurtovoy
+static enum blk_eh_timer_return +nvme_tcp_timeout(struct request *rq, bool reserved) +{ +    struct nvme_tcp_request *req = blk_mq_rq_to_pdu(rq); +    struct nvme_tcp_ctrl *ctrl = req->queue->ctrl; +    struct nvme_tcp_cmd_pdu *pdu = req->pdu; + +    dev_dbg(ctrl->ctrl.device, +    "queue %d

Re: [PATCH v3 13/13] nvme-tcp: add NVMe over TCP host driver

2018-11-27 Thread Max Gurtovoy
On 11/27/2018 9:48 AM, Sagi Grimberg wrote: This looks odd.  It's not really the timeout handlers job to call nvme_end_request here. Well.. if we are not yet LIVE, we will not trigger error recovery, which means nothing will complete this command so something needs to do it... I think that

Re: [PATCH v4 11/13] nvmet-tcp: add NVMe over TCP target driver

2018-11-28 Thread Max Gurtovoy
hi Sagi, +static inline void nvmet_tcp_put_cmd(struct nvmet_tcp_cmd *cmd) +{ + if (unlikely(cmd == &cmd->queue->connect)) + return; if you don't return connect cmd to the list please don't add it to it in the first place (during alloc_cmd). and if you use it once, we migh

Re: [PATCH] blk-mq: Iterate also over sched_tags requests at blk_mq_tagset_iter()

2017-10-23 Thread Max Gurtovoy
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index c81b40e..c290de0 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -322,6 +322,22 @@ int blk_mq_tagset_iter(struct blk_mq_tag_set *set, void *data,   }   } +    for (i = 0; i < set->nr_hw_queues; i++) { +    s

Re: [PATCH 04/17] block: add a blk_steal_bios helper

2017-10-24 Thread Max Gurtovoy
On 10/23/2017 5:51 PM, Christoph Hellwig wrote: This helpers allows to bounce steal the uncompleted bios from a request so that they can be reissued on another path. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- block/blk-core.c | 20 include/l

Re: kernel 4.14 how to install Mellanox connectx-3 infiniband driver?

2017-11-09 Thread Max Gurtovoy
On 11/9/2017 5:20 PM, Tony Yang wrote: Hi, All I downloaded the nvme with multipath kernel, The kernel version is 4.14, I encountered a problem, I use Mellanox connectx-3 infiniband driver. Because the 4.14 kernel version is too new to install infiniband driver, does anyone encounter with m

Re: NVMe induced NULL deref in bt_iter()

2017-07-02 Thread Max Gurtovoy
On 7/2/2017 2:56 PM, Sagi Grimberg wrote: On 02/07/17 13:45, Max Gurtovoy wrote: On 6/30/2017 8:26 PM, Jens Axboe wrote: Hi Max, Hi Jens, I remembered you reporting this. I think this is a regression introduced with the scheduling, since ->rqs[] isn't static anymore. ->

Re: NVMe induced NULL deref in bt_iter()

2017-07-03 Thread Max Gurtovoy
On 7/3/2017 3:03 PM, Ming Lei wrote: On Mon, Jul 03, 2017 at 01:07:44PM +0300, Sagi Grimberg wrote: Hi Ming, Yeah, the above change is correct, for any canceling requests in this way we should use blk_mq_quiesce_queue(). I still don't understand why should blk_mq_flush_busy_ctxs hit a NULL

Re: [PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

2017-07-05 Thread Max Gurtovoy
On 7/5/2017 10:59 AM, Johannes Thumshirn wrote: On Wed, Jun 28, 2017 at 03:44:40PM +0300, Max Gurtovoy wrote: This patch performs sequential mapping between CPUs and queues. In case the system has more CPUs than HWQs then there are still CPUs to map to HWQs. In hyperthreaded system, map the

[PATCH 1/1] null_blk: fix error flow for shared tags during module_init

2017-07-06 Thread Max Gurtovoy
In case we use shared tags feature, blk_mq_alloc_tag_set might fail during module initialization. Check the return value and default to run without shared tag set before continuing. Also move the tagset initialization process after defining the amount of submition queues. Signed-off-by: Max

Re: [PATCH 1/1] null_blk: fix error flow for shared tags during module_init

2017-07-06 Thread Max Gurtovoy
On 7/6/2017 5:02 PM, Jens Axboe wrote: On 07/06/2017 07:24 AM, Max Gurtovoy wrote: In case we use shared tags feature, blk_mq_alloc_tag_set might fail during module initialization. Check the return value and default to run without shared tag set before continuing. Also move the tagset

[PATCH v2 1/1] null_blk: fix error flow for shared tags during module_init

2017-07-06 Thread Max Gurtovoy
In case we use shared tags feature, blk_mq_alloc_tag_set might fail during module initialization. In that case, fail the load with the suitble error code. Also move the tagset initialization process after defining the amount of submition queues. Signed-off-by: Max Gurtovoy --- Changes from v1

Re: [BUG] nvme driver crash

2017-07-27 Thread Max Gurtovoy
t ignore tagset allocation failures the nvme_dev_add() function silently ignores failures. In case blk_mq_alloc_tag_set fails, we hit NULL deref while calling blk_mq_init_queue during nvme_alloc_ns with tagset == NULL. Instead, we'll not issue the scan_work in case tagset allocation failed and leave t

Re: [PATCH] blk-mq: Fix queue usage on failed request allocation

2017-08-15 Thread Max Gurtovoy
pt counter/q_usage_counter when allocating rq failed") Reported-by: Max Gurtovoy Signed-off-by: Keith Busch --- tested with 4.13-rc5+ using the following commands in a loop: 1. modprobe nvme 2. sleep 10 3. modprobe -r nvme Looks good, Tested-by: Max Gurtovoy

Re: [PATCH 0/3] Move tagset reinit to its only current consumer, nvme-core

2017-09-07 Thread Max Gurtovoy
++-- 6 files changed, 27 insertions(+), 13 deletions(-) The series looks good to me, Reviewed-by: Max Gurtovoy BTW, if we talking about the reinit_tagset, can you explain the motivation for dereg_mr and alloc new mr for the RDMA transport layer ? we don't do it in iSER/SRP so I wonder wh

how can one drain MQ request queue ?

2018-02-20 Thread Max Gurtovoy
hi all, is there a way to drain a blk-mq based request queue (similar to blk_drain_queue for non MQ) ? I try to fix the following situation: Running DM-multipath over NVMEoF/RDMA block devices, toggling the switch ports during traffic using fio and making sure the traffic never fails. when t

Re: how can one drain MQ request queue ?

2018-02-22 Thread Max Gurtovoy
On 2/22/2018 4:59 AM, Ming Lei wrote: Hi Max, Hi Ming, On Tue, Feb 20, 2018 at 11:56:07AM +0200, Max Gurtovoy wrote: hi all, is there a way to drain a blk-mq based request queue (similar to blk_drain_queue for non MQ) ? Generally speaking, blk_mq_freeze_queue() should be fine to drain

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

2019-08-14 Thread Max Gurtovoy
(+) Looks good, Reviewed-by: Max Gurtovoy

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

2019-08-14 Thread Max Gurtovoy
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 async events. As a stand alone commit it's not clear what is the purpose of it. Please add some extra ex

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

2019-08-14 Thread Max Gurtovoy
On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: This function will be needed by the upcoming passthru code. Same here. As a standalone commit I can't take a lot from here. Maybe should be squashed ? [chaitanya.kulka...@wdc.com: this was factored out of a patch originally authored by Chaita

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

2019-08-14 Thread Max Gurtovoy
, incuding executing Vendor Unique Commands. + config NVME_TARGET_LOOP tristate "NVMe loopback device support" depends on NVME_TARGET Looks good, Reviewed-by: Max Gurtovoy

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

2019-08-15 Thread Max Gurtovoy
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() to open the file and uses the private data to obtain a pointer to the struct nvme_ct

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

2019-08-15 Thread Max Gurtovoy
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 assigned to each nvme_ctrl by using an xarray on the cntlid. [chaitanya.kulka...@wdc.co

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

2019-08-15 Thread Max Gurtovoy
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 controller we check if the subsys associated with the passthru ctrl is already connected to a host an

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

2019-08-15 Thread Max Gurtovoy
On 8/2/2019 2:45 AM, Logan Gunthorpe wrote: When CONFIG_NVME_TARGET_PASSTHRU as 'passthru' directory will be added to each subsystem. The directory is similar to a namespace and has two attributes: device_path and enable. The user must set the path to the nvme controller's char device and write

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

2019-08-18 Thread Max Gurtovoy
On 8/15/2019 7:06 PM, Logan Gunthorpe wrote: 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

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

2019-08-22 Thread Max Gurtovoy
On 8/22/2019 3:09 AM, 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, let's say you limit the access to this

[PATCH 4/4] nvmet-loop: fix possible leakage during error flow

2019-09-03 Thread Max Gurtovoy
During nvme_loop_queue_rq error flow, one must call nvme_cleanup_cmd since it's symmetric to nvme_setup_cmd. Signed-off-by: Max Gurtovoy --- drivers/nvme/target/loop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/l

[PATCH 1/4] block: centrelize PI remapping logic to the block layer

2019-09-03 Thread Max Gurtovoy
Signed-off-by: Max Gurtovoy --- block/blk-core.c | 6 ++ block/blk-mq.c | 4 block/t10-pi.c | 11 --- drivers/nvme/host/core.c | 28 +++- drivers/scsi/sd.c| 28 ++-- drivers/scsi/sd.h| 1

[PATCH 2/4] nvme-rdma: simplify error flow in nvme_rdma_queue_rq

2019-09-03 Thread Max Gurtovoy
Make the error flow symmetric to the good flow by moving the call to nvme_cleanup_cmd from nvme_rdma_unmap_data function. Signed-off-by: Max Gurtovoy --- drivers/nvme/host/rdma.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers

[PATCH 3/4] nvme-tcp: introduce nvme_tcp_complete_rq callback

2019-09-03 Thread Max Gurtovoy
The nvme_cleanup_cmd function should be called to avoid resource leakage (it's the opposite to nvme_setup_cmd). Fix the error flow during command submission and also fix the missing call in command completion. Signed-off-by: Max Gurtovoy --- drivers/nvme/host/tcp.c | 11 +-- 1

Re: [PATCH 1/4] block: centrelize PI remapping logic to the block layer

2019-09-04 Thread Max Gurtovoy
On 9/4/2019 8:49 AM, Christoph Hellwig wrote: On Tue, Sep 03, 2019 at 01:21:59PM -0600, Jens Axboe wrote: On 9/3/19 1:11 PM, Sagi Grimberg wrote: + if (blk_integrity_rq(req) && req_op(req) == REQ_OP_READ && + error == BLK_STS_OK) + t10_pi_complete(req, +

Re: [PATCH 3/4] nvme-tcp: introduce nvme_tcp_complete_rq callback

2019-09-04 Thread Max Gurtovoy
On 9/4/2019 8:54 AM, Christoph Hellwig wrote: On Tue, Sep 03, 2019 at 12:15:48PM -0700, Sagi Grimberg wrote: The nvme_cleanup_cmd function should be called to avoid resource leakage (it's the opposite to nvme_setup_cmd). Fix the error flow during command submission and also fix the missing cal

[PATCH v2 1/1] block: centralize PI remapping logic to the block layer

2019-09-04 Thread Max Gurtovoy
Signed-off-by: Max Gurtovoy --- changes from v1: - seperate from nvme_cleanup command patches - introduce blk_integrity_interval_shift to avoid div in fast path --- block/blk-core.c | 6 ++ block/blk-mq.c | 4 block/blk-settings.c | 1 + block/t10-pi.c

[PATCH 2/3] block: don't remap ref tag for T10 PI type 0

2019-09-05 Thread Max Gurtovoy
Only type 1 and type 2 have a reference tag by definition. Suggested-by: Keith Busch Signed-off-by: Max Gurtovoy --- block/t10-pi.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index 7d9a151..088c3c7 100644 --- a/block/t10-pi.c

[PATCH 3/3] nvme: remove PI values definition from NVMe subsystem

2019-09-05 Thread Max Gurtovoy
Use block layer definition instead of re-defining it with the same values. Suggested-by: Christoph Hellwig Signed-off-by: Max Gurtovoy --- drivers/nvme/host/core.c | 12 ++-- include/linux/nvme.h | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/nvme

[PATCH v3 1/3] block: centralize PI remapping logic to the block layer

2019-09-05 Thread Max Gurtovoy
Signed-off-by: Max Gurtovoy --- changes from v2: - remove local variable for protection_type - remove remapping between NVMe T10 definition to blk definition - added patches 2/3 and 3/3 - remove pi_type from ns structure changes from v1: - seperate from nvme_cleanup command patches - introduce

Re: [PATCH 3/3] nvme: remove PI values definition from NVMe subsystem

2019-09-05 Thread Max Gurtovoy
On 9/5/2019 11:52 PM, Sagi Grimberg wrote: Use block layer definition instead of re-defining it with the same values. The nvme_setup_rw is fine, but nvme_init_integrity gets values from the controller id structure so I think it will be better to stick with the enums that are referenced in t

[PATCH v4 3/3] nvme: remove PI values definition from NVMe subsystem

2019-09-08 Thread Max Gurtovoy
Use block layer definition instead of re-defining it with the same values. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Max Gurtovoy --- changes from v3: - added Reviewed-by signature --- drivers/nvme/host/core.c | 12 ++-- include/linux/nvme.h

[PATCH v4 1/3] block: centralize PI remapping logic to the block layer

2019-09-08 Thread Max Gurtovoy
Signed-off-by: Max Gurtovoy --- changes from v3: - fix > 80 liner - move the protection_type assignment into nvme_update_disk_info - added a comment regarding dps and DIF type values - drop redundant externs from t10-pi.h changes from v2: - remove local variable for protection_t

[PATCH v4 2/3] block: don't remap ref tag for T10 PI type 0

2019-09-08 Thread Max Gurtovoy
Only type 1 and type 2 have a reference tag by definition. Suggested-by: Keith Busch Signed-off-by: Max Gurtovoy --- changes from v3: - added blk_integrity_need_remap helper --- block/t10-pi.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/block/t10-pi.c

Re: [PATCH v4 2/3] block: don't remap ref tag for T10 PI type 0

2019-09-09 Thread Max Gurtovoy
On 9/9/2019 5:49 AM, Martin K. Petersen wrote: Keith, At least for nvme, type 0 means you have meta data but not for protection information, Yeah, NVMe does not support DIX Type 0. so remapping the place the where reference tag exists for other PI types corrupts the metadata. But the devi

Re: [PATCH v4 1/3] block: centralize PI remapping logic to the block layer

2019-09-09 Thread Max Gurtovoy
On 9/9/2019 5:21 AM, Martin K. Petersen wrote: Hi Max! Hi Martin, @@ -309,7 +308,7 @@ static void sd_set_flush_flag(struct scsi_disk *sdkp) { struct scsi_disk *sdkp = to_scsi_disk(dev); - return sprintf(buf, "%u\n", sdkp->protection_type); + return sprintf(buf, "%u\n"

Re: [PATCH v4 1/3] block: centralize PI remapping logic to the block layer

2019-09-10 Thread Max Gurtovoy
On 9/10/2019 5:29 AM, Martin K. Petersen wrote: Max, Hi Martin, thanks for the great explanation ! maybe we can add profiles to type0 and type2 in the future and have more readable code. It's a deliberate feature that we treat DIX Type 0, 1, and 2 the same. It's very common to mix and m

Re: [PATCH v4 1/3] block: centralize PI remapping logic to the block layer

2019-09-11 Thread Max Gurtovoy
On 9/11/2019 4:16 AM, Martin K. Petersen wrote: Max, I guess Type 1 and Type 3 mirrors can work because Type 3 doesn't have a ref tag, right ? It will work but you'll lose ref tag checking on the Type 3 side of the mirror. So not exactly desirable. And in our experience, the ref tag is hugel

[PATCH v5 1/2] block: use symbolic constants for t10_pi type

2019-09-11 Thread Max Gurtovoy
Signed-off-by: Max Gurtovoy --- block/t10-pi.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index 0c00946..7fed587 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -27,7 +27,7 @@ static __be16 t10_pi_ip_fn

[PATCH v5 2/2] block: centralize PI remapping logic to the block layer

2019-09-11 Thread Max Gurtovoy
.complete_fn callbacks within the integrity profile that each type can implement according to its needs. Suggested-by: Christoph Hellwig Suggested-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v4: - added .prepare_fn and .complete_fn callbacks - removed patches 2/3 and 3/3 from

[PATCH v6 1/2] block: use symbolic constants for t10_pi type

2019-09-14 Thread Max Gurtovoy
Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v5: - added Reviewed-by signature --- block/t10-pi.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index 0c00946..7fed587 100644

[PATCH 2/2] block: centralize PI remapping logic to the block layer

2019-09-14 Thread Max Gurtovoy
.complete_fn callbacks within the integrity profile that each type can implement according to its needs. Suggested-by: Christoph Hellwig Suggested-by: Martin K. Petersen Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v5: - removed extra new lines - use q pointer

[PATCH v7 1/2] block: use symbolic constants for t10_pi type

2019-09-16 Thread Max Gurtovoy
Replace all hard-coded values with T10_PI_TYPES to make the code more readable. Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v6: - added Reviewed-by signature - added commit message changes from v5: - added Reviewed-by

[PATCH v7 2/2] block: centralize PI remapping logic to the block layer

2019-09-16 Thread Max Gurtovoy
.complete_fn callbacks within the integrity profile that each type can implement according to its needs. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Suggested-by: Martin K. Petersen Reviewed-by: Martin K. Petersen Signed-off-by: Max Gurtovoy --- changes from v6: - added Reviewed

Re: [PATCH v7 2/2] block: centralize PI remapping logic to the block layer

2019-09-16 Thread Max Gurtovoy
On 9/16/2019 7:12 PM, Jens Axboe wrote: On 9/16/19 9:44 AM, Max Gurtovoy wrote: Currently t10_pi_prepare/t10_pi_complete functions are called during the NVMe and SCSi layers command preparetion/completion, but their actual place should be the block layer since T10-PI is a general data

[PATCH 1/1] block: add default clause for unsupported T10_PI types

2019-09-21 Thread Max Gurtovoy
st robot Signed-off-by: Max Gurtovoy --- block/t10-pi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/t10-pi.c b/block/t10-pi.c index 0c0120a..57f304a 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -79,6 +79,9 @@ static blk_status_t t10_pi_verify(struct blk_i

Re: [PATCH] block: t10-pi: fix -Wswitch warning

2019-09-21 Thread Max Gurtovoy
On 9/20/2019 9:05 AM, Nathan Chancellor wrote: On Thu, Sep 19, 2019 at 03:57:19PM +0200, Arnd Bergmann wrote: Changing the switch() statement to symbolic constants made the compiler (at least clang-9, did not check gcc) notice that there is one enum value that is not handled here: block/t10-p

Re: [PATCH 1/1] block: add default clause for unsupported T10_PI types

2019-09-22 Thread Max Gurtovoy
On 9/22/2019 2:29 AM, Jens Axboe wrote: On 9/21/19 4:54 PM, Martin K. Petersen wrote: Jens, block/t10-pi.c: In function 't10_pi_verify': block/t10-pi.c:62:3: warning: enumeration value 'T10_PI_TYPE0_PROTECTION' not handled in switch [-Wswitch] switch (type) {

Re: [PATCH 1/1] block: add default clause for unsupported T10_PI types

2019-09-22 Thread Max Gurtovoy
to silence compiler warnings. Seems backwards. I agree that enough energy wasted here :) Attached some proposal to fix this warning. Let me know if you want me to send it to the mailing list From 058b2e2da4ada6d27287533a7228abd80de17248 Mon Sep 17 00:00:00 2001 From: Max Gurtovoy Date: Sun, 22 Sep 20

[PATCH 1/1] virtio_blk: implement init_hctx MQ operation

2024-08-01 Thread Max Gurtovoy
In this operation set the driver data of the hctx to point to the virtio block queue. By doing so, we can use this reference in the and reduce the number of operations in the fast path. Signed-off-by: Max Gurtovoy --- drivers/block/virtio_blk.c | 42 -- 1

Re: [PATCH 1/1] virtio_blk: implement init_hctx MQ operation

2024-08-01 Thread Max Gurtovoy
On 01/08/2024 18:13, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06:11:37PM +0300, Max Gurtovoy wrote: In this operation set the driver data of the hctx to point to the virtio block queue. By doing so, we can use this reference in the and reduce in the ? sorry for the type

Re: [PATCH 1/1] virtio_blk: implement init_hctx MQ operation

2024-08-01 Thread Max Gurtovoy
On 01/08/2024 18:29, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06:17:21PM +0300, Max Gurtovoy wrote: On 01/08/2024 18:13, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06:11:37PM +0300, Max Gurtovoy wrote: In this operation set the driver data of the hctx to point to the virtio

Re: [PATCH 1/1] virtio_blk: implement init_hctx MQ operation

2024-08-02 Thread Max Gurtovoy
On 01/08/2024 20:56, Stefan Hajnoczi wrote: On Thu, Aug 01, 2024 at 06:56:44PM +0300, Max Gurtovoy wrote: On 01/08/2024 18:43, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06:39:16PM +0300, Max Gurtovoy wrote: On 01/08/2024 18:29, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06

Re: [PATCH 1/1] virtio_blk: implement init_hctx MQ operation

2024-08-03 Thread Max Gurtovoy
On 03/08/2024 15:39, Michael S. Tsirkin wrote: On Sat, Aug 03, 2024 at 01:07:27AM +0300, Max Gurtovoy wrote: On 01/08/2024 20:56, Stefan Hajnoczi wrote: On Thu, Aug 01, 2024 at 06:56:44PM +0300, Max Gurtovoy wrote: On 01/08/2024 18:43, Michael S. Tsirkin wrote: On Thu, Aug 01, 2024 at 06

[PATCH v2] virtio_blk: implement init_hctx MQ operation

2024-08-07 Thread Max Gurtovoy
Set the driver data of the hardware context (hctx) to point directly to the virtio block queue. This cleanup improves code readability and reduces the number of dereferences in the fast path. Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Gurtovoy --- drivers/block/virtio_blk.c | 42

Re: [PATCH v2] virtio_blk: implement init_hctx MQ operation

2024-09-16 Thread Max Gurtovoy
Hi Marek, On 12/09/2024 9:46, Marek Szyprowski wrote: Dear All, On 08.08.2024 00:41, Max Gurtovoy wrote: Set the driver data of the hardware context (hctx) to point directly to the virtio block queue. This cleanup improves code readability and reduces the number of dereferences in the fast

  1   2   >