Skip to content

Commit b6a66e5

Browse files
matttbePaolo Abeni
authored andcommitted
mptcp: sched: check both directions for backup
The 'mptcp_subflow_context' structure has two items related to the backup flags: - 'backup': the subflow has been marked as backup by the other peer - 'request_bkup': the backup flag has been set by the host Before this patch, the scheduler was only looking at the 'backup' flag. That can make sense in some cases, but it looks like that's not what we wanted for the general use, because either the path-manager was setting both of them when sending an MP_PRIO, or the receiver was duplicating the 'backup' flag in the subflow request. Note that the use of these two flags in the path-manager are going to be fixed in the next commits, but this change here is needed not to modify the behaviour. Fixes: f296234 ("mptcp: Add handling of incoming MP_JOIN requests") Cc: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 039564d commit b6a66e5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

include/trace/events/mptcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TRACE_EVENT(mptcp_subflow_get_send,
3434
struct sock *ssk;
3535

3636
__entry->active = mptcp_subflow_active(subflow);
37-
__entry->backup = subflow->backup;
37+
__entry->backup = subflow->backup || subflow->request_bkup;
3838

3939
if (subflow->tcp_sock && sk_fullsock(subflow->tcp_sock))
4040
__entry->free = sk_stream_memory_free(subflow->tcp_sock);

net/mptcp/protocol.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,13 +1422,15 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
14221422
}
14231423

14241424
mptcp_for_each_subflow(msk, subflow) {
1425+
bool backup = subflow->backup || subflow->request_bkup;
1426+
14251427
trace_mptcp_subflow_get_send(subflow);
14261428
ssk = mptcp_subflow_tcp_sock(subflow);
14271429
if (!mptcp_subflow_active(subflow))
14281430
continue;
14291431

14301432
tout = max(tout, mptcp_timeout_from_subflow(subflow));
1431-
nr_active += !subflow->backup;
1433+
nr_active += !backup;
14321434
pace = subflow->avg_pacing_rate;
14331435
if (unlikely(!pace)) {
14341436
/* init pacing rate from socket */
@@ -1439,9 +1441,9 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
14391441
}
14401442

14411443
linger_time = div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32, pace);
1442-
if (linger_time < send_info[subflow->backup].linger_time) {
1443-
send_info[subflow->backup].ssk = ssk;
1444-
send_info[subflow->backup].linger_time = linger_time;
1444+
if (linger_time < send_info[backup].linger_time) {
1445+
send_info[backup].ssk = ssk;
1446+
send_info[backup].linger_time = linger_time;
14451447
}
14461448
}
14471449
__mptcp_set_timeout(sk, tout);

0 commit comments

Comments
 (0)