NOPs should not be requeued when reconnecting a session.
Just like DATA_OUT we should just discard NOPs instead of requeueing them on session reconnect. Add new flag that to indicate this behaviour on reconnect and set it for both data out and nops
This commit is contained in:
@@ -195,7 +195,12 @@ struct iscsi_pdu {
|
||||
/* There will not be a response to this pdu, so delete it once it is sent on the wire. Dont put it on the wait-queue */
|
||||
#define ISCSI_PDU_DELETE_WHEN_SENT 0x00000001
|
||||
/* Dont call the CANCEL callback when the context is destroyed */
|
||||
#define ISCSI_PDU_NO_CALLBACK 0x00000002
|
||||
#define ISCSI_PDU_NO_CALLBACK 0x00000002
|
||||
/* When reconnecting, just drop all these PDUs. Dont re-queue them.
|
||||
* This includes any DATA-OUT PDU as well as all NOPs.
|
||||
*/
|
||||
#define ISCSI_PDU_DROP_ON_RECONNECT 0x00000004
|
||||
|
||||
uint32_t flags;
|
||||
|
||||
uint32_t lun;
|
||||
|
||||
@@ -302,10 +302,11 @@ try_again:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pdu->flags & ISCSI_PDU_DELETE_WHEN_SENT) {
|
||||
if (pdu->flags & ISCSI_PDU_DROP_ON_RECONNECT) {
|
||||
/* We dont want to requeue things like DATA-OUT since these guys
|
||||
* will be reissued automatically anyway once the corresponding
|
||||
* write command is replayed.
|
||||
* Similarly we dont want to requeue NOPs.
|
||||
*/
|
||||
iscsi_free_pdu(old_iscsi, pdu);
|
||||
continue;
|
||||
|
||||
@@ -69,7 +69,7 @@ iscsi_send_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *cmd_pdu,
|
||||
pdu = iscsi_allocate_pdu_with_itt_flags(iscsi, ISCSI_PDU_DATA_OUT,
|
||||
ISCSI_PDU_NO_PDU,
|
||||
cmd_pdu->itt,
|
||||
ISCSI_PDU_DELETE_WHEN_SENT|ISCSI_PDU_NO_CALLBACK);
|
||||
ISCSI_PDU_DROP_ON_RECONNECT|ISCSI_PDU_DELETE_WHEN_SENT|ISCSI_PDU_NO_CALLBACK);
|
||||
if (pdu == NULL) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory, Failed to allocate "
|
||||
"scsi data out pdu.");
|
||||
|
||||
@@ -42,6 +42,9 @@ iscsi_nop_out_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* We dont want to requeue these on reconnect */
|
||||
pdu->flags |= ISCSI_PDU_DROP_ON_RECONNECT;
|
||||
|
||||
/* immediate flag */
|
||||
iscsi_pdu_set_immediate(pdu);
|
||||
|
||||
@@ -87,7 +90,7 @@ iscsi_send_target_nop_out(struct iscsi_context *iscsi, uint32_t ttt)
|
||||
struct iscsi_pdu *pdu;
|
||||
|
||||
pdu = iscsi_allocate_pdu_with_itt_flags(iscsi, ISCSI_PDU_NOP_OUT, ISCSI_PDU_NO_PDU,
|
||||
0xffffffff,ISCSI_PDU_DELETE_WHEN_SENT|ISCSI_PDU_NO_CALLBACK);
|
||||
0xffffffff,ISCSI_PDU_DROP_ON_RECONNECT|ISCSI_PDU_DELETE_WHEN_SENT|ISCSI_PDU_NO_CALLBACK);
|
||||
if (pdu == NULL) {
|
||||
iscsi_set_error(iscsi, "Failed to allocate nop-out pdu");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user