diff options
author | mav <mav@FreeBSD.org> | 2014-10-20 07:35:46 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-10-20 07:35:46 +0000 |
commit | 5889805f1c8d073e48e28ed50a629090c354309f (patch) | |
tree | 5edef3f84b3f25e6f67bac50c236cd528644cf13 /sys/dev/iscsi/icl.c | |
parent | cc6cca3f1e5c3cec97d68e6b2d95d678f1bc0eb2 (diff) | |
download | FreeBSD-src-5889805f1c8d073e48e28ed50a629090c354309f.zip FreeBSD-src-5889805f1c8d073e48e28ed50a629090c354309f.tar.gz |
MFC r272812: Make iSCSI connection close somewhat less aggressive.
It allows to push out some final data from the send queue to the socket
before its close. In particular, it increases chances for logout response
to be delivered to the initiator.
Diffstat (limited to 'sys/dev/iscsi/icl.c')
-rw-r--r-- | sys/dev/iscsi/icl.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c index ede3938..476f5dc 100644 --- a/sys/dev/iscsi/icl.c +++ b/sys/dev/iscsi/icl.c @@ -877,8 +877,6 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) SOCKBUF_UNLOCK(&so->so_snd); while (!STAILQ_EMPTY(queue)) { - if (ic->ic_disconnecting) - return; request = STAILQ_FIRST(queue); size = icl_pdu_size(request); if (available < size) { @@ -975,11 +973,6 @@ icl_send_thread(void *arg) ic->ic_send_running = true; for (;;) { - if (ic->ic_disconnecting) { - //ICL_DEBUG("terminating"); - break; - } - for (;;) { /* * If the local queue is empty, populate it from @@ -1018,6 +1011,11 @@ icl_send_thread(void *arg) break; } + if (ic->ic_disconnecting) { + //ICL_DEBUG("terminating"); + break; + } + cv_wait(&ic->ic_send_cv, ic->ic_lock); } @@ -1301,21 +1299,6 @@ icl_conn_handoff(struct icl_conn *ic, int fd) } void -icl_conn_shutdown(struct icl_conn *ic) -{ - ICL_CONN_LOCK_ASSERT_NOT(ic); - - ICL_CONN_LOCK(ic); - if (ic->ic_socket == NULL) { - ICL_CONN_UNLOCK(ic); - return; - } - ICL_CONN_UNLOCK(ic); - - soshutdown(ic->ic_socket, SHUT_RDWR); -} - -void icl_conn_close(struct icl_conn *ic) { struct icl_pdu *pdu; |