Commit 6982826 1 parent 65b0226 commit 6982826 Copy full SHA for 6982826
File tree 5 files changed +27
-0
lines changed
5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,8 @@ static inline __be32 mptcp_reset_option(const struct sk_buff *skb)
223
223
224
224
return htonl (0u );
225
225
}
226
+
227
+ void mptcp_active_detect_blackhole (struct sock * sk , bool expired );
226
228
#else
227
229
228
230
static inline void mptcp_init (void )
@@ -307,6 +309,8 @@ static inline struct request_sock *mptcp_subflow_reqsk_alloc(const struct reques
307
309
}
308
310
309
311
static inline __be32 mptcp_reset_option (const struct sk_buff * skb ) { return htonl (0u ); }
312
+
313
+ static inline void mptcp_active_detect_blackhole (struct sock * sk , bool expired ) { }
310
314
#endif /* CONFIG_MPTCP */
311
315
312
316
#if IS_ENABLED (CONFIG_MPTCP_IPV6 )
Original file line number Diff line number Diff line change @@ -282,6 +282,7 @@ static int tcp_write_timeout(struct sock *sk)
282
282
expired = retransmits_timed_out (sk , retry_until ,
283
283
READ_ONCE (icsk -> icsk_user_timeout ));
284
284
tcp_fastopen_active_detect_blackhole (sk , expired );
285
+ mptcp_active_detect_blackhole (sk , expired );
285
286
286
287
if (BPF_SOCK_OPS_TEST_FLAG (tp , BPF_SOCK_OPS_RTO_CB_FLAG ))
287
288
tcp_call_bpf_3arg (sk , BPF_SOCK_OPS_RTO_CB ,
Original file line number Diff line number Diff line change 12
12
#include <net/netns/generic.h>
13
13
14
14
#include "protocol.h"
15
+ #include "mib.h"
15
16
16
17
#define MPTCP_SYSCTL_PATH "net/mptcp"
17
18
@@ -277,6 +278,25 @@ static void mptcp_pernet_del_table(struct mptcp_pernet *pernet) {}
277
278
278
279
#endif /* CONFIG_SYSCTL */
279
280
281
+ /* Check the number of retransmissions, and fallback to TCP if needed */
282
+ void mptcp_active_detect_blackhole (struct sock * ssk , bool expired )
283
+ {
284
+ struct mptcp_subflow_context * subflow ;
285
+ u32 timeouts ;
286
+
287
+ if (!sk_is_mptcp (ssk ))
288
+ return ;
289
+
290
+ timeouts = inet_csk (ssk )-> icsk_retransmits ;
291
+ subflow = mptcp_subflow_ctx (ssk );
292
+
293
+ if (subflow -> request_mptcp && ssk -> sk_state == TCP_SYN_SENT &&
294
+ (timeouts == 2 || (timeouts < 2 && expired ))) {
295
+ MPTCP_INC_STATS (sock_net (ssk ), MPTCP_MIB_MPCAPABLEACTIVEDROP );
296
+ mptcp_subflow_early_fallback (mptcp_sk (subflow -> conn ), subflow );
297
+ }
298
+ }
299
+
280
300
static int __net_init mptcp_net_init (struct net * net )
281
301
{
282
302
struct mptcp_pernet * pernet = mptcp_get_pernet (net );
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ static const struct snmp_mib mptcp_snmp_list[] = {
15
15
SNMP_MIB_ITEM ("MPCapableACKRX" , MPTCP_MIB_MPCAPABLEPASSIVEACK ),
16
16
SNMP_MIB_ITEM ("MPCapableFallbackACK" , MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ),
17
17
SNMP_MIB_ITEM ("MPCapableFallbackSYNACK" , MPTCP_MIB_MPCAPABLEACTIVEFALLBACK ),
18
+ SNMP_MIB_ITEM ("MPCapableSYNTXDrop" , MPTCP_MIB_MPCAPABLEACTIVEDROP ),
18
19
SNMP_MIB_ITEM ("MPFallbackTokenInit" , MPTCP_MIB_TOKENFALLBACKINIT ),
19
20
SNMP_MIB_ITEM ("MPTCPRetrans" , MPTCP_MIB_RETRANSSEGS ),
20
21
SNMP_MIB_ITEM ("MPJoinNoTokenFound" , MPTCP_MIB_JOINNOTOKEN ),
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ enum linux_mptcp_mib_field {
10
10
MPTCP_MIB_MPCAPABLEPASSIVEACK , /* Received third ACK with MP_CAPABLE */
11
11
MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ,/* Server-side fallback during 3-way handshake */
12
12
MPTCP_MIB_MPCAPABLEACTIVEFALLBACK , /* Client-side fallback during 3-way handshake */
13
+ MPTCP_MIB_MPCAPABLEACTIVEDROP , /* Client-side fallback due to a MPC drop */
13
14
MPTCP_MIB_TOKENFALLBACKINIT , /* Could not init/allocate token */
14
15
MPTCP_MIB_RETRANSSEGS , /* Segments retransmitted at the MPTCP-level */
15
16
MPTCP_MIB_JOINNOTOKEN , /* Received MP_JOIN but the token was not found */
You can’t perform that action at this time.
0 commit comments