[PATCH] target/tcm_qla2xxx: Add/use target_reverse_dma_direction() in target_core_fabric.h

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Reversing the dma_data_direction for pci_map_sg() friends is useful for other drivers, so move it from tcm_qla2xxx into inline code within target_core_fabric.h. Also drop internal usage of equivlient in tcm_qla2xxx fabric code. Reported-by: Christoph Hellwig Cc: Roland

[PATCH-v2 00/12] target: Add support for COMPARE_AND_WRITE (VAAI) emulation

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi folks, This series -v2 adds support to target-core for generic COMPARE_AND_WRITE emulation as defined by SBC-3 using virtual (IBLOCK, FILEIO, RAMDISK) backends. COMPARE_AND_WRITE is a VMWare ESX VAAI primitive that is currently used by VMFS to perform array side lock

[PATCH-v2 03/12] target: Add TCM_MISCOMPARE_VERIFY sense handling

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds TCM_MISCOMPARE_VERIFY (ASC=0x1d, ASCQ=0x00) sense handling to transport_send_check_condition_and_sense(), which is required for a COMPARE_AND_WRITE comparision failure. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc:

[PATCH-v2 04/12] target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger COMPARE_AND_WRITE expects to be able to send down a DMA_FROM_DEVICE to obtain the necessary READ payload for comparision against the first half of the WRITE payload containing the verify user data. Currently virtual backends expect to internally reference SGLs, SGL nents

[PATCH-v2 02/12] target: Add return for se_cmd->transport_complete_callback

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a sense_reason_t return to ->transport_complete_callback(), and updates target_complete_ok_work() to invoke the call if necessary to transport_send_check_condition_and_sense() during the failure case. Also update xdreadwrite_callback() to use this return

[PATCH-v2 06/12] target: Add memory allocation for bidirectional commands

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This adds transport_generic_get_mem_bidi() to perform scatterlist allocation for bidirectional commands. Also, update transport_generic_new_cmd() to call this new function when SCF_BIDI has been set. v2 Changes: - Use SCF_COMPARE_AND_WRITE instead of CDB based check f

[PATCH-v2 05/12] target: Convert se_cmd->t_bidi_data_sg checks to use SCF_BIDI

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Stop keying off se_cmd->t_bidi_data_sg within transport_complete_qf() + target_complete_ok_work(), and just use SCF_BIDI instead. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc: James Bottomley Cc: Nicholas Bellinger Signed-off-by:

[PATCH-v2 01/12] scsi: Add CDB definition for COMPARE_AND_WRITE

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc: James Bottomley Cc: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- include/scsi/scsi.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/inc

[PATCH-v2 07/12] target: Add transport_reset_sgl_orig() for COMPARE_AND_WRITE

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger After COMPARE_AND_WRITE completes it's comparision, the WRITE payload SGLs head expect to be updated to point from the verify instance of user data, to the write instance of user data. So for this special case, add transport_reset_sgl_orig() usage within transport_free_p

[PATCH-v2 09/12] target: Add MAXIMUM COMPARE AND WRITE LENGTH in Block Limits VPD

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds the MAXIMUM COMPARE AND WRITE LENGTH bit, currently hardcoded to a single logical block (NoLB=1) within the Block Limits VPD in spc_emulate_evpd_b0(). Also add emulate_caw device attribute in configfs (enabled by default) to allow the exposure of this bit

[PATCH-v2 08/12] target: Make __target_execute_cmd() available as extern

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Required by COMPARE_AND_WRITE for write instance user-data submission, in order to bypass target_execute_cmd() checks. Reported-by: Christoph Hellwig Cc: Roland Dreier Cc: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_transport.

[PATCH-v2 10/12] target: Add support for COMPARE_AND_WRITE emulation

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds support for COMPARE_AND_WRITE emulation on a per block basis. This logic is used as an atomic test and set primative currently used by VMWare ESX VAAI for performing array side locking of individual VMFS extent ownership. This includes the COMPARE_AND_WR

[PATCH-v2 11/12] target: Add compare_and_write_post() completion callback fall through

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes target_complete_ok_work() to fall through after calling the se_cmd->transport_complete_callback() -> compare_and_write_post() callback, by keying off the existance of SCF_COMPARE_AND_WRITE_POST. This is necessary because once SCF_COMPARE_AND_WRITE_POST

[PATCH-v2 12/12] target: Release COMPARE_AND_WRITE mutex in generic failure path

2013-08-21 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a extra check for SCF_COMPARE_AND_WRITE within transport_generic_request_failure() to invoke the callback for compare_and_write_callback() or compare_and_write_done(), in order to release se_dev->caw_mutex from the generic failure path. It also adds to ch

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Joe Perches
On Thu, 2013-08-22 at 09:59 +0800, Zhi Yong Wu wrote: > On Thu, Aug 22, 2013 at 9:55 AM, Joe Perches wrote: > > On Wed, 2013-08-21 at 21:25 -0400, Martin K. Petersen wrote: > >> > "Joe" == Joe Perches writes: > >> > >> Joe> I don't get this build warning in the first place and I think the > >

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Zhi Yong Wu
On Thu, Aug 22, 2013 at 9:55 AM, Joe Perches wrote: > On Wed, 2013-08-21 at 21:25 -0400, Martin K. Petersen wrote: >> > "Joe" == Joe Perches writes: >> >> Joe> I don't get this build warning in the first place and I think the >> Joe> scsi_debug file is quite old and probably doesn't need to b

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Joe Perches
On Wed, 2013-08-21 at 21:25 -0400, Martin K. Petersen wrote: > > "Joe" == Joe Perches writes: > > Joe> I don't get this build warning in the first place and I think the > Joe> scsi_debug file is quite old and probably doesn't need to be > Joe> changed at all. > > guard isn't a boolean, it se

Re: [PATCH 2/4] scsi_debug: fix logical block provisioning support when unmap_alignment != 0

2013-08-21 Thread Martin K. Petersen
> "Doug" == Douglas Gilbert writes: Doug> This is Martin's area of expertise so I hope he also acks it. Doug> Acked-by: Douglas Gilbert I believe I already did, but: Acked-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Martin K. Petersen
> "Joe" == Joe Perches writes: Joe> I don't get this build warning in the first place and I think the Joe> scsi_debug file is quite old and probably doesn't need to be Joe> changed at all. guard isn't a boolean, it selects the checksum algorithm used. Also, I believe Akinobu's recent reorga

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Joe Perches
On Thu, 2013-08-22 at 09:05 +0800, Zhi Yong Wu wrote: > HI, Hi. > If you'd like, you should draft one patch for this warning. Not for me. I don't get this build warning in the first place and I think the scsi_debug file is quite old and probably doesn't need to be changed at all. I think scsi_

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Zhi Yong Wu
HI, If you'd like, you should draft one patch for this warning. On Thu, Aug 22, 2013 at 9:02 AM, Joe Perches wrote: > On Thu, 2013-08-22 at 08:44 +0800, zwu.ker...@gmail.com wrote: >> From: Zhi Yong Wu >> >> Initialize csum variable to fix the build warning. > > Maybe it'd be better to change

Re: [PATCH] scsi: fix the build warning

2013-08-21 Thread Joe Perches
On Thu, 2013-08-22 at 08:44 +0800, zwu.ker...@gmail.com wrote: > From: Zhi Yong Wu > > Initialize csum variable to fix the build warning. Maybe it'd be better to change the variable scsi_debug_guard type to bool? Something like: --- drivers/scsi/scsi_debug.c | 22 +++--- 1 fi

[PATCH] scsi: fix the build warning

2013-08-21 Thread zwu . kernel
From: Zhi Yong Wu Initialize csum variable to fix the build warning. drivers/scsi/scsi_debug.c: In function ‘dif_verify’: drivers/scsi/scsi_debug.c:1755:3: warning: ‘csum’ may be used uninitialized in this function [-Wmaybe-uninitialized] LD drivers/built-in.o CHK include/generat

Re: [PATCH 2/8] zfcp: cleanup use of obsolete strict_strto* functions

2013-08-21 Thread Jingoo Han
On Thursday, August 22, 2013 12:05 AM, Steffen Maier wrote: > > From: Martin Peschke > > strict_strtoul and friends are obsolete. Use kstrtoul functions > instead. > > Signed-off-by: Martin Peschke > Cc: Jingoo Han Reviewed-by: Jingoo Han Best regards, Jingoo Han > Signed-off-by: Steffen

[PATCH] scsi_dh_rdac: Add new IBM 1813 product id to rdac devlist

2013-08-21 Thread Stewart, Sean
Add new IBM product id to the RDAC devlist Signed-off-by: Sean Stewart --- diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 69c915a..4b9cf93 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Nicholas A. Bellinger
On Wed, 2013-08-21 at 08:53 -0700, Christoph Hellwig wrote: > On Wed, Aug 21, 2013 at 07:38:21AM -0700, Roland Dreier wrote: > > I don't understand this. In fact the whole patch series looks quite > > confused. COMPARE AND WRITE is a normal Data-Out command, with no > > requirement for special bi

Re: [PATCH 8/9] target: Add support for COMPARE_AND_WRITE emulation

2013-08-21 Thread Nicholas A. Bellinger
On Wed, 2013-08-21 at 09:14 -0700, Christoph Hellwig wrote: > I don't like the layering here. The re-execution of the same command > for both reading and writing the data from/to the backend device already > looks sketchy here due to doubling work of task attribute handling, the > various state bi

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Roland Dreier
On Wed, Aug 21, 2013 at 7:38 AM, Roland Dreier wrote: > I don't understand this. In fact the whole patch series looks quite > confused. COMPARE AND WRITE is a normal Data-Out command, with no > requirement for special bidirectional handling or anything like that. > The only slightly unusual thin

Re: [PATCH 8/9] target: Add support for COMPARE_AND_WRITE emulation

2013-08-21 Thread Christoph Hellwig
I don't like the layering here. The re-execution of the same command for both reading and writing the data from/to the backend device already looks sketchy here due to doubling work of task attribute handling, the various state bits, etc. And it will only get more complicated when the required lo

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Christoph Hellwig
On Wed, Aug 21, 2013 at 12:31:07AM -0700, Nicholas A. Bellinger wrote: > Is it really worth having two se_cmd_flags for COMPARE_AND_WRITE..? Not leaking the abstraction into the driver is always worth the effort. But looking at the other patches I haven't reviewed yet I think the issue is more se

Re: [PATCH 4/5] target/qla2xxx: Define NPIV ops in terms of normal ops

2013-08-21 Thread Andy Grover
On 08/20/2013 11:30 PM, Christoph Hellwig wrote: On Tue, Aug 20, 2013 at 06:00:06PM -0700, Andy Grover wrote: Instead of defining a second target_core_fabric_ops struct, use the same one as normal (tcm_qla2xxx_ops) and then fixup the changed methods. This should make it a little easier to pick

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Christoph Hellwig
On Wed, Aug 21, 2013 at 07:38:21AM -0700, Roland Dreier wrote: > I don't understand this. In fact the whole patch series looks quite > confused. COMPARE AND WRITE is a normal Data-Out command, with no > requirement for special bidirectional handling or anything like that. > The only slightly unus

Re: [PATCH 0/8] zfcp features and bugfixes for 3.12 merge window

2013-08-21 Thread James Bottomley
On Wed, 2013-08-21 at 17:05 +0200, Steffen Maier wrote: > James, > > here is a series of zfcp features and bugfixes > for the upcoming merge window preparing kernel v3.12. > The patches apply on top of the current misc branch of your scsi.git. OK, so this isn't going to work any more given Greg's

[PATCH 5/8] zfcp: fix schedule-inside-lock in scsi_device list loops

2013-08-21 Thread Steffen Maier
From: Martin Peschke BUG: sleeping function called from invalid context at kernel/workqueue.c:2752 in_atomic(): 1, irqs_disabled(): 1, pid: 360, name: zfcperp0.0.1700 CPU: 1 Not tainted 3.9.3+ #69 Process zfcperp0.0.1700 (pid: 360, task: 75b7e080, ksp: 7476bc30) Call Trace: ([<0

[PATCH 8/8] zfcp: enable FCP hardware data router by default

2013-08-21 Thread Steffen Maier
Enabling the data router support by default can increase performance in certain situations. It is safe to do so and tolerated in LPAR and under z/VM in case there is no data router support in that environment. Signed-off-by: Steffen Maier Reviewed-by: Martin Peschke --- drivers/s390/scsi/zfcp_q

[PATCH 6/8] zfcp: remove access control tables interface (keep sysfs files)

2013-08-21 Thread Steffen Maier
From: Martin Peschke By popular demand, this patch brings back a couple of sysfs attributes removed by commit 663e0890e31cb85f0cca5ac1faaee0d2d52880b5 "[SCSI] zfcp: remove access control tables interface". The content has been irrelevant for years, but the files must be there forever for whatever

[PATCH 7/8] zfcp: remove access control tables interface (port leftovers)

2013-08-21 Thread Steffen Maier
From: Martin Peschke This patch removes some leftovers for commit 663e0890e31cb85f0cca5ac1faaee0d2d52880b5 "[SCSI] zfcp: remove access control tables interface". The "access denied" case for ports is gone, as well. The corresponding flag was cleared, but never set. So clean it up. Sysfs flag is

[PATCH 4/8] zfcp: fix lock imbalance by reworking request queue locking

2013-08-21 Thread Steffen Maier
From: Martin Peschke This patch adds wait_event_interruptible_lock_irq_timeout(), which is a straight-forward descendant of wait_event_interruptible_timeout() and wait_event_interruptible_lock_irq(). The zfcp driver used to call wait_event_interruptible_timeout() in combination with some intrica

[PATCH 2/8] zfcp: cleanup use of obsolete strict_strto* functions

2013-08-21 Thread Steffen Maier
From: Martin Peschke strict_strtoul and friends are obsolete. Use kstrtoul functions instead. Signed-off-by: Martin Peschke Cc: Jingoo Han Signed-off-by: Steffen Maier --- drivers/s390/scsi/zfcp_aux.c |4 ++-- drivers/s390/scsi/zfcp_sysfs.c | 12 ++-- 2 files changed, 8 inser

[PATCH 1/8] zfcp: consistently use appropriate SBAL flag definitions

2013-08-21 Thread Steffen Maier
From: Martin Peschke minor cleanup for status read request Signed-off-by: Martin Peschke Signed-off-by: Steffen Maier --- drivers/s390/scsi/zfcp_fsf.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -770,7 +7

[PATCH 3/8] zfcp: dead code removal

2013-08-21 Thread Steffen Maier
From: Martin Peschke Get rid of unused function zfcp_fsf_get_req and corresponding prototype definition. Commit a54ca0f62f953898b05549391ac2a8a4dad6482b in v2.6.28 "[SCSI] zfcp: Redesign of the debug tracing for HBA records." accidentally introduced this code which was dead in the first place.

[PATCH 0/8] zfcp features and bugfixes for 3.12 merge window

2013-08-21 Thread Steffen Maier
James, here is a series of zfcp features and bugfixes for the upcoming merge window preparing kernel v3.12. The patches apply on top of the current misc branch of your scsi.git. Steffen Linux on System z Development IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Mar

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Roland Dreier
On Tue, Aug 20, 2013 at 1:08 PM, Nicholas A. Bellinger wrote: > Add a special case for COMPARE_AND_WRITE for the reverse data direction > mapping used for pci_map_sg() + friends. I don't understand this. In fact the whole patch series looks quite confused. COMPARE AND WRITE is a normal Data-Out

Re: [PATCH 2/4] scsi_debug: fix logical block provisioning support when unmap_alignment != 0

2013-08-21 Thread Akinobu Mita
2013/8/21 Douglas Gilbert : > On 13-08-19 10:16 AM, Akinobu Mita wrote: >> >> Hi Douglas, Martin, >> >> Could you review this patch when you have a time? I would like to >> submit at least this patch 2/4, and 1/4 which has already been acked >> by Douglas for the next merge window. >> >> Although

Re: [PATCH] [TRIVIAL] Remove braces in drivers/scsi/in2000.h to fix build for clang. No functional change otherwise.

2013-08-21 Thread Jan-Simon Möller
On Wednesday 21 August 2013 09:26:14 Jan-Simon Möller wrote: > > > Description: > > > Clang chokes on the notation "insw (%%dx)" but works for "insw %%dx" > > > (outsw likewise); GNU as accepts both forms. > > > > > > Signed-off-by: Jan-Simon M??ller > > > > I think the right fix is to simpl

Re: [PATCHv2] pm80xx: fix Adaptec 71605H hang

2013-08-21 Thread Jack Wang
On 07/31/2013 05:19 PM, Jack Wang wrote: > On 07/26/2013 06:43 PM, Hans Verkuil wrote: >> The IO command size is 128 bytes for these new controllers as opposed to 64 >> for the old 8001 controller. >> >> The Adaptec out-of-tree driver did this correctly. After comparing the two >> this turned out t

Re: SCSI core patches for kernel 3.12

2013-08-21 Thread Nicholas A. Bellinger
On Tue, 2013-08-20 at 23:48 -0700, Christoph Hellwig wrote: > On Tue, Aug 20, 2013 at 01:38:04PM -0700, Nicholas A. Bellinger wrote: > > , I only care about the performance against upstream code, so that > > would mean scsi_debug here. Typically the onus of demonstrating a > > performance improvem

Re: [PATCH] [TRIVIAL] Remove braces in drivers/scsi/in2000.h to fix build for clang. No functional change otherwise.

2013-08-21 Thread Jan-Simon Möller
> > > > Description: > > Clang chokes on the notation "insw (%%dx)" but works for "insw %%dx" > > (outsw likewise); GNU as accepts both forms. > > > > Signed-off-by: Jan-Simon M??ller > > I think the right fix is to simply kill the FAST_READ_IO/FAST_WRITE_IO > defines and their associated i

Re: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction

2013-08-21 Thread Nicholas A. Bellinger
On Tue, 2013-08-20 at 23:37 -0700, Christoph Hellwig wrote: > On Tue, Aug 20, 2013 at 08:08:00PM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Add a special case for COMPARE_AND_WRITE for the reverse data direction > > mapping used for pci_map_sg() + friends. > > A low

Re: [PATCH 6/9] target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction

2013-08-21 Thread Nicholas A. Bellinger
On Tue, 2013-08-20 at 23:35 -0700, Christoph Hellwig wrote: > On Tue, Aug 20, 2013 at 08:07:57PM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > COMPARE_AND_WRITE expects to be able to send down a DMA_FROM_DEVICE > > to obtain the necessary READ payload for comparision ag

Re: [PATCH 5/9] target: Skip ->queue_data_in() callbacks for COMPARE_AND_WRITE

2013-08-21 Thread Nicholas A. Bellinger
On Tue, 2013-08-20 at 23:32 -0700, Christoph Hellwig wrote: > > @@ -1832,7 +1832,8 @@ static void transport_complete_qf(struct se_cmd *cmd) > > ret = cmd->se_tfo->queue_data_in(cmd); > > break; > > case DMA_TO_DEVICE: > > - if (cmd->t_bidi_data_sg) { > > +