@@ -59,6 +59,14 @@ iscsi_itt_post_increment(struct iscsi_context *iscsi) {
|
|||||||
return old_itt;
|
return old_itt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void iscsi_dump_pdu_header(struct iscsi_context *iscsi, unsigned char *data) {
|
||||||
|
char dump[ISCSI_RAW_HEADER_SIZE*3+1]={0};
|
||||||
|
int i;
|
||||||
|
for (i=0;i<ISCSI_RAW_HEADER_SIZE;i++) {
|
||||||
|
snprintf(&dump[i*3], 4," %02x",data[i]);
|
||||||
|
}
|
||||||
|
ISCSI_LOG(iscsi, 0, "PDU header:%s",dump);
|
||||||
|
}
|
||||||
|
|
||||||
struct iscsi_pdu *
|
struct iscsi_pdu *
|
||||||
iscsi_allocate_pdu_with_itt_flags(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
iscsi_allocate_pdu_with_itt_flags(struct iscsi_context *iscsi, enum iscsi_opcode opcode,
|
||||||
@@ -291,6 +299,10 @@ int iscsi_process_reject(struct iscsi_context *iscsi,
|
|||||||
|
|
||||||
itt = scsi_get_uint32(&in->data[16]);
|
itt = scsi_get_uint32(&in->data[16]);
|
||||||
|
|
||||||
|
if (iscsi->log_level > 1) {
|
||||||
|
iscsi_dump_pdu_header(iscsi, in->data);
|
||||||
|
}
|
||||||
|
|
||||||
for (pdu = iscsi->waitpdu; pdu; pdu = pdu->next) {
|
for (pdu = iscsi->waitpdu; pdu; pdu = pdu->next) {
|
||||||
if (pdu->itt == itt) {
|
if (pdu->itt == itt) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
+3
-5
@@ -61,13 +61,11 @@ iscsi_add_to_outqueue(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* queue pdus in ascending order of itt.
|
/* queue pdus in ascending order of CmdSN.
|
||||||
* ensure that pakets with the same itt are kept in order.
|
* ensure that pakets with the same CmdSN are kept in FIFO order.
|
||||||
* queue pdus with itt = 0xffffffff (SNACK / DataACK) in order but at head of queue.
|
|
||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
if (iscsi_serial32_compare(pdu->itt, current->itt) < 0
|
if (iscsi_serial32_compare(pdu->cmdsn, current->cmdsn) < 0) {
|
||||||
|| (pdu->itt == 0xffffffff && current->itt != 0xffffffff)) {
|
|
||||||
/* insert PDU before the current */
|
/* insert PDU before the current */
|
||||||
if (last != NULL) {
|
if (last != NULL) {
|
||||||
last->next=pdu;
|
last->next=pdu;
|
||||||
|
|||||||
Reference in New Issue
Block a user