Re: [RFC 19/34] iscsi-target: clear tx_thread_active

2016-02-15 Thread Sagi Grimberg
On 14/02/2016 19:42, Varun Prakash wrote: clear tx_thread_active for ISCSI_TCP_CXGB4 transport in logout_post_handler functions. Signed-off-by: Varun Prakash --- drivers/target/iscsi/iscsi_target.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

Re: [RFC 18/34] iscsi-target: call complete on conn_logout_comp

2016-02-15 Thread Sagi Grimberg
On 14/02/2016 19:42, Varun Prakash wrote: ISCSI_TCP_CXGB4 driver waits on conn_logout_comp as ISCSI_TCP driver so call complete if transport type is ISCSI_TCP_CXGB4. Signed-off-by: Varun Prakash --- drivers/target/iscsi/iscsi_target.c | 10 ++ 1 file changed, 6

Re: [PATCH] target: Fix incorrect unmap_zeroes_data_store return

2016-02-11 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-08 Thread Sagi Grimberg
Do we have defined sysfs attributes for NVMe devices nowadays? /sys/block/nvme0n1/uuid If so I'd be willing to create/send some sysfs rules for them. That'd be great! -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to

Re: [LSF/MM TOPIC] multiqueue and interrupt assignment

2016-02-03 Thread Sagi Grimberg
Indeed, something like this. Quite some issues would be solved if we could push a hctx mapping into blk-mq, instead of having it assign its own made-up one. For that you can provide your own .map_queue in blk_mq_ops I think (no one does that at the moment). This requires every driver to

Re: [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-28 Thread Sagi Grimberg
+ sess = cmd->se_sess; + if (WARN_ON_ONCE(!sess)) + continue; + + spin_lock(>sess_cmd_lock); + rc = __target_check_io_state(cmd); + spin_unlock(>sess_cmd_lock); + if (!rc) { +

[LSF/MM ATTEND] dm-multipath, nvme, (remote) pmem and friends

2016-01-28 Thread Sagi Grimberg
Hi, I'd like to attend LSF/MM 2016. I've been working on scsi rdma transports and the target stack for some time now. Lately I've been looking at nvme as well and I think I can contribute to the dm-multipath discussions in the context of nvme and blk-mq performance. If we plan to talk about

Re: [LSF/MM TOPIC] LIO/SCST Merger

2016-01-28 Thread Sagi Grimberg
I'm going to downvote this topic just like last year with my PC hat on as I think it's a) not relevant or usefully discussable at LSF and b) framed the wrong way. I'm not sure LSF is the right platform, but I gotta say that this thread indicates that there's bad blood going around here and it

Re: [PATCH 10/13] IB/srp: use the new CQ API

2015-12-13 Thread Sagi Grimberg
Allright. How do you want to proceed? The current rdma-cq branch has all kinds of dependencies, but I've also prepared a new rdma-cq.2 branch that could go straight on top of your current queue: http://git.infradead.org/users/hch/rdma.git/shortlog/refs/heads/rdma-cq.2 If you're ready to

Re: completion queue abstraction V2

2015-12-13 Thread Sagi Grimberg
Needless to say, on the entire series you can add my: Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] target: use offset_in_page macro

2015-11-25 Thread Sagi Grimberg
Looks fine, Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] Fix a memory leak in scsi_host_dev_release()

2015-11-24 Thread Sagi Grimberg
On 19/11/2015 00:56, Bart Van Assche wrote: Avoid that kmemleak reports the following memory leak if a SCSI LLD calls scsi_host_alloc() and scsi_host_put() but neither scsi_host_add() nor scsi_host_remove(). The following shell command triggers that scenario: Looks good, Reviewed-by: Sagi

Re: [PATCH] scsi: use sector_div instead of do_div

2015-11-24 Thread Sagi Grimberg
/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast This changes the code to use sector_div instead, which always produces optimal code. Signed-off-by: Arnd Bergmann <a...@arndb.de> Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from thi

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-23 Thread Sagi Grimberg
So Maybe we should have: void ib_drain_qp(struct ib_qp *qp) Christoph suggested that this flushing would be taken care of by rdma_disconnect which sounds even better I think.. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-23 Thread Sagi Grimberg
That won't work for iWARP. Is this code new? I didn't see any errors that would result from this code when I tested iSER over cxgb4 with the old iwarp support patches. Steve, I think I figured out why this works with iWARP. For iWARP, rdma_disconnect() calls iw_cm_disconnect() with

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-22 Thread Sagi Grimberg
I think that bart wants to allow the caller to select cpu affinity per CQ. In this case ib_alloc_cq in workqueue mode would need to accept a affinity_hint from the caller (default to wild-card WORK_CPU_UNBOUND). Hmm, true. How would be set that hint from userspace? I'd really prefer to see

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-22 Thread Sagi Grimberg
Wouldn't it be a better idea to set the WQ_SYSFS interface and use the standard sysfs interface for specifying cpumasks or node affinity? I think that bart wants to allow the caller to select cpu affinity per CQ. In this case ib_alloc_cq in workqueue mode would need to accept a affinity_hint

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-22 Thread Sagi Grimberg
Hello Christoph, The comment about locality in the above quote is interesting. How about modifying patch 2/9 as indicated below ? The modification below does not change the behavior of this patch if ib_cq.w.cpu is not modified. And it allows users who care about locality and who want to skip

Re: [PATCH] IB/srp: Fix a memory leak

2015-11-20 Thread Sagi Grimberg
ite+0x2f/0xf0 [] vfs_write+0xa4/0x100 [] SyS_write+0x54/0xc0 [] entry_SYSCALL_64_fastpath+0x12/0x6f Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Sagi Grimberg <sa...@mellanox.com> Cc: Sebastian Parschauer <sebastian.rie...@profitbricks.com> Cc: Christoph H

Re: [PATCH for-next 05/10] iser: Have initiator and target to share protocol structures and definitions

2015-11-19 Thread Sagi Grimberg
On 19/11/2015 09:20, Or Gerlitz wrote: On 11/16/2015 6:37 PM, Sagi Grimberg wrote: +/** + * struct iser_hello - iSER Hello header + * + * @opcode: opcode (must be set to ISER_HELLO) + * @max_min_ver: maximum and minimum iser versions + * @iser_ird: iSER IRD + * @rsvd

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-18 Thread Sagi Grimberg
Christoph, Given the discussion around this patch I think it would be a good idea remove it from the patchset since it's not mandatory for the CQ abstraction. I think that we should take it with Steve to come up with a complete solution for this bit. Thoughts? -- To unsubscribe from this list:

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-18 Thread Sagi Grimberg
On 17/11/2015 19:06, Bart Van Assche wrote: On 11/15/2015 01:34 AM, Sagi Grimberg wrote: This is taken from srp, and srp drains using a recv wr due to a race causing a use-after-free condition in srp which re-posts a recv buffer in the recv completion handler. Hello Sagi, Would

Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests

2015-11-18 Thread Sagi Grimberg
On 18/11/2015 03:17, Bart Van Assche wrote: On 11/13/2015 05:46 AM, Christoph Hellwig wrote: -ret = ib_post_send(ch->qp, , _wr); -if (ret) -break; +if (i == n_rdma - 1) { +/* only get completion event for the last rdma read */ +if

Re: [PATCH for-next 05/10] iser: Have initiator and target to share protocol structures and definitions

2015-11-17 Thread Sagi Grimberg
On 17/11/2015 10:59, Christoph Hellwig wrote: On Mon, Nov 16, 2015 at 06:37:36PM +0200, Sagi Grimberg wrote: The iser RDMA_CM negotiation protocol is shared by the initiator and the target, so have a shared header for the defines and structure. Move relevant items from the initiator

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-17 Thread Sagi Grimberg
That won't work for iWARP. Is this code new? I didn't see any errors that would result from this code when I tested iSER over cxgb4 with the old iwarp support patches. It's there since ~3.17 I think... Perhaps we need another way to do this? Like a completion object in the QP that

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-17 Thread Sagi Grimberg
Hi Bart, + */ +void ib_process_cq_direct(struct ib_cq *cq) +{ +WARN_ON_ONCE(cq->poll_ctx != IB_POLL_DIRECT); + +__ib_process_cq(cq, INT_MAX); +} +EXPORT_SYMBOL(ib_process_cq_direct); My proposal is to drop this function and to export __ib_process_cq() instead (with or without

[PATCH for-next 05/10] iser: Have initiator and target to share protocol structures and definitions

2015-11-16 Thread Sagi Grimberg
The iser RDMA_CM negotiation protocol is shared by the initiator and the target, so have a shared header for the defines and structure. Move relevant items from the initiator and target headers. Signed-off-by: Sagi Grimberg <sa...@mellanox.com> Signed-off-by: Jenny Derzhavetz <jen...@mel

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-16 Thread Sagi Grimberg
After looking at the nes driver, I don't see any common way to support drain w/o some serious driver mods. Since SRP is the only user, perhaps we can ignore iWARP for this function... But iser/isert essentially does it too (and I think xprtrdma will have it soon)... the modify_qp is

Re: [PATCH] ib_srp: initialize dma_length in srp_map_idb

2015-11-16 Thread Sagi Grimberg
On 15/11/2015 23:10, Or Gerlitz wrote: On Sun, Nov 15, 2015, Sagi Grimberg <sa...@dev.mellanox.co.il> wrote: On 15/11/2015 19:59, Christoph Hellwig wrote: Without this sg_dma_len will return 0 on architectures tha have the dma_length field. and what wrong with that? Becaus

Re: [PATCH 1/2] iscsi-target: Fix rx_login_comp hang after login failure

2015-11-16 Thread Sagi Grimberg
On 15/11/2015 02:21, Nicholas A. Bellinger wrote: From: Nicholas Bellinger This patch addresses a case where iscsi_target_do_tx_login_io() fails sending the last login response PDU, after the RX/TX threads have already been started. The case centers around

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-15 Thread Sagi Grimberg
+/** + * ib_process_direct_cq - process a CQ in caller context + * @cq:CQ to process + * + * This function is used to process all outstanding CQ entries on a + * %IB_POLL_DIRECT CQ. It does not offload CQ processing to a different + * context and does not ask from completion

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-15 Thread Sagi Grimberg
On Fri, Nov 13, 2015 at 3:46 PM, Christoph Hellwig wrote: The new name is irq_poll as iopoll is already taken. Better suggestions welcome. Sagi (or Christoph if you can address that), @ some pointer over the last 18 months there was a port done at mellanox for iser to use

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-15 Thread Sagi Grimberg
+ +struct ib_stop_cqe { + struct ib_cqe cqe; + struct completion done; +}; + +static void ib_stop_done(struct ib_cq *cq, struct ib_wc *wc) +{ + struct ib_stop_cqe *stop = + container_of(wc->wr_cqe, struct ib_stop_cqe, cqe); + + complete(>done); +} + +/* +

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-15 Thread Sagi Grimberg
On 15/11/2015 14:55, Christoph Hellwig wrote: On Sun, Nov 15, 2015 at 11:40:02AM +0200, Sagi Grimberg wrote: I doubt INT_MAX is useful as a budget in any use-case. it can easily hog the CPU. If the consumer is given access to poll a CQ, it must be able to provide some way to budget it. Why

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-15 Thread Sagi Grimberg
On 15/11/2015 11:04, Or Gerlitz wrote: On Sun, Nov 15, 2015 at 10:48 AM, Sagi Grimberg <sa...@dev.mellanox.co.il> wrote: Or is correct, I have attempted to convert iser to use blk_iopoll in the past, however I've seen inconsistent performance and latency skews (comparing to tasklet

Re: [PATCH] ib_srp: initialize dma_length in srp_map_idb

2015-11-15 Thread Sagi Grimberg
We should really get this properly map/unmap per IO at some point. Probably do it in both code paths... Having said that, Looks fine, Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord..

Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch

2015-11-12 Thread Sagi Grimberg
The bug is caused by this patch: 659743b02c411075b26601725947b21df0bb29c8 which allowed the task lists to be manipulated under different locks in the xmit and completion path. To fix the oops this patch just reverts that patch. It also reverts these 2 patches for regressions that were also a

Re: [PATCH] iscsi-target: return -ENOMEM instead of -1 in case of failed kmalloc()

2015-10-20 Thread Sagi Grimberg
<lui...@osg.samsung.com> Looks good, Reviewed-by: Sagi Grimberg <sa...@mellanox.com> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] scsi: Fix a bdi reregistration race

2015-09-20 Thread Sagi Grimberg
On 9/19/2015 3:23 AM, Bart Van Assche wrote: Unregister and reregister BDI devices in the proper order. This patch avoids that the following kernel warning can get triggered: Hi Bart, Can you share the scenario that reproduced this? I think I might have seen this before. Thanks, Sagi. -- To

Re: [PATCH] target: Fix target_sense_desc_format NULL pointer dereference

2015-09-17 Thread Sagi Grimberg
u64 unpacked_lun) * pointer can be kfree_rcu() by the final se_lun->lun_group put via * target_core_fabric_configfs.c:target_fabric_port_release */ +ref_dev: se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev); atomic_long_inc(_cmd->se_de

Re: [PATCH RESEND] scsi: Fix sense information setting in fixed sized format

2015-09-17 Thread Sagi Grimberg
On 9/3/2015 10:02 PM, Ewan Milne wrote: On Thu, 2015-09-03 at 19:49 +0300, Sagi Grimberg wrote: In fixed size sense format the information field is a four byte field. Signed-off-by: Sagi Grimberg <sa...@mellanox.com> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com&

Re: [PATCH] target: Fix target_sense_desc_format NULL pointer dereference

2015-09-16 Thread Sagi Grimberg
se_cmd->se_device. This addresses a v4.3-rc1 specific NULL pointer dereference regression introduced by commit 4e4937e8. Cc: Sagi Grimberg <sa...@mellanox.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Signed-off-by: Nicholas Bellinger <n...@linux-i

Re: [PATCH 1/1] Update scsi hosts to use idr for host number mgmt

2015-09-06 Thread Sagi Grimberg
On 9/5/2015 11:44 PM, Lee Duncan wrote: Each Scsi_host instance gets a host number starting at 0, but this was implemented with an atomic integer, and rollover wasn't considered. Another problem with this design is that scsi host numbers used by iscsi are never reused, thereby making rollover

Re: [PATCH 0/1] Update scsi hosts to use idr for host number mgmt

2015-09-06 Thread Sagi Grimberg
On 9/5/2015 11:44 PM, Lee Duncan wrote: This is an updated version of a patch I submitted a few days ago. The previous versions of this patch updated the scsi hosts module to use the ida helper routines to allocate host numbers, instead of using a simple integer. Based on a suggestion by

[PATCH RESEND] libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

2015-09-03 Thread Sagi Grimberg
and hogs the cpu. Fix this issue by checking the return value of iscsi_send_nopout. If it fails set the next_timeout to one second later. Signed-off-by: Ariel Nahum <ari...@mellanox.com> Signed-off-by: Sagi Grimberg <sa...@mellanox.com> Reviewed-by: Mike Christie <micha...@cs.wis

[PATCH RESEND] scsi: Fix sense information setting in fixed sized format

2015-09-03 Thread Sagi Grimberg
In fixed size sense format the information field is a four byte field. Signed-off-by: Sagi Grimberg <sa...@mellanox.com> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...

Re: [PATCHv2] Update scsi host to use ida for host number

2015-09-01 Thread Sagi Grimberg
On 9/1/2015 8:38 PM, ldun...@suse.com wrote: From: Lee Duncan Each Scsi_host instance gets a host number starting at 0, but this is implemented with an atomic integer, and rollover doesn't seem to have been considered. Another side-effect of this design is that scsi host

Re: [PATCH] Update scsi host to use ida for host number

2015-09-01 Thread Sagi Grimberg
On 8/31/2015 11:28 PM, leeman.dun...@gmail.com wrote: From: Lee Duncan Each Scsi_host instance gets a host number starting at 0, but this is implemented with an atomic integer, and rollover doesn't seem to have been considered. Another side-effect of this design is that scsi

Re: [PATCH] scsi: Fixup fixed sense generation

2015-08-11 Thread Sagi Grimberg
- put_unaligned_be64(info, buf[3]); + /* +* Fixed format sense reserves only 32 bits for the +* 'information' field +*/ + put_unaligned_be32((u32)info, buf[3]); } }

Re: [PATCH] target: improve unsupported opcode message

2015-07-23 Thread Sagi Grimberg
don't handle. Signed-off-by: Joern Engel jo...@purestorage.com Signed-off-by: Spencer Baugh sba...@catern.com Looks good, Reviewed-by: Sagi Grimberg sa...@mellanox.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] target/iscsi: fix digest computation for chained SGs

2015-07-21 Thread Sagi Grimberg
you able to get a chained SG list in the target code? In any event, looks good, Reviewed-by: Sagi Grimberg sa...@mellanox.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

[PATCH v2 3/4] target: Return descriptor format sense data in case the LU spans 64bit sectors

2015-07-16 Thread Sagi Grimberg
Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/target/target_core_hba.c | 5 + drivers/target/target_core_spc.c | 12 +--- drivers/target/target_core_transport.c | 3 ++- include/target/target_core_backend.h | 2 ++ 4 files changed, 18 insertions(+), 4

[PATCH v1 4/4] libiscsi: Use scsi helper to set information descriptor

2015-07-15 Thread Sagi Grimberg
In case encountered a PI error, use scsi_set_sense_information instead of open coding information descriptor format. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/scsi/libiscsi.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libiscsi.c b

[PATCH v1 3/4] target: Return descriptor format sense data in case the LU spans 64bit sectors

2015-07-15 Thread Sagi Grimberg
Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/target/target_core_hba.c | 5 + drivers/target/target_core_spc.c | 12 +--- drivers/target/target_core_transport.c | 3 ++- include/target/target_core_backend.h | 2 ++ 4 files changed, 18 insertions(+), 4

[PATCH v1 1/4] scsi: Fix wrong additional sense length in descriptor format

2015-07-15 Thread Sagi Grimberg
The sense header additional sense length should be the accumulated size of all the descriptors. Information descriptor size is 12 bytes. When setting the additional sense length we should add 0xc instead of 0xa. Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Hannes Reinecke h

[PATCH v1 0/4] Descriptor format sense data

2015-07-15 Thread Sagi Grimberg
format only for LUs that span 64bit sectors. - Added reviwed-by tags. Sagi Grimberg (4): scsi: Fix wrong additional sense length in descriptor format scsi: Protect against buffer possible overflow in scsi_set_sense_information target: Return descriptor format sense data in case the LU spans

[PATCH v1 2/4] scsi: Protect against buffer possible overflow in scsi_set_sense_information

2015-07-15 Thread Sagi Grimberg
Make sure that the input sense buffer has sufficient length to fit the information descriptor (12 additional bytes). Modify scsi_set_sense_information to receive the sense buffer length and adjust its callers scsi target and libata. Reported-by: Hannes Reinecke h...@suse.de Signed-off-by: Sagi

Re: [PATCH 3/3] target: Return descriptor format sense data

2015-07-14 Thread Sagi Grimberg
information field is only 32 bits which means the sector information will be truncated. Thus, if the LU spans 64bit sectors, use descriptor format sense data to correctly report sector information. Reported-by: Christoph Hellwig h...@lst.de Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers

Re: [PATCH] scsi: Fix sense information setting in fixed sized format

2015-07-12 Thread Sagi Grimberg
This looks correct to me, Reviewed-by: Christoph Hellwig h...@lst.de But: this will truncate 32bit sector numbers. Maybe we need to enable descriptor format sense data for large enough LUs. That should be easy enough now that the sense data is constructed using scsi helpers. Let me

[PATCH 2/3] scsi: Protect against buffer possible overflow in scsi_set_sense_information

2015-07-12 Thread Sagi Grimberg
Make sure that the input sense buffer has sufficient length to fit the information descriptor (12 additional bytes). Modify scsi_set_sense_information to receive the sense buffer length and adjust it's callers scsi target and libata. Reported-by: Hannes Reinecke h...@suse.de Signed-off-by: Sagi

[PATCH 3/3] target: Return descriptor format sense data

2015-07-12 Thread Sagi Grimberg
Fixed size sense data information field is only 32 bits which means the sector (64 bits) information will be truncated. Move to descriptor format sense data to correctly report full sector information. Reported-by: Christoph Hellwig h...@lst.de Signed-off-by: Sagi Grimberg sa...@mellanox.com

[PATCH 1/3] scsi: Fix wrong additional sense length in descriptor format

2015-07-12 Thread Sagi Grimberg
The sense header additional sense length should be the accumulated size of all the descriptors. Information descriptor size is 12 bytes. When setting the additional sense length we should add 0xc instead of 0xa. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/scsi/scsi_common.c | 2

[PATCH 0/3] Descriptor format sense data

2015-07-12 Thread Sagi Grimberg
to report descriptor format sense data to avoid 64bit sector info truncation (reported by hch). Sagi Grimberg (3): scsi: Fix wrong additional sense length in descriptor format scsi: Protect against buffer possible overflow in scsi_set_sense_information target: Return descriptor format sense

[PATCH] libiscsi: Use scsi helper to set information descriptor

2015-07-12 Thread Sagi Grimberg
In case encountered a PI error, use scsi_set_sense_information instead of open coding information descriptor format. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/scsi/libiscsi.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libiscsi.c b

Re: [PATCH v1] libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

2015-07-09 Thread Sagi Grimberg
() and hogs the cpu. Fix this issue by checking the return value of iscsi_send_nopout. If it fails set the next_timeout to one second later. Signed-off-by: Ariel Nahum ari...@mellanox.com Signed-off-by: Sagi Grimberg sa...@mellanox.com --- Changes from v0: - Fixed coding style comment drivers/scsi

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 1:19 PM, Christoph Hellwig wrote: On Mon, Jul 06, 2015 at 04:15:08PM +0300, Sagi Grimberg wrote: PI errors should be reported in a descriptor format sense data. Fix that by adding a desc_format flag to struct sense_info and pass it to scsi_build_sense_buffer() to do the right thing

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 1:59 PM, Hannes Reinecke wrote: On 07/08/2015 12:49 PM, Christoph Hellwig wrote: On Wed, Jul 08, 2015 at 01:36:04PM +0300, Sagi Grimberg wrote: We don't have any other information today, but sector is not the only information that is requires a descriptor format, so maybe

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 2:44 PM, Christoph Hellwig wrote: On Wed, Jul 08, 2015 at 12:59:18PM +0200, Hannes Reinecke wrote: Actually it's controlled by the D_SENSE bit in the Control mode page (that's bit[2] of byte 2 in the control mode page). Which is currently set to '0', ie we will be returning fixed

Re: [PATCH v3 4/5] target: Use scsi helpers to build the sense data correctly

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 1:17 PM, Christoph Hellwig wrote: --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -7,6 +7,7 @@ #include linux/blkdev.h #include linux/percpu_ida.h #include linux/t10-pi.h +#include scsi/scsi_common.h #include net/sock.h #include net/tcp.h

Re: [PATCH v3 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 1:15 PM, Christoph Hellwig wrote: + if (r == (__force int)TCM_CHECK_CONDITION_UNIT_ATTENTION) { You probably want to compare reason here to avoid the cast. I do want it... -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to

Re: [PATCH 3/3] sd: do not try to spin-up disks for ALUA 'transitioning' state

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 10:41 AM, Hannes Reinecke wrote: If a disk reports an ALUA 'transitioning' state we should not try to spin up the device. Signed-off-by: Hannes Reinecke h...@suse.de --- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 2:14 PM, Sagi Grimberg wrote: And it's actually not true that you'd need descriptor sense to encode the sector information; it'll be stored in the 'information' section (byte 3-6) for fixed format sense. But when I return the sector info in a fixed size format, the initiator

[PATCH v4 4/5] target: Use scsi helpers to build the sense data correctly

2015-07-08 Thread Sagi Grimberg
Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers which moved to scsi_common. Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/target/target_core_spc.c | 31

[PATCH v4 5/5] target: Return ABORTED_COMMAND sense key for PI errors

2015-07-08 Thread Sagi Grimberg
PI errors were reported with ILLEGAL_REQUEST sense key but there was actually no problem with the request. Target detected PI errors should be reported with aborted command sense key. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/target/target_core_transport.c | 6 +++--- 1 file

[PATCH v4 3/5] scsi: Move sense handling routines to scsi_common

2015-07-08 Thread Sagi Grimberg
Sense data handling is also done in the target stack. Hence, move sense handling routines to scsi_common so the target will be able to use them as well. Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Bart Van Assche bart.vanass...@sandisk.com Reviewed-by: Christoph Hellwig h

Re: [PATCH v4 3/5] scsi: Move sense handling routines to scsi_common

2015-07-08 Thread Sagi Grimberg
On 7/8/2015 6:06 PM, Hannes Reinecke wrote: We're adding extra fields here, so we need to make sure to not overflow the buffer. You probably have to pass in the buffersize to avoid an overflow ... Yeah, I know, it's theoretical at the moment. But there's nothing which prevents anyone to add

[PATCH v4 0/5] Target sense data handling modifications

2015-07-08 Thread Sagi Grimberg
transport_get_sense_codes() target: Split transport_send_check_condition_and_sense() Sagi Grimberg (3): scsi: Move sense handling routines to scsi_common target: Use scsi helpers to build the sense data correctly target: Return ABORTED_COMMAND sense key for PI errors drivers/scsi

[PATCH v4 1/5] target: Inline transport_get_sense_codes()

2015-07-08 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Inline this function in its call site since it performs a trivial task and since it is only called once. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Hannes Reinecke h

[PATCH v4 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-08 Thread Sagi Grimberg
into table-driven code. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Hannes Reinecke h...@suse.de Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/target/target_core_transport.c | 383 + 1

Re: [PATCH v3 0/5] Target sense data handling modifications

2015-07-07 Thread Sagi Grimberg
On 7/7/2015 1:51 AM, Nicholas A. Bellinger wrote: On Mon, 2015-07-06 at 16:15 +0300, Sagi Grimberg wrote: This patch set modifies the target sense data handling. First, cleanup transport_send_check_condition_and_sense() by splitting the sense translation to a separate function. Second, convert

lockdep complains on possible circular locking dependency when deleting an iscsi device

2015-07-07 Thread Sagi Grimberg
Hi, I recently came across a lockdep complaint on a possible deadlock that I don't understand yet (log output below). Has anyone seen this? Any insights on why exactly is lockdep complaining? The reproducer is very easy (reproduced both with tcp and iser): - login to a target with one or more

Re: [PATCH] iscsi-target: Fix iscsit_start_kthreads failure OOPs

2015-07-07 Thread Sagi Grimberg
On 7/7/2015 12:01 PM, Nicholas A. Bellinger wrote: Hey Sagi, This addresses a regression with traditional iscsi-target that I noticed recently, but has not been tested with iser-target yet. Would you mind taking a quick spin with iser-target to verify, and try to intentionally fail

[PATCH v2 0/3] Target sense data handling modifications

2015-07-06 Thread Sagi Grimberg
() Sagi Grimberg (1): target: Use scsi helpers to build the sense data correctly drivers/scsi/scsi_common.c | 98 drivers/scsi/scsi_error.c | 99 +--- drivers/target/target_core_spc.c | 31 +-- drivers/target/target_core_transport.c | 398

[PATCH v2 3/3] target: Use scsi helpers to build the sense data correctly

2015-07-06 Thread Sagi Grimberg
Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers which moved to scsi_common. This patch also fixes wrong setting of descriptor format sense data for t10-pi integrity errors. Signed-off-by: Sagi Grimberg sa

[PATCH v2 1/3] target: Inline transport_get_sense_codes()

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Inline this function in its call site since it performs a trivial task and since it is only called once. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com Reviewed-by: Hannes Reinecke h...@suse.de ---

[PATCH v2 2/3] target: Split transport_send_check_condition_and_sense()

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Move the code for translating a sense_reason_t code into a SCSI status ASC and ASCQ codes from transport_send_check_condition_and_sense() into the new function translate_sense_reason(). Convert the switch statement that performs the translation

Re: [PATCH v2 1/3] target: Inline transport_get_sense_codes()

2015-07-06 Thread Sagi Grimberg
On 7/6/2015 11:59 AM, Christoph Hellwig wrote: On Mon, Jul 06, 2015 at 11:02:25AM +0300, Sagi Grimberg wrote: From: Bart Van Assche bart.vanass...@sandisk.com Inline this function in its call site since it performs a trivial task and since it is only called once. Signed-off-by: Bart Van

Re: [PATCH v2 3/3] target: Use scsi helpers to build the sense data correctly

2015-07-06 Thread Sagi Grimberg
On 7/6/2015 12:06 PM, Christoph Hellwig wrote: On Mon, Jul 06, 2015 at 11:02:27AM +0300, Sagi Grimberg wrote: Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers which moved to scsi_common. This patch also fixes

[PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-06 Thread Sagi Grimberg
PI errors should be reported in a descriptor format sense data. Fix that by adding a desc_format flag to struct sense_info and pass it to scsi_build_sense_buffer() to do the right thing. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/target/target_core_transport.c | 6 +- 1 file

[PATCH v3 3/5] scsi: Move sense handling routines to scsi_common

2015-07-06 Thread Sagi Grimberg
Sense data handling is also done in the target stack. Hence, move sense handling routines to scsi_common so the target will be able to use them as well. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/scsi/scsi_common.c | 98 + drivers/scsi

[PATCH v3 4/5] target: Use scsi helpers to build the sense data correctly

2015-07-06 Thread Sagi Grimberg
Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers which moved to scsi_common. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/target/target_core_spc.c | 31 +-- drivers

[PATCH v3 1/5] target: Inline transport_get_sense_codes()

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Inline this function in its call site since it performs a trivial task and since it is only called once. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Hannes Reinecke h

[PATCH v3 0/5] Target sense data handling modifications

2015-07-06 Thread Sagi Grimberg
and converted my patch to apply over his - Moved scsi sense helpers to scsi_common Bart Van Assche (2): target: Inline transport_get_sense_codes() target: Split transport_send_check_condition_and_sense() Sagi Grimberg (3): scsi: Move sense handling routines to scsi_common target: Use scsi

[PATCH v3 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-06 Thread Sagi Grimberg
into table-driven code. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com Signed-off-by: Sagi Grimberg sa...@mellanox.com Reviewed-by: Hannes Reinecke h...@suse.de --- drivers/target/target_core_transport.c | 383 + 1 file changed, 148 insertions(+), 235

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-06 Thread Sagi Grimberg
On 7/6/2015 6:28 PM, Bart Van Assche wrote: On 07/06/2015 06:15 AM, Sagi Grimberg wrote: diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 0181f8b..79bb8d1 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target

[PATCH v1 2/3] target: Split transport_send_check_condition_and_sense()

2015-07-05 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Move the code for translating a sense_reason_t code into a SCSI status ASC and ASCQ codes from transport_send_check_condition_and_sense() into the new function translate_sense_reason(). Convert the switch statement that performs the translation

[PATCH v1 3/3] target: Use scsi helpers to build the sense data correctly

2015-07-05 Thread Sagi Grimberg
Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers which moved to scsi_common. This patch also fixes wrong setting of descriptor format sense data for t10-pi integrity errors. Signed-off-by: Sagi Grimberg sa

[PATCH v1 0/3] Target sense data handling modifications

2015-07-05 Thread Sagi Grimberg
transport_send_check_condition_and_sense() Sagi Grimberg (1): target: Use scsi helpers to build the sense data correctly drivers/scsi/scsi_common.c | 58 + drivers/scsi/scsi_error.c | 58 - drivers/target/target_core_spc.c | 31 +-- drivers/target

[PATCH v1 1/3] target: Inline transport_get_sense_codes()

2015-07-05 Thread Sagi Grimberg
From: Bart Van Assche bart.vanass...@sandisk.com Inline this function in its call site since it performs a trivial task and since it is only called once. Signed-off-by: Bart Van Assche bart.vanass...@sandisk.com --- drivers/target/target_core_transport.c | 16 ++-- 1 file changed, 2

Re: [PATCH RFC] target: Use scsi helpers to build the sense data correctly

2015-07-05 Thread Sagi Grimberg
On 7/3/2015 7:12 PM, Christoph Hellwig wrote: On Mon, Jun 29, 2015 at 06:05:25PM +0300, Sagi Grimberg wrote: Instead of open coding the sense buffer construction, use scsi scsi_build_sense_buffer() and scsi_set_sense_information() helpers. This patch also fixes wrong setting of descriptor

<    1   2   3   4   5   6   >