summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_transport.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2015-02-27 22:05:21 -0800
committerNicholas Bellinger <nab@linux-iscsi.org>2015-04-07 23:25:59 -0700
commit38b57f82f66dfb21ebe321d71c84c0e3469980c4 (patch)
treec5e5727d222617a6c59013f0b597b47e4f3dd9ce /drivers/target/target_core_transport.c
parent823ddd877f3a5c301490196d369f68baa6c020e4 (diff)
downloadlinux-38b57f82f66dfb21ebe321d71c84c0e3469980c4.tar.bz2
target: Add protected fabric + unprotected device support
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 + READ_INSERT operations when functioning with non T10-PI enabled devices, seperate from any available hw offloads the fabric supports. This is done using a new se_sess->sess_prot_type that is set at fabric session creation time based upon the TPG attribute. It currently cannot be changed for individual sessions after initial creation. Also, update existing target_core_sbc.c code to honor sess_prot_type when setting up cmd->prot_op + cmd->prot_type assignments. (Add unlikely and !! boolean conversion in sbc_check_prot - Sagi) Cc: Martin Petersen <martin.petersen@oracle.com> Cc: Sagi Grimberg <sagig@mellanox.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Doug Gilbert <dgilbert@interlog.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r--drivers/target/target_core_transport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 4a00ed5c1880..aef989e165ed 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -322,11 +322,19 @@ void __transport_register_session(
struct se_session *se_sess,
void *fabric_sess_ptr)
{
+ struct target_core_fabric_ops *tfo = se_tpg->se_tpg_tfo;
unsigned char buf[PR_REG_ISID_LEN];
se_sess->se_tpg = se_tpg;
se_sess->fabric_sess_ptr = fabric_sess_ptr;
/*
+ * Determine if fabric allows for T10-PI feature bits to be exposed
+ * to initiators for device backends with !dev->dev_attrib.pi_prot_type
+ */
+ if (tfo->tpg_check_prot_fabric_only)
+ se_sess->sess_prot_type = tfo->tpg_check_prot_fabric_only(se_tpg);
+
+ /*
* Used by struct se_node_acl's under ConfigFS to locate active se_session-t
*
* Only set for struct se_session's that will actually be moving I/O.