iscsi-target: add void (*iscsit_get_r2t_ttt)()
authorVarun Prakash <varun@chelsio.com>
Tue, 19 Apr 2016 18:30:13 +0000 (00:00 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 10 May 2016 06:12:08 +0000 (23:12 -0700)
Add void (*iscsit_get_r2t_ttt)() to
struct iscsit_transport, iscsi-target
uses this callback to get
r2t->targ_xfer_tag.

cxgbit.ko needs this callback
for Direct Data Placement of Data Out
pdus, adapter uses ttt in Data Out pdus
for placing data directly in to the host
buffers.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c
include/target/iscsi/iscsi_transport.h

index a827b7afe42cc137c836e70363daa9544f2a7a8f..a28eb87d6efc4aff6e204e0641bfec3325132328 100644 (file)
@@ -3039,7 +3039,10 @@ static int iscsit_send_r2t(
        int_to_scsilun(cmd->se_cmd.orig_fe_lun,
                        (struct scsi_lun *)&hdr->lun);
        hdr->itt                = cmd->init_task_tag;
-       r2t->targ_xfer_tag      = session_get_next_ttt(conn->sess);
+       if (conn->conn_transport->iscsit_get_r2t_ttt)
+               conn->conn_transport->iscsit_get_r2t_ttt(conn, cmd, r2t);
+       else
+               r2t->targ_xfer_tag = session_get_next_ttt(conn->sess);
        hdr->ttt                = cpu_to_be32(r2t->targ_xfer_tag);
        hdr->statsn             = cpu_to_be32(conn->stat_sn);
        hdr->exp_cmdsn          = cpu_to_be32(conn->sess->exp_cmd_sn);
index 46aa219be1ae9b078103299aa8e6209e1f9a7b10..32704b214be5126deb667194cc6c28e8834108c4 100644 (file)
@@ -27,6 +27,8 @@ struct iscsit_transport {
        void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
        void (*iscsit_get_rx_pdu)(struct iscsi_conn *);
        int (*iscsit_validate_params)(struct iscsi_conn *);
+       void (*iscsit_get_r2t_ttt)(struct iscsi_conn *, struct iscsi_cmd *,
+                                  struct iscsi_r2t *);
        enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
 };