/* Called once per round-trip to update PLB state for a connection. */ void tcp_plb_update_state(conststruct sock *sk, struct tcp_plb_state *plb, constint cong_ratio)
{ struct net *net = sock_net(sk);
if (!READ_ONCE(net->ipv4.sysctl_tcp_plb_enabled)) return;
if (cong_ratio >= 0) { if (cong_ratio < READ_ONCE(net->ipv4.sysctl_tcp_plb_cong_thresh))
plb->consec_cong_rounds = 0; elseif (plb->consec_cong_rounds <
READ_ONCE(net->ipv4.sysctl_tcp_plb_rehash_rounds))
plb->consec_cong_rounds++;
}
}
EXPORT_SYMBOL_GPL(tcp_plb_update_state);
/* Check whether recent congestion has been persistent enough to warrant *aloadbalancingdecisionthatswitchestheconnectiontoanotherpath.
*/ void tcp_plb_check_rehash(struct sock *sk, struct tcp_plb_state *plb)
{ struct net *net = sock_net(sk);
u32 max_suspend; bool forced_rehash = false, idle_rehash = false;
if (!READ_ONCE(net->ipv4.sysctl_tcp_plb_enabled)) return;
forced_rehash = plb->consec_cong_rounds >=
READ_ONCE(net->ipv4.sysctl_tcp_plb_rehash_rounds); /* If sender goes idle then we check whether to rehash. */
idle_rehash = READ_ONCE(net->ipv4.sysctl_tcp_plb_idle_rehash_rounds) &&
!tcp_sk(sk)->packets_out &&
plb->consec_cong_rounds >=
READ_ONCE(net->ipv4.sysctl_tcp_plb_idle_rehash_rounds);
if (!forced_rehash && !idle_rehash) return;
/* Note that tcp_jiffies32 can wrap; we detect wraps by checking for *caseswherethemaxsuspensionendisbeforetheactualsuspension *end.Weclearpause_untilto0toindicatethereisnorecent *RTOeventthatconstrainsPLBrehashing.
*/
max_suspend = 2 * READ_ONCE(net->ipv4.sysctl_tcp_plb_suspend_rto_sec) * HZ; if (plb->pause_until &&
(!before(tcp_jiffies32, plb->pause_until) ||
before(tcp_jiffies32 + max_suspend, plb->pause_until)))
plb->pause_until = 0;
/* Reset PLB state upon RTO, since an RTO causes a sk_rethink_txhash() call *thatmayswitchthisconnectiontoapathwithcompletelydifferent *congestioncharacteristics.
*/
plb->consec_cong_rounds = 0;
}
EXPORT_SYMBOL_GPL(tcp_plb_update_state_upon_rto);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.