aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-04-02 15:52:38 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-04-07 04:48:54 -0400
commite70beee783d6977d80eede88a3394f02eabddad1 (patch)
tree225d10e36bf031e9c4eab3de537699b60bb48f1b /drivers/infiniband
parentd84287bcfe624697cd4f3c1df746beb53b86d9c4 (diff)
target: Pass in transport supported PI at session initialization
In order to support local WRITE_INSERT + READ_STRIP operations for non PI enabled fabrics, the fabric driver needs to be able signal what protection offload operations are supported. This is done at session initialization time so the modes can be signaled by individual se_wwn + se_portal_group endpoints, as well as optionally across different transports on the same endpoint. For iser-target, set TARGET_PROT_ALL if the underlying ib_device has already signaled PI offload support, and allow this to be exposed via a new iscsit_transport->iscsit_get_sup_prot_ops() callback. For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode operation. For all other drivers, set TARGET_PROT_NORMAL to disable fabric level PI. Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Sagi Grimberg <sagig@mellanox.com> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: Quinn Tran <quinn.tran@qlogic.com> Cc: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c13
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index f5cc4affaeb4..c98fdb185931 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2196,6 +2196,18 @@ isert_aborted_task(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
2196 device->unreg_rdma_mem(isert_cmd, isert_conn); 2196 device->unreg_rdma_mem(isert_cmd, isert_conn);
2197} 2197}
2198 2198
2199static enum target_prot_op
2200isert_get_sup_prot_ops(struct iscsi_conn *conn)
2201{
2202 struct isert_conn *isert_conn = (struct isert_conn *)conn->context;
2203 struct isert_device *device = isert_conn->conn_device;
2204
2205 if (device->pi_capable)
2206 return TARGET_PROT_ALL;
2207
2208 return TARGET_PROT_NORMAL;
2209}
2210
2199static int 2211static int
2200isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn, 2212isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn,
2201 bool nopout_response) 2213 bool nopout_response)
@@ -3252,6 +3264,7 @@ static struct iscsit_transport iser_target_transport = {
3252 .iscsit_queue_data_in = isert_put_datain, 3264 .iscsit_queue_data_in = isert_put_datain,
3253 .iscsit_queue_status = isert_put_response, 3265 .iscsit_queue_status = isert_put_response,
3254 .iscsit_aborted_task = isert_aborted_task, 3266 .iscsit_aborted_task = isert_aborted_task,
3267 .iscsit_get_sup_prot_ops = isert_get_sup_prot_ops,
3255}; 3268};
3256 3269
3257static int __init isert_init(void) 3270static int __init isert_init(void)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index f03aafdc3572..bcfb398a6639 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2580,7 +2580,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
2580 goto destroy_ib; 2580 goto destroy_ib;
2581 } 2581 }
2582 2582
2583 ch->sess = transport_init_session(); 2583 ch->sess = transport_init_session(TARGET_PROT_NORMAL);
2584 if (IS_ERR(ch->sess)) { 2584 if (IS_ERR(ch->sess)) {
2585 rej->reason = __constant_cpu_to_be32( 2585 rej->reason = __constant_cpu_to_be32(
2586 SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); 2586 SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);