From 98bbeab6646038fdabb8aea614b32b66ac5901b1 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Tue, 17 Jun 2014 14:50:41 +0200 Subject: [PATCH] pdu: introduce ISCSI_PDU_URGENT_DELIVERY Signed-off-by: Peter Lieven --- include/iscsi-private.h | 5 +++++ lib/socket.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index d03a4ba..658dc98 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -212,6 +212,11 @@ struct iscsi_pdu { #define ISCSI_PDU_DROP_ON_RECONNECT 0x00000004 /* stop sending after this PDU has been sent */ #define ISCSI_PDU_CORK_WHEN_SENT 0x00000008 +/* put this immediate delivery PDU in front of outqueue. + * This is currently only used for immediate logout requests + * as answer to an async logout event. */ +#define ISCSI_PDU_URGENT_DELIVERY 0x00000010 + uint32_t flags; diff --git a/lib/socket.c b/lib/socket.c index b161447..2a79538 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -94,7 +94,8 @@ iscsi_add_to_outqueue(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) * ensure that pakets with the same CmdSN are kept in FIFO order. */ do { - if (iscsi_serial32_compare(pdu->cmdsn, current->cmdsn) < 0) { + if (iscsi_serial32_compare(pdu->cmdsn, current->cmdsn) < 0 || + pdu->flags & ISCSI_PDU_URGENT_DELIVERY) { /* insert PDU before the current */ if (last != NULL) { last->next=pdu;