Commit 962b4b52 authored by Or Gerlitz's avatar Or Gerlitz Committed by Roland Dreier

IB/iser: Use libiscsi passthrough mode

libiscsi passthrough mode invokes the transport xmit calls directly
without first going through an internal queue, unlike the other mode,
which uses a queue and a xmitworker thread.  Now that the "cant_sleep"
prerequisite of iscsi_host_alloc is met, move to use it.  Handling
xmit errors is now done by the passthrough flow of libiscsi.  Since
the queue/worker aren't used in this mode, the code that schedules the
xmitworker is removed.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent aae3c995
...@@ -190,7 +190,7 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task) ...@@ -190,7 +190,7 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
{ {
int error = 0; int error = 0;
iser_dbg("task deq [cid %d itt 0x%x]\n", conn->id, task->itt); iser_dbg("mtask xmit [cid %d itt 0x%x]\n", conn->id, task->itt);
error = iser_send_control(conn, task); error = iser_send_control(conn, task);
...@@ -200,9 +200,6 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task) ...@@ -200,9 +200,6 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task)
* - if yes, the task is recycled at iscsi_complete_pdu * - if yes, the task is recycled at iscsi_complete_pdu
* - if no, the task is recycled at iser_snd_completion * - if no, the task is recycled at iser_snd_completion
*/ */
if (error && error != -ENOBUFS)
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
return error; return error;
} }
...@@ -254,7 +251,7 @@ iscsi_iser_task_xmit(struct iscsi_task *task) ...@@ -254,7 +251,7 @@ iscsi_iser_task_xmit(struct iscsi_task *task)
task->imm_count, task->unsol_r2t.data_length); task->imm_count, task->unsol_r2t.data_length);
} }
iser_dbg("task deq [cid %d itt 0x%x]\n", iser_dbg("ctask xmit [cid %d itt 0x%x]\n",
conn->id, task->itt); conn->id, task->itt);
/* Send the cmd PDU */ /* Send the cmd PDU */
...@@ -270,8 +267,6 @@ iscsi_iser_task_xmit(struct iscsi_task *task) ...@@ -270,8 +267,6 @@ iscsi_iser_task_xmit(struct iscsi_task *task)
error = iscsi_iser_task_xmit_unsol_data(conn, task); error = iscsi_iser_task_xmit_unsol_data(conn, task);
iscsi_iser_task_xmit_exit: iscsi_iser_task_xmit_exit:
if (error && error != -ENOBUFS)
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
return error; return error;
} }
...@@ -423,7 +418,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, ...@@ -423,7 +418,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
struct Scsi_Host *shost; struct Scsi_Host *shost;
struct iser_conn *ib_conn; struct iser_conn *ib_conn;
shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 1); shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0);
if (!shost) if (!shost)
return NULL; return NULL;
shost->transportt = iscsi_iser_scsi_transport; shost->transportt = iscsi_iser_scsi_transport;
......
...@@ -514,10 +514,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc, ...@@ -514,10 +514,7 @@ void iser_rcv_completion(struct iser_rx_desc *rx_desc,
void iser_snd_completion(struct iser_tx_desc *tx_desc, void iser_snd_completion(struct iser_tx_desc *tx_desc,
struct iser_conn *ib_conn) struct iser_conn *ib_conn)
{ {
struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn;
struct iscsi_conn *conn = iser_conn->iscsi_conn;
struct iscsi_task *task; struct iscsi_task *task;
int resume_tx = 0;
struct iser_device *device = ib_conn->device; struct iser_device *device = ib_conn->device;
if (tx_desc->type == ISCSI_TX_DATAOUT) { if (tx_desc->type == ISCSI_TX_DATAOUT) {
...@@ -526,17 +523,8 @@ void iser_snd_completion(struct iser_tx_desc *tx_desc, ...@@ -526,17 +523,8 @@ void iser_snd_completion(struct iser_tx_desc *tx_desc,
kmem_cache_free(ig.desc_cache, tx_desc); kmem_cache_free(ig.desc_cache, tx_desc);
} }
if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
ISER_QP_MAX_REQ_DTOS)
resume_tx = 1;
atomic_dec(&ib_conn->post_send_buf_count); atomic_dec(&ib_conn->post_send_buf_count);
if (resume_tx) {
iser_dbg("%ld resuming tx\n",jiffies);
iscsi_conn_queue_work(conn);
}
if (tx_desc->type == ISCSI_TX_CONTROL) { if (tx_desc->type == ISCSI_TX_CONTROL) {
/* this arithmetic is legal by libiscsi dd_data allocation */ /* this arithmetic is legal by libiscsi dd_data allocation */
task = (void *) ((long)(void *)tx_desc - task = (void *) ((long)(void *)tx_desc -
......
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