diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-02-28 01:05:21 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-04-08 02:25:59 -0400 |
commit | 38b57f82f66dfb21ebe321d71c84c0e3469980c4 (patch) | |
tree | c5e5727d222617a6c59013f0b597b47e4f3dd9ce /include/target | |
parent | 823ddd877f3a5c301490196d369f68baa6c020e4 (diff) |
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 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 1 | ||||
-rw-r--r-- | include/target/target_core_fabric.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 672150b6aaf5..fe25a78fff46 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -616,6 +616,7 @@ struct se_session { | |||
616 | unsigned sess_tearing_down:1; | 616 | unsigned sess_tearing_down:1; |
617 | u64 sess_bin_isid; | 617 | u64 sess_bin_isid; |
618 | enum target_prot_op sup_prot_ops; | 618 | enum target_prot_op sup_prot_ops; |
619 | enum target_prot_type sess_prot_type; | ||
619 | struct se_node_acl *se_node_acl; | 620 | struct se_node_acl *se_node_acl; |
620 | struct se_portal_group *se_tpg; | 621 | struct se_portal_group *se_tpg; |
621 | void *fabric_sess_ptr; | 622 | void *fabric_sess_ptr; |
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 2f4a2505db4c..c93cfdf0d8e5 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -27,6 +27,14 @@ struct target_core_fabric_ops { | |||
27 | * inquiry response | 27 | * inquiry response |
28 | */ | 28 | */ |
29 | int (*tpg_check_demo_mode_login_only)(struct se_portal_group *); | 29 | int (*tpg_check_demo_mode_login_only)(struct se_portal_group *); |
30 | /* | ||
31 | * Optionally used as a configfs tunable to determine when | ||
32 | * target-core should signal the PROTECT=1 feature bit for | ||
33 | * backends that don't support T10-PI, so that either fabric | ||
34 | * HW offload or target-core emulation performs the associated | ||
35 | * WRITE_STRIP and READ_INSERT operations. | ||
36 | */ | ||
37 | int (*tpg_check_prot_fabric_only)(struct se_portal_group *); | ||
30 | struct se_node_acl *(*tpg_alloc_fabric_acl)( | 38 | struct se_node_acl *(*tpg_alloc_fabric_acl)( |
31 | struct se_portal_group *); | 39 | struct se_portal_group *); |
32 | void (*tpg_release_fabric_acl)(struct se_portal_group *, | 40 | void (*tpg_release_fabric_acl)(struct se_portal_group *, |