Deleted Added
full compact
iscsi.c (270891) iscsi.c (273307)
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/10/sys/dev/iscsi/iscsi.c 270891 2014-08-31 20:47:10Z trasz $");
32__FBSDID("$FreeBSD: stable/10/sys/dev/iscsi/iscsi.c 273307 2014-10-20 07:28:18Z mav $");
33
34#include <sys/param.h>
35#include <sys/condvar.h>
36#include <sys/conf.h>
37#include <sys/eventhandler.h>
38#include <sys/file.h>
39#include <sys/kernel.h>
40#include <sys/kthread.h>

--- 497 unchanged lines hidden (view full) ---

538 return;
539
540 callout_schedule(&is->is_callout, 1 * hz);
541
542 ISCSI_SESSION_LOCK(is);
543 is->is_timeout++;
544
545 if (is->is_waiting_for_iscsid) {
33
34#include <sys/param.h>
35#include <sys/condvar.h>
36#include <sys/conf.h>
37#include <sys/eventhandler.h>
38#include <sys/file.h>
39#include <sys/kernel.h>
40#include <sys/kthread.h>

--- 497 unchanged lines hidden (view full) ---

538 return;
539
540 callout_schedule(&is->is_callout, 1 * hz);
541
542 ISCSI_SESSION_LOCK(is);
543 is->is_timeout++;
544
545 if (is->is_waiting_for_iscsid) {
546 if (is->is_timeout > iscsid_timeout) {
546 if (iscsid_timeout > 0 && is->is_timeout > iscsid_timeout) {
547 ISCSI_SESSION_WARN(is, "timed out waiting for iscsid(8) "
548 "for %d seconds; reconnecting",
549 is->is_timeout);
550 reconnect_needed = true;
551 }
552 goto out;
553 }
554
555 if (is->is_login_phase) {
547 ISCSI_SESSION_WARN(is, "timed out waiting for iscsid(8) "
548 "for %d seconds; reconnecting",
549 is->is_timeout);
550 reconnect_needed = true;
551 }
552 goto out;
553 }
554
555 if (is->is_login_phase) {
556 if (is->is_timeout > login_timeout) {
556 if (login_timeout > 0 && is->is_timeout > login_timeout) {
557 ISCSI_SESSION_WARN(is, "login timed out after %d seconds; "
558 "reconnecting", is->is_timeout);
559 reconnect_needed = true;
560 }
561 goto out;
562 }
563
557 ISCSI_SESSION_WARN(is, "login timed out after %d seconds; "
558 "reconnecting", is->is_timeout);
559 reconnect_needed = true;
560 }
561 goto out;
562 }
563
564 if (ping_timeout <= 0) {
565 /*
566 * Pings are disabled. Don't send NOP-Out in this case.
567 * Reset the timeout, to avoid triggering reconnection,
568 * should the user decide to reenable them.
569 */
570 is->is_timeout = 0;
571 goto out;
572 }
573
564 if (is->is_timeout >= ping_timeout) {
565 ISCSI_SESSION_WARN(is, "no ping reply (NOP-In) after %d seconds; "
566 "reconnecting", ping_timeout);
567 reconnect_needed = true;
568 goto out;
569 }
570
571 ISCSI_SESSION_UNLOCK(is);

--- 1831 unchanged lines hidden ---
574 if (is->is_timeout >= ping_timeout) {
575 ISCSI_SESSION_WARN(is, "no ping reply (NOP-In) after %d seconds; "
576 "reconnecting", ping_timeout);
577 reconnect_needed = true;
578 goto out;
579 }
580
581 ISCSI_SESSION_UNLOCK(is);

--- 1831 unchanged lines hidden ---