Anil Veerabhadrappa wrote:
> I had one question regarding following code snippet in 
> scsi_transport_iscsi.c::iscsi_register_transport:1597
> 
>         if (!(tt->caps & CAP_DATA_PATH_OFFLOAD))
>                 priv->t.create_work_queue = 1;
> 
> Is this still valid? while testing bnx2i changes I see libiscsi indeed
> calls scsi_queue_work(). I was going to remove conditional 'if'
> statement and continue to test bnx2i, but for a second I thought of
> implications on other existing offload drivers like qla4xxx. any
> thoughts? 
> 

opps yeah, I just did not get to cleaning everything up. bnx2i and 
qla4xxx do not need the workqueue. Here is a patch for that. It is not 
even compile tested. Basically the idea is that for offload like bnx2i 
we can just call the xmit/init cmd/mgmt ctasks from whatever context we 
are in because we do not sleep (we just setup the command and give it to 
the hw more or less). For software we need to queue up the execution 
because we need to sleep (it is also a workaround to the stack problem 
for software iscsi + xfs + dm + md + network layer).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index dee902b..6354153 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -79,10 +79,12 @@ iscsi_update_cmdsn(struct iscsi_session *session, struct iscsi_nopin *hdr)
 		 * xmit thread
 		 */
 		if (!list_empty(&session->leadconn->xmitqueue) ||
-		    !list_empty(&session->leadconn->mgmtqueue))
-			scsi_queue_work(session->host,
-					&session->leadconn->xmitwork);
-	}
+		    !list_empty(&session->leadconn->mgmtqueue)) {
+			if (!(session->tt->caps & CAP_DATA_PATH_OFFLOAD))
+				scsi_queue_work(session->host,
+						&session->leadconn->xmitwork);
+			}
+		}
 }
 EXPORT_SYMBOL_GPL(iscsi_update_cmdsn);
 
@@ -421,7 +423,8 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
 		if (session->tt->xmit_mgmt_task(conn, mtask))
 			mtask = NULL;
 
-	}
+	} else
+		scsi_queue_work(conn->session->host, &conn->xmitwork);
 
 	return mtask;
 }
@@ -437,7 +440,6 @@ int iscsi_conn_send_pdu(struct iscsi_cls_conn *cls_conn, struct iscsi_hdr *hdr,
 	if (!__iscsi_conn_send_pdu(conn, hdr, data, data_size))
 		err = -EPERM;
 	spin_unlock_bh(&session->lock);
-	scsi_queue_work(session->host, &conn->xmitwork);
 	return err;
 }
 EXPORT_SYMBOL_GPL(iscsi_conn_send_pdu);
@@ -554,12 +556,8 @@ static void iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
 		hdr.ttt = RESERVED_ITT;
 
 	mtask = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)&hdr, NULL, 0);
-	if (!mtask) {
+	if (!mtask)
 		iscsi_conn_printk(KERN_ERR, conn, "Could not send nopout\n");
-		return;
-	}
-
-	scsi_queue_work(conn->session->host, &conn->xmitwork);
 }
 
 static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
@@ -1291,7 +1289,6 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
 
 	spin_unlock_bh(&session->lock);
 	mutex_unlock(&session->eh_mutex);
-	scsi_queue_work(session->host, &conn->xmitwork);
 
 	/*
 	 * block eh thread until:
@@ -1366,7 +1363,8 @@ EXPORT_SYMBOL_GPL(iscsi_suspend_tx);
 static void iscsi_start_tx(struct iscsi_conn *conn)
 {
 	clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
-	scsi_queue_work(conn->session->host, &conn->xmitwork);
+	if (!(session->tt->caps & CAP_DATA_PATH_OFFLOAD))
+		scsi_queue_work(conn->session->host, &conn->xmitwork);
 }
 
 static enum scsi_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *scmd)

Reply via email to