From 6a88d3af4393b495afcd8629ffc442002ccf9a69 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Thu, 18 Jul 2024 17:54:06 +0200 Subject: [PATCH] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Similar to "mptcp: sched: check both directions for backup": it didn't matter before because the two flags were very likely set by accident. But that's no longer the case now. Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c index 0026587a94df3d..3a673291b4dd68 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c @@ -85,10 +85,14 @@ static int bpf_burst_get_send(struct mptcp_sock *msk, } for (i = 0; i < data->subflows && i < MPTCP_SUBFLOWS_MAX; i++) { + bool backup; + subflow = bpf_mptcp_subflow_ctx_by_pos(data, i); if (!subflow) break; + backup = subflow->backup || subflow->request_bkup; + ssk = mptcp_subflow_tcp_sock(subflow); if (!mptcp_subflow_active(subflow)) continue; @@ -103,9 +107,9 @@ static int bpf_burst_get_send(struct mptcp_sock *msk, } linger_time = div_u64((__u64)ssk->sk_wmem_queued << 32, pace); - if (linger_time < send_info[subflow->backup].linger_time) { - send_info[subflow->backup].subflow_id = i; - send_info[subflow->backup].linger_time = linger_time; + if (linger_time < send_info[backup].linger_time) { + send_info[backup].subflow_id = i; + send_info[backup].linger_time = linger_time; } } mptcp_set_timeout(sk); @@ -160,7 +164,7 @@ static int bpf_burst_get_retrans(struct mptcp_sock *msk, continue; } - if (subflow->backup) { + if (subflow->backup || subflow->request_bkup) { if (backup == MPTCP_SUBFLOWS_MAX) backup = i; continue;