bw_step_rx_cur = 0
bw_step_rx_next = 0
set_bw(IFACE_RX, STEPS_RX[bw_step_rx_next])
- adjust_old = ts
return
}
}
}
# print "set adjust_old=" ts
- 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 (prefer_high_bw == 0) { # no preference for high bw caps configured
if (rx_rate < (0.9 * STEPS_RX[bw_step_rx_cur])) { # line not loaded close to current cap, so skip increasing bw
- adjust_old = ts
not_increasing_count[peername]++
print "=== " ts " NOOP skiping increase; rx rate too far from current cap of " STEPS_RX[bw_step_rx_cur] "Kbps rx=" rx_rate " tx=" tx_rate
return
}
}
if (not_increasing_count[peername] > (decision_pingslots_factor * PINGSLOTS)) {
+ not_increasing_count[peername] = 0
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
} else {
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
}
not_increasing_count[peername]++
} else {
# Shell out to `tc` to update cake bandwidth settings
function set_bw(dev, kbit) {
+ adjust_old = ts
system("set -x; tc qdisc change root dev " dev " cake bandwidth " kbit "Kbit")
}