mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
iscsi: Use calloutng instead of ticks in iscsi initiator
callout *_sbt functions are used to reduce ping/timeout scheduling overhead, while allowing later improvments in the functionality. Keep similar 1000ms callouts while adding a 10 ms window, to allow some kernel scheduling improvements. Reviewed By: jhb Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34222
This commit is contained in:
parent
4379c1da56
commit
972a7d95eb
2 changed files with 12 additions and 3 deletions
|
|
@ -173,6 +173,7 @@ void
|
|||
icl_listen_free(struct icl_listen *il)
|
||||
{
|
||||
struct icl_listen_sock *ils;
|
||||
sbintime_t sbt, pr;
|
||||
|
||||
sx_xlock(&il->il_lock);
|
||||
while (!TAILQ_EMPTY(&il->il_sockets)) {
|
||||
|
|
@ -184,7 +185,9 @@ icl_listen_free(struct icl_listen *il)
|
|||
ils->ils_socket->so_error = ENOTCONN;
|
||||
SOLISTEN_UNLOCK(ils->ils_socket);
|
||||
wakeup(&ils->ils_socket->so_timeo);
|
||||
pause("icl_unlisten", 1 * hz);
|
||||
sbt = mstosbt(995);
|
||||
pr = mstosbt(10);
|
||||
pause_sbt("icl_unlisten", sbt, pr, 0);
|
||||
sx_xlock(&il->il_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -546,6 +546,7 @@ iscsi_callout(void *context)
|
|||
struct iscsi_bhs_nop_out *bhsno;
|
||||
struct iscsi_session *is;
|
||||
bool reconnect_needed = false;
|
||||
sbintime_t sbt, pr;
|
||||
|
||||
is = context;
|
||||
|
||||
|
|
@ -555,7 +556,9 @@ iscsi_callout(void *context)
|
|||
return;
|
||||
}
|
||||
|
||||
callout_schedule(&is->is_callout, 1 * hz);
|
||||
sbt = mstosbt(995);
|
||||
pr = mstosbt(10);
|
||||
callout_schedule_sbt(&is->is_callout, sbt, pr, 0);
|
||||
|
||||
if (is->is_conf.isc_enable == 0)
|
||||
goto out;
|
||||
|
|
@ -1835,6 +1838,7 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
|
|||
struct iscsi_session *is;
|
||||
const struct iscsi_session *is2;
|
||||
int error;
|
||||
sbintime_t sbt, pr;
|
||||
|
||||
iscsi_sanitize_session_conf(&isa->isa_conf);
|
||||
if (iscsi_valid_session_conf(&isa->isa_conf) == false)
|
||||
|
|
@ -1912,7 +1916,9 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
|
|||
return (error);
|
||||
}
|
||||
|
||||
callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is);
|
||||
sbt = mstosbt(995);
|
||||
pr = mstosbt(10);
|
||||
callout_reset_sbt(&is->is_callout, sbt, pr, iscsi_callout, is, 0);
|
||||
TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next);
|
||||
|
||||
ISCSI_SESSION_LOCK(is);
|
||||
|
|
|
|||
Loading…
Reference in a new issue