not_increasing_count[pn] = 0 # number of consecutive cycles with no (fudged) latency increase
}
ts = get_time()
- bw_next_step_rx = 1
+ bw_step_rx_next = 1
slice_bw_window_rx(BW_MIN_RX, BW_MAX_RX)
consec_timeouts = 0
adjust_ts_delta = 0
}
k--
bw_maxindex_rx = k
- bw_next_step_rx = k
- bw_cur_step_rx = k
- set_bw(IFACE_RX, STEPS_RX[bw_next_step_rx])
+ bw_step_rx_next = k
+ bw_step_rx_cur = k
+ set_bw(IFACE_RX, STEPS_RX[bw_step_rx_next])
}
if (consec_timeouts > ((1.5 * peer_count) + 2)) {
print "# " ts " --- TIMEOUT-caused bw collapse triggered"
# print "# " ts " too many TIMEOUTS in a row, decreasing SQM bw"
- bw_cur_step_rx = 0
- bw_next_step_rx = 0
- set_bw(IFACE_RX, STEPS_RX[bw_next_step_rx])
+ bw_step_rx_cur = 0
+ bw_step_rx_next = 0
+ set_bw(IFACE_RX, STEPS_RX[bw_step_rx_next])
adjust_old = ts
return
}
if (rx_rate < (rx_rate_max * 0.1)) { # XXX TODO is this correct?
print "# " ts " line does not appear to be loaded, skipping futile SQM bw downgrade"
} else {
- if (bw_cur_step_rx > 0) {
- bw_next_step_rx = bw_cur_step_rx - 1
- print "--- " ts " choosing bw rx step " bw_next_step_rx " := " STEPS_RX[bw_next_step_rx] "Kbps rx=" rx_rate " tx=" tx_rate
- set_bw(IFACE_RX, STEPS_RX[bw_next_step_rx])
- bw_cur_step_rx = bw_next_step_rx
+ if (bw_step_rx_cur > 0) {
+ bw_step_rx_next = bw_step_rx_cur - 1
+ print "--- " ts " choosing bw rx step " bw_step_rx_next " := " STEPS_RX[bw_step_rx_next] "Kbps rx=" rx_rate " tx=" tx_rate
+ set_bw(IFACE_RX, STEPS_RX[bw_step_rx_next])
+ bw_step_rx_cur = bw_step_rx_next
} else {
- print "--- " ts " already at lowest bw rx step " bw_cur_step_rx " rx=" rx_rate " tx=" tx_rate
+ print "--- " ts " already at lowest bw rx step " bw_step_rx_cur " rx=" rx_rate " tx=" tx_rate
}
}
# print "set adjust_old=" ts
not_increasing_count[peername] = 0
} else if (latency < (ping_prev[peername] + FUDGE / 2) && latency < (ping_pprev[peername] + FUDGE / 2) && ping_prev[peername] < (ping_pprev[peername] + FUDGE/2)) {
if (not_increasing_count[peername] > (decision_pingslots_factor * PINGSLOTS)) {
- if (bw_cur_step_rx < bw_maxindex_rx) {
- bw_next_step_rx = bw_cur_step_rx + 1
- print "+++ " ts " choosing bw rx step " bw_next_step_rx " := " STEPS_RX[bw_next_step_rx] "Kbps rx=" rx_rate " tx=" tx_rate
- set_bw(IFACE_RX, STEPS_RX[bw_next_step_rx])
- bw_cur_step_rx = bw_next_step_rx
+ if (bw_step_rx_cur < bw_maxindex_rx) {
+ bw_step_rx_next = bw_step_rx_cur + 1
+ print "+++ " ts " choosing bw rx step " bw_step_rx_next " := " STEPS_RX[bw_step_rx_next] "Kbps rx=" rx_rate " tx=" tx_rate
+ set_bw(IFACE_RX, STEPS_RX[bw_step_rx_next])
+ bw_step_rx_cur = bw_step_rx_next
} else {
- print "+++ " ts " already at highest bw rx step " bw_cur_step_rx " rx=" rx_rate " tx=" tx_rate
+ print "+++ " ts " already at highest bw rx step " bw_step_rx_cur " rx=" rx_rate " tx=" tx_rate
}
not_increasing_count[peername] = 0
adjust_old = ts