Commit 5b168dcd authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Nicholas Bellinger

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: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 48f5e7b3
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
#define TA_DEMO_MODE_DISCOVERY 1 #define TA_DEMO_MODE_DISCOVERY 1
#define TA_DEFAULT_ERL 0 #define TA_DEFAULT_ERL 0
#define TA_CACHE_CORE_NPS 0 #define TA_CACHE_CORE_NPS 0
/* T10 protection information disabled by default */
#define TA_DEFAULT_T10_PI 0
#define ISCSI_IOV_DATA_BUFFER 5 #define ISCSI_IOV_DATA_BUFFER 5
...@@ -765,6 +766,7 @@ struct iscsi_tpg_attrib { ...@@ -765,6 +766,7 @@ struct iscsi_tpg_attrib {
u32 prod_mode_write_protect; u32 prod_mode_write_protect;
u32 demo_mode_discovery; u32 demo_mode_discovery;
u32 default_erl; u32 default_erl;
u8 t10_pi;
struct iscsi_portal_group *tpg; struct iscsi_portal_group *tpg;
}; };
...@@ -787,6 +789,7 @@ struct iscsi_np { ...@@ -787,6 +789,7 @@ struct iscsi_np {
void *np_context; void *np_context;
struct iscsit_transport *np_transport; struct iscsit_transport *np_transport;
struct list_head np_list; struct list_head np_list;
struct iscsi_tpg_np *tpg_np;
} ____cacheline_aligned; } ____cacheline_aligned;
struct iscsi_tpg_np { struct iscsi_tpg_np {
......
...@@ -225,6 +225,7 @@ static void iscsit_set_default_tpg_attribs(struct iscsi_portal_group *tpg) ...@@ -225,6 +225,7 @@ static void iscsit_set_default_tpg_attribs(struct iscsi_portal_group *tpg)
a->prod_mode_write_protect = TA_PROD_MODE_WRITE_PROTECT; a->prod_mode_write_protect = TA_PROD_MODE_WRITE_PROTECT;
a->demo_mode_discovery = TA_DEMO_MODE_DISCOVERY; a->demo_mode_discovery = TA_DEMO_MODE_DISCOVERY;
a->default_erl = TA_DEFAULT_ERL; a->default_erl = TA_DEFAULT_ERL;
a->t10_pi = TA_DEFAULT_T10_PI;
} }
int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_group *tpg) 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,6 +501,7 @@ struct iscsi_tpg_np *iscsit_tpg_add_network_portal(
init_completion(&tpg_np->tpg_np_comp); init_completion(&tpg_np->tpg_np_comp);
kref_init(&tpg_np->tpg_np_kref); kref_init(&tpg_np->tpg_np_kref);
tpg_np->tpg_np = np; tpg_np->tpg_np = np;
np->tpg_np = tpg_np;
tpg_np->tpg = tpg; tpg_np->tpg = tpg;
spin_lock(&tpg->tpg_np_lock); spin_lock(&tpg->tpg_np_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment