optimize iser scsi command response processing flow to avoid taking extra reference on the iscsi task and to use libiscsi lockless completion path. This way there's no contention on the session lock between the scsi command submission to the scsi command completion flows.
Signed-off-by: Or Gerlitz <ogerl...@voltaire.com> ----- Mike, I'd like to get feedback on this approach/patch, basically I'd to avoid taking the session lock on the command response flow: - the kfifo_put call is safe since there's one consumer (xmit flow under lock for passthrough, and xmit worker for non passthrough) and one producer (response flow has single tasklet instance). - to my understanding, the _get/put task calls in iser_rcv_completion add nothing so I removed them so I think I am left with the updates to session-> max_cmdsn/exp_cmdsn in __iscsi_update_cmdsn, etc (conn->statsn). Am I correct that this is the only thing to settle here? Or. Index: linux-2.6/drivers/infiniband/ulp/iser/iser_initiator.c =================================================================== --- linux-2.6.orig/drivers/infiniband/ulp/iser/iser_initiator.c +++ linux-2.6/drivers/infiniband/ulp/iser/iser_initiator.c @@ -575,7 +575,7 @@ void iser_rcv_completion(struct iser_des struct iscsi_iser_task *iser_task; struct iscsi_hdr *hdr; char *rx_data = NULL; - int rx_data_len = 0; + int err, rx_data_len = 0; unsigned char opcode; hdr = &rx_desc->iscsi_header; @@ -591,11 +591,7 @@ void iser_rcv_completion(struct iser_des opcode = hdr->opcode & ISCSI_OPCODE_MASK; if (opcode == ISCSI_OP_SCSI_CMD_RSP) { - spin_lock(&conn->iscsi_conn->session->lock); task = iscsi_itt_to_ctask(conn->iscsi_conn, hdr->itt); - if (task) - __iscsi_get_task(task); - spin_unlock(&conn->iscsi_conn->session->lock); if (!task) iser_err("itt can't be matched to task!!! " @@ -606,12 +602,15 @@ void iser_rcv_completion(struct iser_des iser_dbg("itt %d task %p\n",hdr->itt, task); iser_task->status = ISER_TASK_STATUS_COMPLETED; iser_task_rdma_finalize(iser_task); - iscsi_put_task(task); + + err = __iscsi_complete_pdu(conn->iscsi_conn, hdr, + rx_data, rx_data_len); } - } - iser_dto_buffs_release(dto); + } else + err = iscsi_complete_pdu(conn->iscsi_conn, hdr, + rx_data, rx_data_len); - iscsi_iser_recv(conn->iscsi_conn, hdr, rx_data, rx_data_len); + iser_dto_buffs_release(dto); kfree(rx_desc->data); kmem_cache_free(ig.desc_cache, rx_desc); -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-is...@googlegroups.com. To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.