提交 184b57c6 编写于 作者: M Mike Christie 提交者: James Bottomley

[SCSI] libiscsi: check of LLD has a alloc pdu callout.

bnx2i does not have one. It currently preallocates the bdt
when the session is setup.

We probably want to change that to a dma pool, then allocate from
the pool in the alloc pdu. Until then check if there is a alloc
pdu callout.
Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 10eb0f01
...@@ -257,9 +257,11 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task) ...@@ -257,9 +257,11 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
itt_t itt; itt_t itt;
int rc; int rc;
rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD); if (conn->session->tt->alloc_pdu) {
if (rc) rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD);
return rc; if (rc)
return rc;
}
hdr = (struct iscsi_cmd *) task->hdr; hdr = (struct iscsi_cmd *) task->hdr;
itt = hdr->itt; itt = hdr->itt;
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
...@@ -566,11 +568,14 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, ...@@ -566,11 +568,14 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
} else } else
task->data_count = 0; task->data_count = 0;
if (conn->session->tt->alloc_pdu(task, hdr->opcode)) { if (conn->session->tt->alloc_pdu) {
iscsi_conn_printk(KERN_ERR, conn, "Could not allocate " if (conn->session->tt->alloc_pdu(task, hdr->opcode)) {
"pdu for mgmt task.\n"); iscsi_conn_printk(KERN_ERR, conn, "Could not allocate "
goto requeue_task; "pdu for mgmt task.\n");
goto requeue_task;
}
} }
itt = task->hdr->itt; itt = task->hdr->itt;
task->hdr_len = sizeof(struct iscsi_hdr); task->hdr_len = sizeof(struct iscsi_hdr);
memcpy(task->hdr, hdr, sizeof(struct iscsi_hdr)); memcpy(task->hdr, hdr, sizeof(struct iscsi_hdr));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册