SOCKET order packets in outqueue by CmdSN

Ordering by itt adds the special case of handling
itt == 0xffffffff. Order by CmdSN instead as described
by RFC3720.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-12-16 12:36:34 +01:00
parent 2f9fda19d2
commit 4cbbc0e1e9

View File

@@ -61,11 +61,11 @@ iscsi_add_to_outqueue(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
return;
}
/* queue pdus in ascending order of itt.
* ensure that pakets with the same itt are kept in order.
/* queue pdus in ascending order of CmdSN.
* ensure that pakets with the same CmdSN are kept in FIFO order.
*/
do {
if (iscsi_serial32_compare(pdu->itt, current->itt) < 0) {
if (iscsi_serial32_compare(pdu->cmdsn, current->cmdsn) < 0) {
/* insert PDU before the current */
if (last != NULL) {
last->next=pdu;