diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-02-19 10:50:19 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-04-07 04:48:43 -0400 |
commit | 5b168dcd6aa69f7421a7738eada749d376dd1253 (patch) | |
tree | 89bf96930fc011263b59a6a8f106285015dac869 | |
parent | 48f5e7b3dc1eb88cdc7772bd6a7bbb99c8843ae0 (diff) |
Target/iscsi: Add T10-PI indication for iscsi_portal_group
In case an iscsi portal group will be defined as t10_pi enabled,
all connections on top of it will support protected transactions.
T10-PI support may require extra reource allocation and maintenance by
the transport layer, so we don't want to apply them on non-t10_pi network
portals. This is a hook for the iscsi target layer to signal the transport
at connection establishment that this connection will carry protected
transactions.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/iscsi/iscsi_target_core.h | 5 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tpg.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index 48f7b3bf4e8c..886d74d6f3d4 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h | |||
@@ -58,7 +58,8 @@ | |||
58 | #define TA_DEMO_MODE_DISCOVERY 1 | 58 | #define TA_DEMO_MODE_DISCOVERY 1 |
59 | #define TA_DEFAULT_ERL 0 | 59 | #define TA_DEFAULT_ERL 0 |
60 | #define TA_CACHE_CORE_NPS 0 | 60 | #define TA_CACHE_CORE_NPS 0 |
61 | 61 | /* T10 protection information disabled by default */ | |
62 | #define TA_DEFAULT_T10_PI 0 | ||
62 | 63 | ||
63 | #define ISCSI_IOV_DATA_BUFFER 5 | 64 | #define ISCSI_IOV_DATA_BUFFER 5 |
64 | 65 | ||
@@ -765,6 +766,7 @@ struct iscsi_tpg_attrib { | |||
765 | u32 prod_mode_write_protect; | 766 | u32 prod_mode_write_protect; |
766 | u32 demo_mode_discovery; | 767 | u32 demo_mode_discovery; |
767 | u32 default_erl; | 768 | u32 default_erl; |
769 | u8 t10_pi; | ||
768 | struct iscsi_portal_group *tpg; | 770 | struct iscsi_portal_group *tpg; |
769 | }; | 771 | }; |
770 | 772 | ||
@@ -787,6 +789,7 @@ struct iscsi_np { | |||
787 | void *np_context; | 789 | void *np_context; |
788 | struct iscsit_transport *np_transport; | 790 | struct iscsit_transport *np_transport; |
789 | struct list_head np_list; | 791 | struct list_head np_list; |
792 | struct iscsi_tpg_np *tpg_np; | ||
790 | } ____cacheline_aligned; | 793 | } ____cacheline_aligned; |
791 | 794 | ||
792 | struct iscsi_tpg_np { | 795 | struct iscsi_tpg_np { |
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 44a5471de00f..76c2b2403ed6 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c | |||
@@ -225,6 +225,7 @@ static void iscsit_set_default_tpg_attribs(struct iscsi_portal_group *tpg) | |||
225 | a->prod_mode_write_protect = TA_PROD_MODE_WRITE_PROTECT; | 225 | a->prod_mode_write_protect = TA_PROD_MODE_WRITE_PROTECT; |
226 | a->demo_mode_discovery = TA_DEMO_MODE_DISCOVERY; | 226 | a->demo_mode_discovery = TA_DEMO_MODE_DISCOVERY; |
227 | a->default_erl = TA_DEFAULT_ERL; | 227 | a->default_erl = TA_DEFAULT_ERL; |
228 | a->t10_pi = TA_DEFAULT_T10_PI; | ||
228 | } | 229 | } |
229 | 230 | ||
230 | int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_group *tpg) | 231 | int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_group *tpg) |
@@ -500,6 +501,7 @@ struct iscsi_tpg_np *iscsit_tpg_add_network_portal( | |||
500 | init_completion(&tpg_np->tpg_np_comp); | 501 | init_completion(&tpg_np->tpg_np_comp); |
501 | kref_init(&tpg_np->tpg_np_kref); | 502 | kref_init(&tpg_np->tpg_np_kref); |
502 | tpg_np->tpg_np = np; | 503 | tpg_np->tpg_np = np; |
504 | np->tpg_np = tpg_np; | ||
503 | tpg_np->tpg = tpg; | 505 | tpg_np->tpg = tpg; |
504 | 506 | ||
505 | spin_lock(&tpg->tpg_np_lock); | 507 | spin_lock(&tpg->tpg_np_lock); |