Re: [PATCH v3 1/5] target: ensure se_cmd->t_prot_sg is allocated when required

2015-04-26 Thread Sagi Grimberg
t se_cmd->t_prot_sg needs to be allocated or use pre-allocated protection information by scsi mid-layer. Signed-off-by: Akinobu Mita Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: "James E.J. Bottomley" Cc: target-de...

Re: [PATCH v3 1/5] target: ensure se_cmd->t_prot_sg is allocated when required

2015-04-26 Thread Sagi Grimberg
On 4/26/2015 12:26 PM, Sagi Grimberg wrote: On 4/25/2015 5:33 PM, Akinobu Mita wrote: Even if the device backend is initialized with protection info is enabled, some requests don't have the protection info attached for WRITE SAME command issued by block device helpers, WRITE command

Re: [PATCH v3 4/5] target: Fix sbc_dif_generate() and sbc_dif_verify() for WRITE SAME

2015-04-26 Thread Sagi Grimberg
f-tag)? Signed-off-by: Akinobu Mita Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: "James E.J. Bottomley" Cc: target-de...@vger.kernel.org Cc: linux-scsi@vger.kernel.org --- * Changes from v2: - Handle odd SG mapping corre

Re: [PATCH v3 5/5] target/file: enable WRITE SAME when protection info is enabled

2015-04-26 Thread Sagi Grimberg
On 4/25/2015 5:33 PM, Akinobu Mita wrote: Now we can generate correct PI for WRITE SAME command, so it is unnecessary to disallow WRITE SAME when protection info is enabled. Signed-off-by: Akinobu Mita Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christo

Re: [PATCH v3 3/5] target: handle odd SG mapping for data transfer memory

2015-04-26 Thread Sagi Grimberg
: Tim Chen Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-cry...@vger.kernel.org Cc: Nicholas Bellinger Cc: Sagi Grimberg Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: "James E.J. Bottomley" Cc: target-de...@vger.kernel.org Cc: linux-scsi@vger.kernel.or

Re: [PATCH v3 1/5] target: ensure se_cmd->t_prot_sg is allocated when required

2015-04-27 Thread Sagi Grimberg
On 4/27/2015 3:57 PM, Akinobu Mita wrote: 2015-04-26 18:44 GMT+09:00 Sagi Grimberg : @@ -2181,6 +2182,12 @@ static inline void transport_reset_sgl_orig(struct se_cmd *cmd) static inline void transport_free_pages(struct se_cmd *cmd) { +if (!(cmd->se_cmd_fl

Re: [PATCH 02/12] scsi_transport_srp: Fix a race condition

2015-04-30 Thread Sagi Grimberg
] [] process_one_work+0x1db/0x780 [] worker_thread+0x11b/0x450 [] kthread+0xe4/0x100 [] ret_from_fork+0x7c/0xb0 See also patch "scsi_transport_srp: Add transport layer error handling" (commit ID 29c17324803c). Signed-off-by: Bart Van Assche Cc: James Bottomley Cc: Sagi Grimberg Cc: Sebastian

Re: [PATCH 04/12] IB/srp: Fix connection state tracking

2015-04-30 Thread Sagi Grimberg
On 4/30/2015 2:25 PM, Bart Van Assche wrote: On 04/30/15 11:51, Sagi Grimberg wrote: On 4/30/2015 11:58 AM, Bart Van Assche wrote: -srp_change_conn_state(target, false); +ch->connected = false; Shouldn't this be protected by the channel lock (like the target)? On

[PATCH] iscsi: Fix iscsi endpoints leak

2015-05-20 Thread Sagi Grimberg
Lyakas Signed-off-by: Sagi Grimberg --- drivers/scsi/scsi_transport_iscsi.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 67d43e3..55647aa 100644 --- a/drivers/scsi/scsi_transport_iscsi.c

Re: [PATCH] iscsi: Fix iscsi endpoints leak

2015-06-02 Thread Sagi Grimberg
On 5/20/2015 12:38 PM, Sagi Grimberg wrote: When creating a new endpoint, we look for a free id for the new endpoint. We baisically loop on possible ids and use the first id that class_find_device() returns NULL. However, we are missing a reference put when class_find_device() does find an

Re: [RFC 0/2] target: Add TFO->complete_irq queue_work bypass

2015-06-04 Thread Sagi Grimberg
On 6/4/2015 10:06 AM, Nicholas A. Bellinger wrote: On Wed, 2015-06-03 at 14:57 +0200, Christoph Hellwig wrote: This makes lockdep very unhappy, rightly so. If you execute one end_io function inside another you basŃ–cally nest every possible lock taken in the I/O completion path. Also adding mor

Re: [RFC 1/2] target: Add support for fabric IRQ completion

2015-06-29 Thread Sagi Grimberg
On 6/9/2015 10:27 AM, Christoph Hellwig wrote: diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 3fbb0d4..aa08d6b 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -37,6 +37,7 @@ #include #include +#include #incl

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

2015-06-29 Thread Sagi Grimberg
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 format sense data for t10-pi integrity errors. Signed-off-by: Sagi Grimberg --- drivers/target/target_core_spc.c

[PATCH] libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

2015-06-30 Thread Sagi Grimberg
his 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 Signed-off-by: Sagi Grimberg --- drivers/scsi/libiscsi.c | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/s

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

2015-07-05 Thread Sagi Grimberg
From: Bart Van Assche 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 into table-driven code. Signe

[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

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

2015-07-05 Thread Sagi Grimberg
Split 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/t

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

2015-07-05 Thread Sagi Grimberg
From: Bart Van Assche 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 --- drivers/target/target_core_transport.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers

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

[PATCH v1] libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

2015-07-05 Thread Sagi Grimberg
his 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 Signed-off-by: Sagi Grimberg --- Changes from v0: - Fixed coding style comment drivers/scsi/libiscsi.c | 17 +++-- 1 file changed, 11 inserti

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

2015-07-05 Thread Sagi Grimberg
On 7/4/2015 6:48 PM, Bart Van Assche wrote: Bart, any chance you could resend them? Bart, would you prefer to re-send your changes on top of v1 of this one? It should be easy enough. The modification needed is that struct sense_info needs a desc_format bool to indicate if the sense data is c

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

2015-07-05 Thread Sagi Grimberg
On 7/2/2015 11:11 PM, Mike Christie wrote: On 6/30/15, 9:55 AM, Sagi Grimberg wrote: From: Ariel Nahum Connection last_ping is not being updated when iscsi_send_nopout fails. Not updating the last_ping will cause firing a timer to a past time (last_ping + ping_tmo < current_time) wh

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

2015-07-06 Thread Sagi Grimberg
also moved include to scsi_common.h Changes from v0: - Added Bart's patches 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()

[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

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

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche 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 into table-driven code. Signe

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

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche 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 Reviewed-by: Hannes Reinecke --- drivers/target/target_core_transport.c | 16 ++-- 1 file changed, 2 insertions(+), 14 dele

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 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 Reviewed-by: Hannes

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 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-06 Thread Sagi Grimberg
. Signed-off-by: Bart Van Assche Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke --- drivers/target/target_core_transport.c | 383 + 1 file changed, 148 insertions(+), 235 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target

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

2015-07-06 Thread Sagi Grimberg
ed 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 helpers to buil

[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 --- drivers/target/target_core_transport.c | 6 +- 1 file changed, 5

[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 --- drivers/scsi/scsi_common.c | 98 + drivers/scsi/scsi_error.c

[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 --- drivers/target/target_core_spc.c | 31 +-- drivers/target

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

2015-07-06 Thread Sagi Grimberg
From: Bart Van Assche 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 Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c

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

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

2015-07-06 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 d

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 iscsit_start

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 --- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 7c0bdaa

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 #include #include +#include #include #include Please only add the include in the files that need it. (And many of the existing

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 m

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 it

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 sen

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

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

2015-07-08 Thread Sagi Grimberg
et: 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 helpers to build the sense data correctly target: Return ABORTED_COMMAND sense key for PI errors drivers/scsi/scs

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

2015-07-08 Thread Sagi Grimberg
From: Bart Van Assche 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 Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c

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

2015-07-08 Thread Sagi Grimberg
. Signed-off-by: Bart Van Assche Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 383 + 1 file changed, 148 insertions(+), 235 deletions(-) diff --git a/drivers/target

[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 --- drivers/target/target_core_transport.c | 6 +++--- 1 file changed, 3

[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 Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi_common.c | 98

[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 Reviewed-by: Christoph Hellwig --- drivers/target/target_core_spc.c | 31

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

2015-07-08 Thread Sagi Grimberg
In fixed size sense format the information field is a four byte field. Signed-off-by: Sagi Grimberg --- drivers/scsi/scsi_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c index 41432c1..8cfb7ee 100644 --- a

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 othe

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

2015-07-09 Thread Sagi Grimberg
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 Signed-off-by: Sagi Grimberg --- Changes from v0: - Fixed coding style comment drivers/scsi/libiscsi.c | 17 +++-- 1 file changed,

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

2015-07-11 Thread Sagi Grimberg
This looks correct to me, Reviewed-by: Christoph Hellwig 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 prepare a patch

[PATCH 0/3] Descriptor format sense data

2015-07-12 Thread Sagi Grimberg
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 --- drivers/scsi/libiscsi.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi

[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 Signed-off-by: Sagi Grimber

[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 Signed-off-by: Sagi Grimberg --- drivers/target

[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 --- drivers/scsi/scsi_common.c | 2 +- 1 file changed

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

2015-07-14 Thread Sagi Grimberg
se data 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 Signed-off-by: Sagi Grimberg --- drivers/target/target_core

[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 --- drivers/scsi/libiscsi.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi

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

2015-07-15 Thread Sagi Grimberg
-by: Sagi Grimberg --- 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 deletions(-) diff --git a

[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 Reviewed-by: Hannes Reinecke Reviewed-by: Martin K

[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 Signed-off-by: Sagi Grimberg

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

2015-07-16 Thread Sagi Grimberg
-by: Sagi Grimberg --- 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 deletions(-) diff --git a

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

2015-07-21 Thread Sagi Grimberg
G list in the target code? In any event, looks good, Reviewed-by: Sagi Grimberg -- 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: improve unsupported opcode message

2015-07-23 Thread Sagi Grimberg
Signed-off-by: Joern Engel Signed-off-by: Spencer Baugh Looks good, Reviewed-by: Sagi Grimberg -- 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: Fixup fixed sense generation

2015-08-10 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]); } } EXPORT_SYMBOL(scsi_set_sens

Re: [PATCH 09/12] SRP transport: Move queuecommand() wait code to SCSI core

2016-10-27 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 10/12] SRP transport, scsi-mq: Wait for .queue_rq() if necessary

2016-10-27 Thread Sagi Grimberg
Thanks for moving it, Reviewed-by: Sagi Grimberg -- 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 04/12] blk-mq: Move more code into blk_mq_direct_issue_request()

2016-10-27 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg -- 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 02/12] blk-mq: Introduce blk_mq_hctx_stopped()

2016-10-27 Thread Sagi Grimberg
Looks fine, Reviewed-by: Sagi Grimberg -- 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: A question regarding "multiple SGL"

2016-10-27 Thread Sagi Grimberg
Hi Robert, Hey Robert, Christoph, please explain your use cases that isn't handled. The one and only reason to set MSDBD to 1 is to make the code a lot simpler given that there is no real use case for supporting more. RDMA uses memory registrations to register large and possibly discontigu

Re: [PATCH 11/12] nvme: Use BLK_MQ_S_STOPPED instead of QUEUE_FLAG_STOPPED in blk-mq code

2016-10-27 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg -- 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 01/12] blk-mq: Do not invoke .queue_rq() for a stopped queue

2016-10-27 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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] Avoid that SCSI device removal through sysfs triggers a deadlock

2016-10-27 Thread Sagi Grimberg
Hey Bart, The solution I prefer is to modify the SCSI scanning code such that the scan_mutex is only held while performing the actual LUN scanning and while ensuring that no SCSI device has been created yet for a certain LUN number but not while the Linux device and its sysfs attributes are crea

Re: [PATCH 1/3] blk-mq: export blk_mq_map_queues

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 2/3] scsi: allow LLDDs to expose the queue mapping to blk-mq

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 v5 05/14] blk-mq: Avoid that requeueing starts stopped queues

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 v5 06/14] blk-mq: Remove blk_mq_cancel_requeue_work()

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 v5 07/14] blk-mq: Introduce blk_mq_quiesce_queue()

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 v5 11/14] SRP transport: Move queuecommand() wait code to SCSI core

2016-11-01 Thread Sagi Grimberg
Again, Reviewed-by: Sagi Grimberg -- 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 v5 08/14] blk-mq: Add a kick_requeue_list argument to blk_mq_requeue_request()

2016-11-01 Thread Sagi Grimberg
Looks useful, Reviewed-by: Sagi Grimberg -- 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 v5 13/14] nvme: Fix a race condition related to stopping queues

2016-11-01 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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 v5 12/14] SRP transport, scsi-mq: Wait for .queue_rq() if necessary

2016-11-01 Thread Sagi Grimberg
and again, Reviewed-by: Sagi Grimberg -- 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 04/12] target: avoid to access .bi_vcnt directly

2016-11-12 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg -- 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: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-12 Thread Sagi Grimberg
Hi all, I'd like to attend LSF/MM and would like to discuss polling for block drivers. Currently there is blk-iopoll but it is neither as widely used as NAPI in the networking field and accoring to Sagi's findings in [1] performance with polling is not on par with IRQ usage. On LSF/MM I'd lik

Re: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-12 Thread Sagi Grimberg
I'd like to attend LSF/MM and would like to discuss polling for block drivers. Currently there is blk-iopoll but it is neither as widely used as NAPI in the networking field and accoring to Sagi's findings in [1] performance with polling is not on par with IRQ usage. On LSF/MM I'd like to whet

Re: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-12 Thread sagi grimberg
A typical Ethernet network adapter delays the generation of an interrupt after it has received a packet. A typical block device or HBA does not delay the generation of an interrupt that reports an I/O completion. >>> >>> NVMe allows for configurable interrupt coalescing, as

Re: [Lsf-pc] [LFS/MM TOPIC][LFS/MM ATTEND]: - Storage Stack and Driver Testing methodology.

2017-01-12 Thread Sagi Grimberg
Hi Folks, I would like to propose a general discussion on Storage stack and device driver testing. I think its very useful and needed. Purpose:- - The main objective of this discussion is to address the need for a Unified Test Automation Framework which can be used by different

Re: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-12 Thread Sagi Grimberg
I agree with Jens that we'll need some analysis if we want the discussion to be affective, and I can spend some time this if I can find volunteers with high-end nvme devices (I only have access to client nvme devices. I have a P3700 but somehow burned the FW. Let me see if I can bring it back

Re: [Lsf-pc] [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-12 Thread Sagi Grimberg
**Note: when I ran multiple threads on more cpus the performance degradation phenomenon disappeared, but I tested on a VM with qemu emulation backed by null_blk so I figured I had some other bottleneck somewhere (that's why I asked for some more testing). That could be because of the vmexits a

Re: [PATCH 1/4] block: add blk_rq_payload_bytes

2017-01-13 Thread Sagi Grimberg
Add a helper to calculate the actual data transfer size for special payload requests. Signed-off-by: Christoph Hellwig --- include/linux/blkdev.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ff3d774..1ca8e8f 100644 --

Re: [PATCH 2/4] scsi: use blk_rq_payload_bytes

2017-01-13 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg -- 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 3/4] nvme: use blk_rq_payload_bytes

2017-01-13 Thread Sagi Grimberg
This looks good, Reviewed-by: Sagi Grimberg -- 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 4/4] sd: remove __data_len hack for WRITE SAME

2017-01-13 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg -- 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: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-17 Thread Sagi Grimberg
-- [1] queue = b'nvme0q1' usecs : count distribution 0 -> 1 : 7310 || 2 -> 3 : 11 | | 4 -> 7 : 10 | | 8 -> 15 : 20 | | 16

Re: [LSF/MM TOPIC][LSF/MM ATTEND] NAPI polling for block drivers

2017-01-17 Thread Sagi Grimberg
Hey, so I made some initial analysis of whats going on with irq-poll. First, I sampled how much time it takes before we get the interrupt in nvme_irq and the initial visit to nvme_irqpoll_handler. I ran a single threaded fio with QD=32 of 4K reads. This is two displays of a histogram of the laten

  1   2   3   4   5   6   >