Skip to content

Commit

Permalink
Squash to "selftests/bpf: Add bpf_burst scheduler & test"
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
matttbe authored and intel-lab-lkp committed Jul 11, 2024
1 parent 1b289d9 commit 28de5f3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 28de5f3

Please sign in to comment.