Commit 187e84f7 authored by Varun Prakash's avatar Varun Prakash Committed by Nicholas Bellinger

iscsi-target: add void (*iscsit_get_rx_pdu)()

Add void (*iscsit_get_rx_pdu)() to
struct iscsit_transport, iscsi-target
uses this callback to receive and
process Rx iSCSI PDUs.

cxgbit.ko needs this callback to
reuse iscsi-target Rx thread.
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Acked-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 7ec811a8
...@@ -3273,6 +3273,15 @@ static void isert_free_conn(struct iscsi_conn *conn) ...@@ -3273,6 +3273,15 @@ static void isert_free_conn(struct iscsi_conn *conn)
isert_put_conn(isert_conn); isert_put_conn(isert_conn);
} }
static void isert_get_rx_pdu(struct iscsi_conn *conn)
{
struct completion comp;
init_completion(&comp);
wait_for_completion_interruptible(&comp);
}
static struct iscsit_transport iser_target_transport = { static struct iscsit_transport iser_target_transport = {
.name = "IB/iSER", .name = "IB/iSER",
.transport_type = ISCSI_INFINIBAND, .transport_type = ISCSI_INFINIBAND,
...@@ -3291,6 +3300,7 @@ static struct iscsit_transport iser_target_transport = { ...@@ -3291,6 +3300,7 @@ static struct iscsit_transport iser_target_transport = {
.iscsit_queue_data_in = isert_put_datain, .iscsit_queue_data_in = isert_put_datain,
.iscsit_queue_status = isert_put_response, .iscsit_queue_status = isert_put_response,
.iscsit_aborted_task = isert_aborted_task, .iscsit_aborted_task = isert_aborted_task,
.iscsit_get_rx_pdu = isert_get_rx_pdu,
.iscsit_get_sup_prot_ops = isert_get_sup_prot_ops, .iscsit_get_sup_prot_ops = isert_get_sup_prot_ops,
}; };
......
...@@ -3951,14 +3951,8 @@ int iscsi_target_rx_thread(void *arg) ...@@ -3951,14 +3951,8 @@ int iscsi_target_rx_thread(void *arg)
if (rc < 0 || iscsi_target_check_conn_state(conn)) if (rc < 0 || iscsi_target_check_conn_state(conn))
return 0; return 0;
if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) { if (conn->conn_transport->iscsit_get_rx_pdu) {
struct completion comp; conn->conn_transport->iscsit_get_rx_pdu(conn);
init_completion(&comp);
rc = wait_for_completion_interruptible(&comp);
if (rc < 0)
goto transport_err;
goto transport_err; goto transport_err;
} }
......
...@@ -25,6 +25,7 @@ struct iscsit_transport { ...@@ -25,6 +25,7 @@ struct iscsit_transport {
int (*iscsit_xmit_pdu)(struct iscsi_conn *, struct iscsi_cmd *, int (*iscsit_xmit_pdu)(struct iscsi_conn *, struct iscsi_cmd *,
struct iscsi_datain_req *, const void *, u32); struct iscsi_datain_req *, const void *, u32);
void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *); void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
void (*iscsit_get_rx_pdu)(struct iscsi_conn *);
enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *); enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
}; };
......
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