[GIT PULL] target fixes for v4.0

2015-04-10 Thread Nicholas A. Bellinger
Hi Linus, Here are the outstanding target fixes for v4.0 code. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master Just a few small fixes. Two from Andy, the first addresses a v4.0 target specific regression to a user visible configfs at

Re: [PATCH v2 2/2] target/rd: Don't pass imcomplete scatterlist entries to sbc_dif_verify_*

2015-04-08 Thread Nicholas A. Bellinger
On Wed, 2015-04-08 at 23:25 +0900, Akinobu Mita wrote: > 2015-04-08 14:13 GMT+09:00 Nicholas A. Bellinger : > > On Sun, 2015-04-05 at 23:59 +0900, Akinobu Mita wrote: > >> The scatterlist for protection information which is passed to > >> sbc_dif_verify_read() or sbc_

Re: [PATCH] target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling

2015-04-08 Thread Nicholas A. Bellinger
On Wed, 2015-04-08 at 18:33 +0200, Christoph Hellwig wrote: > This fixes the crash that I saw, but the Compare and Write testcast > in the scsi testsuite still fails.. I'm not seeing this on my end: root@scsi-mq:/usr/src/libiscsi.git# ./test-tool/iscsi-test-cu --test LINUX.CompareAndWrite /dev/s

Re: [PATCH-v2 02/15] target: Add protected fabric + unprotected device support

2015-04-08 Thread Nicholas A. Bellinger
On Tue, 2015-04-07 at 19:27 -0400, Martin K. Petersen wrote: > >>>>> "nab" == Nicholas A Bellinger writes: > > nab> This specifically is to allow LIO to perform WRITE_STRIP + > nab> READ_INSERT operations when functioning with non T10-PI enabled >

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-04-07 Thread Nicholas A. Bellinger
On Mon, 2015-04-06 at 23:17 -0700, Christoph Hellwig wrote: > On Thu, Apr 02, 2015 at 01:57:10PM -0700, Nicholas A. Bellinger wrote: > > > mempools are for I/O path that make guaranteed progress. While the > > > callers of core_enable_device_list_for_node are in the control p

Re: [PATCH v2 2/2] target/rd: Don't pass imcomplete scatterlist entries to sbc_dif_verify_*

2015-04-07 Thread Nicholas A. Bellinger
On Sun, 2015-04-05 at 23:59 +0900, Akinobu Mita wrote: > The scatterlist for protection information which is passed to > sbc_dif_verify_read() or sbc_dif_verify_write() requires that > neighboring scatterlist entries are contiguous or chained so that they > can be iterated by sg_next(). > > Howeve

Re: [PATCH v2 1/2] target/rd: reduce code duplication in rd_execute_rw()

2015-04-07 Thread Nicholas A. Bellinger
On Sun, 2015-04-05 at 23:59 +0900, Akinobu Mita wrote: > Factor out code duplication in rd_execute_rw() into a helper function > rd_do_prot_rw(). This change is required to minimize the forthcoming > fix in rd_do_prot_rw(). > > Signed-off-by: Akinobu Mita > Cc: Nicholas Bellinger > Cc: Sagi Gri

[PATCH] target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling

2015-04-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes a bug for COMPARE_AND_WRITE handling with fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC. It adds the missing allocation for cmd->t_bidi_data_sg within transport_generic_new_cmd() that is used by COMPARE_AND_WRITE for the initial READ payload, even if t

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-04-02 Thread Nicholas A. Bellinger
On Thu, 2015-04-02 at 01:56 -0700, Christoph Hellwig wrote: > On Wed, Apr 01, 2015 at 10:37:27PM -0700, Nicholas A. Bellinger wrote: > > On Wed, 2015-04-01 at 00:04 -0700, Christoph Hellwig wrote: > > > On Tue, Mar 31, 2015 at 11:51:56PM -0700, Nicholas A. Bellinger wrote: >

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-04-01 Thread Nicholas A. Bellinger
On Wed, 2015-04-01 at 00:04 -0700, Christoph Hellwig wrote: > On Tue, Mar 31, 2015 at 11:51:56PM -0700, Nicholas A. Bellinger wrote: > > Since last week, enable/disable device_list code has been converted to > > use mempool + call_rcu() and performs the RCU pointer swap in

Re: [PATCH-v2 02/15] target: Add protected fabric + unprotected device support

2015-04-01 Thread Nicholas A. Bellinger
On Wed, 2015-04-01 at 12:04 +0300, Sagi Grimberg wrote: > On 4/1/2015 8:49 AM, Nicholas A. Bellinger wrote: > > On Mon, 2015-03-30 at 10:51 +0300, Sagi Grimberg wrote: > >> On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > >>> From: Nicholas Bellinger >

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 05:08 -0700, Christoph Hellwig wrote: > I went through this in detail, and the odd patch split that splits > one change up into muliple patches, but then also mixes up other > changes makes it hard to read. > Thanks for having a look. Will fix up patch ordering for -v2. >

Re: [PATCH-v2 15/15] iscsi/iser-target: Add fabric_prot_type attribute support

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 11:11 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch updates iscsi/iser-target to add a new fabric_prot_type > > TPG attribute for iser-target, used for controlli

Re: [PATCH-v2 11/15] loopback: Add fabric_prot_type attribute support

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 11:07 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch updates loopback to add a new fabric_prot_type TPG attribute, > > used for controlling LLD level protectio

Re: [PATCH-v2 06/15] target: Move cmd->prot_op check into target_check_read_prot

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 11:02 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch moves the existing target_complete_ok_work() check for > > cmd->prot_op into it's own function, so it

Re: [PATCH-v2 05/15] target: Add internal WRITE_STRIP support

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 11:01 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds WRITE_STRIP support in target_check_write_prot() that > > invokes sbc_dif_verify_write() for chec

Re: [PATCH-v2 04/15] target: Move cmd->prot_op check into target_check_write_prot

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 10:57 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch moves the existing target_execute_cmd() check for > > cmd->prot_op into it's own function, so it

Re: [PATCH-v2 02/15] target: Add protected fabric + unprotected device support

2015-03-31 Thread Nicholas A. Bellinger
On Mon, 2015-03-30 at 10:51 +0300, Sagi Grimberg wrote: > On 3/30/2015 6:28 AM, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds a new target_core_fabric_ops callback for allowing fabric > > drivers to expose a TPG attribute for signal

[PATCH-v2 06/15] target: Move cmd->prot_op check into target_check_read_prot

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch moves the existing target_complete_ok_work() check for cmd->prot_op into it's own function, so it's easier to add future support for READ INSERT. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/tar

[PATCH-v2 11/15] loopback: Add fabric_prot_type attribute support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates loopback to add a new fabric_prot_type TPG attribute, used for controlling LLD level protection into LIO when the backend device does not support T10-PI. Also, go ahead and set DIN_PASS + DOUT_PASS so target-core knows that it will be doing any WRITE_S

[PATCH-v2 10/15] target/rd: Add checks for backend DIF emulation

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Make sure that RAMDISK only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_rd.c | 6 -- 1 file changed, 4 insertions(+), 2 de

[PATCH-v2 04/15] target: Move cmd->prot_op check into target_check_write_prot

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch moves the existing target_execute_cmd() check for cmd->prot_op into it's own function, so it's easier to add future support for WRITE STRIP. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/t

[PATCH-v2 15/15] iscsi/iser-target: Add fabric_prot_type attribute support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates iscsi/iser-target to add a new fabric_prot_type TPG attribute for iser-target, used for controlling LLD level protection into LIO when the backend device does not support T10-PI. This is required for ib_isert to enable WRITE_STRIP + READ_INSERT hardwar

[PATCH-v2 12/15] vhost/scsi: Add fabric_prot_type attribute support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates vhost-scsi to add a new fabric_prot_type TPG attribute, used for controlling LLD level protection into LIO when the backend device does not support T10-PI. This is required for vhost-scsi to enable WRITE_STRIP + READ_INSERT operations using software em

[PATCH-v2 05/15] target: Add internal WRITE_STRIP support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds WRITE_STRIP support in target_check_write_prot() that invokes sbc_dif_verify_write() for checking T10-PI metadata before submitting the I/O to a backend driver. Upon verify failure, the specific sense code is propigated up the failure path up to transport

[PATCH-v2 14/15] tcm_qla2xxx: Add fabric_prot_type attribute support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates qla2xxx target to add a new fabric_prot_type TPG attribute, used for controlling LLD level protection into LIO when the backend device does not support T10-PI. This is required for qla_target.c to enable WRITE_STRIP + READ_INSERT hardware offloads. It

[PATCH-v2 07/15] target: Add internal READ_INSERT support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds READ_INSERT support in target_check_read_prot() that invokes sbc_dif_generate() when LIO is responsible for generating the outgoing T10-PI. Required for supporting fabrics that exchange protection information, and would like to function with un-protected

[PATCH-v2 08/15] target/file: Add checks for backend DIF emulation

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Make sure that FILEIO only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_file.c | 8 1 file chan

[PATCH-v2 03/15] target: Update SPC/SBC emulation for sess_prot_type

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates standard INQUIRY, INQUIRY EVPD=0x86, READ_CAPACITY_16 and control mode pages to use se_sess->sess_prot_type when determing which type of T10-PI related feature bits can be exposed. This is required for fabric sessions supporting T10-PI metadata to back

[PATCH-v2 13/15] tcm_qla2xxx: Set TARGET_PROT_ALL for sup_prot_ops

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds the missing TARGET_PROT_ALL when initializing a new session and declaring the capable se_sess->sup_prot_ops for T10-PI. This is required in order to function with existing qla_target.c DIF protection offload support. Cc: Quinn Tran Cc: Saurav Kashyap C

[PATCH-v2 09/15] target/iblock: Add checks for backend DIF emulation

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Make sure that IBLOCK only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_iblock.c | 2 +- 1 file changed,

[PATCH-v2 02/15] target: Add protected fabric + unprotected device support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new target_core_fabric_ops callback for allowing fabric drivers to expose a TPG attribute for signaling when a T10-PI protected fabric wants to function with an un-protected device without T10-PI. This specifically is to allow LIO to perform WRITE_STRIP

[PATCH-v2 01/15] target: Convert DIF emulation to use cmd->prot_type

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes existing DIF emulation to check the command descriptor's prot_type, instead of what the backend device is exposing in pi_prot_type. Since this value is already set in sbc_check_prot(), go ahead and use it to allow protected fabrics to function with unp

[PATCH-v2 00/15] target: Add WRITE_STRIP + READ_INSERT support

2015-03-29 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MKP, Sagi, Quinn, & Co, Here is -v2 for adding target internal WRITE_STRIP + READ_INSERT DIX emulation using target_core_sbc.c + crct10dif.ko code. This mode is for allowing T10-PI capable fabrics to interoperate with backend devices that have not yet had protection

[RFC 20/22] target: Rename LUN lookup/add/remove to target_* prefix

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This includes: - target_add_lun - target_remove_lun - target_lookup_cmd_lun - target_lookup_tmr_lun - target_clear_lun_from_tpg Also, update fabric drivers for loopback, iscsi/iser-target, xen-scsiback. Signed-off-by: Nicholas Bellinger --- drivers/target/i

[RFC 21/22] target: Rename se_node_acl->lun_entry_hlist to target_* prefix

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This includes: - target_add_node_to_devs - target_get_deve_from_rtpi - target_create_device_list_for_node - target_free_device_list_for_node - target_enable_device_list_for_node - target_disable_device_list_for_node Signed-off-by: Nicholas Bellinger --- dr

[RFC 16/22] target: Drop se_lun->lun_acl_list

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_device.c | 13 - drivers/target/target_core_tpg.c| 4 include/target/target_core_base.h | 3 --- 3 files changed, 20 deletions(-) diff --git a/drivers/target/target_core_device.c

[RFC 15/22] target: Convert core_tpg_deregister to use list splice

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts core_tpg_deregister() to perform a list splice for any remaining dynamically generated se_node_acls attached to se_tpg, before calling tfo->tpg_release_fabric_acl() to free memory. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-

[RFC 19/22] target: Rename TPG register/deregister to target_* prefix

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This includes: - target_register_tpg - target_deregister_tpg This includes updates for loopback, tcm_fc, iscsi/iser-target, ib_srpt, sbp-target, usb-gadget, tcm_qla2xxx, vhost-scsi and xen-scsiback. Signed-off-by: Nicholas Bellinger --- drivers/infiniband/ulp/srp

[RFC 17/22] target: Drop core_tpg_clear_object_luns

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- drivers/target/iscsi/iscsi_target_tpg.c | 2 -- drivers/target/target_core_tpg.c| 21 - include/target/target_core_fabric.h | 1 - 3 files changed, 24 deletions(-) diff --git a/drivers/target/iscsi

[RFC 18/22] target: Rename TPG initiator_node_acl to target_* prefix

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This includes + fabric driver changes: - target_check_initiator_node_acl - target_add_initiator_node_acl - target_del_initiator_node_acl - target_set_initiator_node_queue_depth - target_del_initiator_node_acl - target_get_initiator_node_acl - target_clear_i

[RFC 22/22] target: Rename se_port/se_device export to target_* prefix

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This includes: - target_alloc_port - target_export_port - target_release_port - target_dev_export - target_dev_unexport Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_device.c | 16 drivers/target/target_core_internal.h |

[RFC 04/22] target/configfs: Convert mappedlun link/unlink to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts fabric independent configfs link/unlink to use RCU read path macros for se_node_acl->lun_entry_hlist[] access. Also, update show_write_protect attribute access as well. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nic

[RFC 10/22] target/pr: Change alloc_registration to avoid pr_reg_tg_pt_lun

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes __core_scsi3_do_alloc_registration() code to drop pr_reg->pr_reg_tg_pt_lun pointer usage in favor of a new pr_reg RPTI + existing target_lun. It also includes changes to REGISTER, REGISTER_AND_MOVE and APTPL feature bit codepaths. Cc: Hannes Reinecke

[RFC 06/22] target/spc: Convert REPORT_LUN + MODE_SENSE to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts SPC emulation for REPORT_LUN + MODE_SENSE to use RCU read path macros for se_node_acl->lun_entry_hlist[] access. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_spc.c |

[RFC 11/22] target: Convert UNIT_ATTENTION logic to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts target_core_ua.c code to use RCU read path macros for se_node_acl->lun_entry_hlist[] access. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_ua.c | 35 ++

[RFC 13/22] target: Convert se_tpg->acl_node_lock to ->acl_node_mutex

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_tpg->acl_node_lock to struct mutex, so that ->acl_node_acl walkers in core_clear_lun_from_tpg() can block when calling core_disable_device_list_for_node(). It also updates core_dev_add_lun() to hold ->acl_node_mutex when calling core_tpg_add_node_t

[RFC 07/22] target/pscsi: Convert MODE_SENSE special case to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts the MODE_SENSE special case in pscsi_transport_complete() to use RCU read path macros for se_node_acl->lun_entry_hlist[] access. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/targ

[RFC 09/22] target/pr: Convert registration check to RCU pointer

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts core_scsi3_pr_seq_non_holder() check for non reservation holding registrations to use se_deve->pr_reg as an RCU protected pointer. It also includes associated rcu_assign_pointer() + synchronize_rcu() in __core_scsi3_add_registration() and __core_scsi3

[RFC 14/22] target: Convert se_node_acl->lun_entry_lock to ->lun_entry_mutex

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now that se_node_acl->lun_entry_hlist[] fast path access uses RCU, go ahead and convert se_node_acl->lun_entry_lock to struct mutex, for non fast-path RCU updater code. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger ---

[RFC 12/22] target: Convert se_tpg->tpg_lun_lock to ->tpg_lun_mutex

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Now that se_node_acl->lun_entry_hlist[] is using RCU, convert existing se_tpg->tpg_lun_lock to struct mutex so core_tpg_add_node_to_devs() can perform RCU updater logic without releasing ->tpg_lun_mutex. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Sign

[RFC 08/22] target/pr: Convert se_dev_entry to percpu-refcount for RCU

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts se_dev_entry->pr_ref_count access to use modern percpu reference counting. It updates core_enable_device_list_for_node() to percpu_ref_init() when se_dev_entry is being enabled. It also updates core_disable_device_list_for_node() to percpu_ref_kill()

[RFC 05/22] target/configfs: Convert SCSI MIB attrs to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts SCSI MIB configfs show attribute code to use RCU read path macros for se_node_acl->lun_entry_hlist[] access. Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_stat.c | 168

[RFC 03/22] target/device: Convert se_node_acl->device_list access to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts various target_core_device.c to RCU reader path to extract deve->mapped_lun before rcu_read_unlock() ahead of invoking core_disable_device_list_for_node() to trigger subsequent RCU updater code. It includes core_free_device_list_for_node(), core_clear

[RFC 02/22] target: Convert enable/disable ->device_list to RCU updater

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts core_[enable,disable]_device_list_for_node() to RCU updater path code when modifying se_dev_entry pointers. It includes protected rcu_assign_pointer() and invokes synchronize_rcu() to wait for RCU read paths to finish. Required for subsequent convers

[RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi Hannes, HCH, & Sagi, Here is an initial pass at the conversion of se_node_acl->device_list[] to use RCU protected pointers for se_lun fast-path lookup code. The big advantage with RCU is that transport_lookup_cmd_lun() can now run completely lock-less using existing

[RFC 01/22] target: Convert transport_lookup_*_lun to RCU reader

2015-03-27 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts transport_lookup_*_lun() fast-path code to use RCU read path primitives when looking up se_dev_entry. It adds a new array of pointers in se_node_acl->lun_entry_hlist for this purpose. For transport_lookup_cmd_lun() code, it works with existing per-cp

Re: [PATCH 1/3] iscsi-target: Convert iscsi_thread_set usage to kthread.h

2015-03-25 Thread Nicholas A. Bellinger
On Tue, 2015-03-24 at 18:37 +0200, Sagi Grimberg wrote: > On 3/23/2015 2:21 PM, Sagi Grimberg wrote: > > On 3/21/2015 8:16 AM, Nicholas A. Bellinger wrote: > >> From: Nicholas Bellinger > >> > >> This patch converts iscsi-target code to use modern kthread.h

[PATCH 2/3] iscsi-target: Drop legacy iscsi_target_tq.c logic

2015-03-20 Thread Nicholas A. Bellinger
;iscsi_target_erl0.h" diff --git a/drivers/target/iscsi/iscsi_target_tq.c b/drivers/target/iscsi/iscsi_target_tq.c deleted file mode 100644 index 26aa509..000 --- a/drivers/target/iscsi/iscsi_target_tq.c +++ /dev/null @@ -1,495 +0,0 @@ -/***

[PATCH 1/3] iscsi-target: Convert iscsi_thread_set usage to kthread.h

2015-03-20 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch converts iscsi-target code to use modern kthread.h API callers for creating RX/TX threads for each new iscsi_conn descriptor, and releasing associated RX/TX threads during connection shutdown. This is done using iscsit_start_kthreads() -> kthread_run() to star

[PATCH 3/3] iser-target: Handle special case for logout during connection failure

2015-03-20 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds special case handling during ISCSI_OP_LOGIN_RSP ib_wr failure, where isert_cq_comp_err() is responsible for calling the remaining isert_response_completion() -> isert_do_control_comp() -> iscsit_logout_post_handler() to drop the last iscsi_conn reference.

[PATCH 0/3] iscsi/iser-target: Convert to kthread.h + fix logout failure

2015-03-20 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hello Sagi & Slava, Following the earlier pre-LSF discussion, here is a patch series to convert iscsi/iser target to using modern kthread.h primitives when starting / stopping RX + TX kernel threads during iscsi_conn creation / shutdown. So far this code has been tested

[GIT PULL] target fixes for v4.0-rc5

2015-03-20 Thread Nicholas A. Bellinger
Hi Linus, Here are current target-pending fixes for v4.0-rc5 code that have made their way into the queue over the last weeks. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master The fixes this round include: - Fix long-standing iser-t

Re: [PATCH 15/15] iscsi-target: don't export static symbol

2015-03-20 Thread Nicholas A. Bellinger
On Wed, 2015-03-11 at 17:56 +0100, Julia Lawall wrote: > From: Julia Lawall > > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @r@ > type T; > identifier f; > @@ > > static T f (...) { ... } > > @@ > identifier r.f; > declarer name EXPORT_SYM

Re: noise in target_core_register_fabric

2015-03-20 Thread Nicholas A. Bellinger
On Wed, 2015-03-18 at 08:49 +0100, Olaf Hering wrote: > On Wed, Mar 04, Olaf Hering wrote: > > > Is there a need to fill dmesg with noise like shown below whenever > > targetcli-3.0 runs a command? I think the pr_err calls in those functions > > should be converted to pr_debug. > > Any update on

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-06 Thread Nicholas A. Bellinger
On Fri, 2015-03-06 at 11:15 -0800, Andy Grover wrote: > This isn't a problem, because having a configuration for a device's WWNs > in configfs does not mean the device must be present. When the device > shows up then the target config will be used for it, and if the device > is removed the co

[PATCH 2/3] iscsi-target: Expose per endpoint dynamic_sessions attribute

2015-03-06 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch exposes a new ../iscsi/$IQN/$TPGT/dynamic_sessions attribute to dump the currently active sessions by iSCSI InitiatorName that have been created with dynamically generated se_node_acls. This information is useful so that user-space can optionally perform dynam

[PATCH 1/3] target: Add target_show_dynamic_sessions attribute helper

2015-03-06 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new helper function that can be used by fabric driver TPG attributes for dumping the list of active sessions with a dynamically generated se_node_acl. (generate_node_acl=1). It prints one se_node_acl->initiatorname per line, up to PAGE_SIZE which is due

[PATCH 3/3] tcm_qla2xxx: Expose per endpoint dynamic_sessions attribute

2015-03-06 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch exposes a new ../qla2xxx*/$WWPN/$TPGT/dynamic_sessions attribute to dump the currently active sessions by FC initiator WWPN that have been created with dynamically generated se_node_acls. This information is useful so that user-space can optionally perform dyn

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-06 Thread Nicholas A. Bellinger
On Fri, 2015-03-06 at 08:25 +0100, Bart Van Assche wrote: > On 03/05/15 19:39, Andy Grover wrote: > > On 03/05/2015 08:06 AM, Bart Van Assche wrote: > >> If we would do what Nic proposed - modify SCST such that it uses > >> configfs instead of sysfs - then that would result in the removal of at > >

Re: iSCSI bug

2015-03-05 Thread Nicholas A. Bellinger
Hi Edgaras, Adding target-devel CC. On Thu, 2015-03-05 at 17:56 +0200, Edgaras Lukoševičius wrote: > Hello, > > we have a problem. iscsi connection is dropping constantly. After enabling > iscsi debug following message popped up after iscsi connection got lost: > > # Kernel > 3.18.6-1.el7.elre

[PATCH] target: Fix virtual LUN=0 target_configure_device failure OOPs

2015-03-04 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes a NULL pointer dereference triggered by a late target_configure_device() -> alloc_workqueue() failure that results in target_free_device() being called with DF_CONFIGURED already set, which subsequently OOPses in destroy_workqueue() code. Currently this

Re: noise in target_core_register_fabric

2015-03-04 Thread Nicholas A. Bellinger
On Wed, 2015-03-04 at 16:46 +0100, Olaf Hering wrote: > Is there a need to fill dmesg with noise like shown below whenever > targetcli-3.0 runs a command? I think the pr_err calls in those functions > should be converted to pr_debug. > Fair enough. Care to send out a patch for this..? ;) --nab

Re: crash in pscsi_get_device_type

2015-03-04 Thread Nicholas A. Bellinger
On Wed, 2015-03-04 at 16:00 +0100, Olaf Hering wrote: > On Fri, Feb 27, Nicholas A. Bellinger wrote: > > > On Thu, 2015-02-26 at 10:26 +0100, Olaf Hering wrote: > > > > [ 145.661468] IP: [] pscsi_get_device_type+0xb/0x20 > > > [target_core_pscsi] > > L

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-01 Thread Nicholas A. Bellinger
On Sat, 2015-02-28 at 12:59 +0100, Bart Van Assche wrote: > On 02/27/15 22:58, Nicholas A. Bellinger wrote: > > Looking at how your attempting to drive creation + removal of struct > > config_group from within kernel code here: > > > > target: Add target port

[PATCH 5/9] target: Add internal WRITE_STRIP support

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds WRITE_STRIP support in target_check_write_prot() that invokes sbc_dif_verify_write() for checking T10-PI metadata before submitting the I/O to a backend driver. Upon verify failure, the specific sense code is propigated up the failure path up to transport

[PATCH 3/9] target: Update SPC/SBC emulation for sess_prot_type

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates standard INQUIRY, INQUIRY EVPD=0x86, READ_CAPACITY_16 and control mode pages to use se_sess->sess_prot_type when determing which type of T10-PI related feature bits can be exposed. This is required for fabric sessions supporting T10-PI metadata to back

[PATCH 4/9] target: Move cmd->prot_op check into target_check_write_prot

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch moves the existing target_execute_cmd() check for cmd->prot_op into it's own function, so it's easier to add future support for WRITE STRIP. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/t

[PATCH 9/9] loopback: Add fabric_prot_type attribute support

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates loopback to add a new fabric_prot_type TPG attribute, used for controlling LLD level protection into LIO when the backend device does not support T10-PI. Also, go ahead and set DIN_PASS + DOUT_PASS so target-core knows that it will be doing any WRITE_S

[PATCH 8/9] target/file: Add checks for backend DIF emulation

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Make sure that FILEIO only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_file.c | 8 1 file chan

[PATCH 6/9] target: Move cmd->prot_op check into target_check_read_prot

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch moves the existing target_complete_ok_work() check for cmd->prot_op into it's own function, so it's easier to add future support for READ INSERT. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/tar

[PATCH 7/9] target: Add internal READ_INSERT support

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds READ_INSERT support in target_check_read_prot() that invokes sbc_dif_generate() when LIO is responsible for generating the outgoing T10-PI. Required for supporting fabrics that exchange protection information, and would like to function with un-protected

[PATCH 2/9] target: Add protected fabric + unprotected device support

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new target_core_fabric_ops callback for allowing fabric drivers to expose a TPG attribute for signaling when a T10-PI protected fabric wants to function with an un-protected device without T10-PI. This specifically is to allow LIO to perform WRITE_STRIP

[PATCH 1/9] target: Convert DIF emulation to use cmd->prot_type

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes existing DIF emulation to check the command descriptor's prot_type, instead of what the backend device is exposing in pi_prot_type. Since this value is already set in sbc_check_prot(), go ahead and use it to allow protected fabrics to function with unp

[PATCH 0/9] target: Add WRITE_STRIP + READ_INSERT support

2015-02-28 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MKP, Sagi, & Co, This series adds support for internal WRITE_STRIP + READ_INSERT DIX operations using existing target_core_sbc.c DIF emulation. It's useful in order for T10-PI fabrics to interoperate between backend devices that don't have protection available or ena

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-02-27 Thread Nicholas A. Bellinger
On Wed, 2015-02-25 at 09:43 +0100, Bart Van Assche wrote: > On 02/21/15 01:00, Nicholas A. Bellinger wrote: > > On Fri, 2015-02-20 at 11:49 +0100, Bart Van Assche wrote: > >> What I proposed myself consists of three steps: > >> 1. Updating the LIO SRP target driver to a

Re: [PATCH for kernel 4.1] Split SCSI header files

2015-02-27 Thread Nicholas A. Bellinger
On Wed, 2015-02-25 at 09:40 +0100, Bart Van Assche wrote: > Move the constants and functions that are used by both initiator and > target drivers into new header files. This change will allow to modify > the SCSI target code such that the initiator SCSI header files are no > longer included. Note:

Re: [patch] tcm_fc: missing curly braces in ft_invl_hw_context()

2015-02-27 Thread Nicholas A. Bellinger
On Wed, 2015-02-25 at 16:21 +0300, Dan Carpenter wrote: > From the indenting, it looks like curly braces were intended here. > > Fixes: dcd998ccdbf7 ('tcm_fc: Handle DDP/SW fc_frame_payload_get failures in > ft_recv_write_data') > Signed-off-by: Dan Carpenter > > diff --git a/drivers/target/tcm

Re: crash in pscsi_get_device_type

2015-02-27 Thread Nicholas A. Bellinger
Hi Olaf, Thanks for your detailed bug report. Comments below. On Thu, 2015-02-26 at 10:26 +0100, Olaf Hering wrote: > While attempting to understand the Xen scsi backend driver I got this > crash using the script shown below: > > > [ 145.495887] Rounding down aligned max_sectors from 4294

Re: [PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage

2015-02-22 Thread Nicholas A. Bellinger
On Sun, 2015-02-22 at 17:41 +0100, Christoph Hellwig wrote: > On Sat, Feb 14, 2015 at 03:27:40AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds a sbc_check_dpofua() function that performs sanity > > checks for DPO/FUA command b

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-02-20 Thread Nicholas A. Bellinger
On Fri, 2015-02-20 at 11:49 +0100, Bart Van Assche wrote: > On 01/19/15 10:36, Bart Van Assche wrote: > > On 01/19/15 10:22, Christoph Hellwig wrote: > >> On Thu, Jan 15, 2015 at 05:13:00PM +0100, Bart Van Assche wrote: > >>> My goal is to realize this proposal without adding hooks for out-of-tree

[GIT PULL] target updates for v3.20-rc1

2015-02-20 Thread Nicholas A. Bellinger
Hi Linus, Here are the target updates for v3.20-rc1 code. Please go ahead and pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next A heads up that you'll hit two merge conflicts as reported by SFR in linux-next recently within drivers/vhost/scsi.c code. Th

[PATCH 8/8] target: Set LBPWS10 bit in Logical Block Provisioning EVPD

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch sets the missing LBPWS10 bit within spc_emulate_evpd_b2() in order to signal WRITE_SAME (10) w/ UNMAP support, following the existing LBPWS bit to signal WRITE_SAME (16) w/ UNMAP support. Cc: Martin Petersen Cc: Christoph Hellwig Signed-off-by: Nicholas Bell

[PATCH 6/8] target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a check within sbc_setup_write_same() to fail a WRITE_SAME w/ UNMAP=1 op, if the backend device has emulate_tpws disabled. Cc: Martin Petersen Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_sbc.c | 5 + 1 fi

[PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a sbc_check_dpofua() function that performs sanity checks for DPO/FUA command bits. It introduces checks to fail when either bit is set, but the backend device is not advertising support for them. It also moves the existing cmd->se_cmd_flags |= SCF_FUA a

[PATCH 7/8] target: Fail UNMAP when emulate_tpu=0

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a check within sbc_parse_cdb() to fail a UNMAP op, if the backend device has emulate_tpu disabled. Cc: Martin Petersen Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_sbc.c | 5 + 1 file changed, 5 insertions

[PATCH 4/8] target: Perform PROTECT sanity checks for WRITE_SAME

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a call to sbc_check_prot() within sbc_setup_write_same() code to perform the various protection releated sanity checks, including failing if WRPROTECT or RDPROTECT is set for a backend device that has not advertised support for T10-PI. Also, since WRITE_S

[PATCH 3/8] target: Fail I/O with PROTECT bit when protection is unsupported

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds an explicit check for WRPROTECT + RDPROTECT bit usage within sbc_check_prot(), and fails with TCM_INVALID_CDB_FIELD if the backend device does not have protection enabled. Also, update sbc_check_prot() to return sense_reason_t in order to propigate up the

[PATCH 2/8] target: Check for LBA + sectors wrap-around in sbc_parse_cdb

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a check to sbc_parse_cdb() in order to detect when an LBA + sector vs. end-of-device calculation wraps when the LBA is sufficently large enough (eg: 0x). Cc: Martin Petersen Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- d

[PATCH 0/8] target: Fixes for SPC/SBC device emulation

2015-02-13 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi all, The following patch series contains a number of target SPC/SBC related emulation fixes that address failures occurring while using Ronnie Sahlberg's excellent libiscsi test suite. The first two are the important ones. Patch #1 adds a missing end-of-device sanit

<    2   3   4   5   6   7   8   9   10   11   >