[PATCH] mptcp:init: panic in case of error
by Matthieu Baerts
The idea is to mimic what is done in tcp_init() and not ignore errors
from the init phase. It also simplifies the code as we don't have to
manage exit parts anymore.
Can be squashed in:
- "mptcp: Add MPTCP socket stubs" (mptcp_init())
- "mptcp: Associate MPTCP context with TCP socket" (subflow_init())
- "mptcp: Create SUBFLOW socket for incoming connections" (subflow_ops)
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
net/mptcp/protocol.c | 20 ++++----------------
net/mptcp/protocol.h | 3 +--
net/mptcp/subflow.c | 27 +++++----------------------
3 files changed, 10 insertions(+), 40 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 4e809719dcfd..b342cd4115da 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -992,10 +992,8 @@ static struct inet_protosw mptcp_protosw = {
.flags = INET_PROTOSW_ICSK,
};
-void mptcp_init(void)
+void __init mptcp_init(void)
{
- int err;
-
mptcp_prot.h.hashinfo = tcp_prot.h.hashinfo;
mptcp_stream_ops = inet_stream_ops;
mptcp_stream_ops.bind = mptcp_bind;
@@ -1008,22 +1006,12 @@ void mptcp_init(void)
token_init();
crypto_init();
+ subflow_init();
- err = subflow_init();
- if (err)
- goto subflow_failed;
-
- err = proto_register(&mptcp_prot, 1);
- if (err)
- goto proto_failed;
+ if (proto_register(&mptcp_prot, 1) != 0)
+ panic("Failed to register MPTCP proto.\n");
inet_register_protosw(&mptcp_protosw);
return;
-
-proto_failed:
- subflow_exit();
-
-subflow_failed:
- return;
}
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 258325e42fa4..c1a39e31f641 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -105,8 +105,7 @@ static inline struct socket *mptcp_subflow_tcp_socket(const struct subflow_conte
return subflow->tcp_sock;
}
-int subflow_init(void);
-void subflow_exit(void);
+void subflow_init(void);
extern const struct inet_connection_sock_af_ops ipv4_specific;
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 1b8ec517c687..19f36ba6841f 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -286,19 +286,11 @@ static int subflow_ops_init(struct request_sock_ops *subflow_ops)
return 0;
}
-static void subflow_ops_exit(void)
+void subflow_init(void)
{
- kmem_cache_destroy(subflow_request_sock_ops.slab);
-}
-
-int subflow_init(void)
-{
- int ret;
-
subflow_request_sock_ops = tcp_request_sock_ops;
- ret = subflow_ops_init(&subflow_request_sock_ops);
- if (ret != 0)
- return ret;
+ if (subflow_ops_init(&subflow_request_sock_ops) != 0)
+ panic("MPTCP: failed to init subflow request sock ops");
subflow_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops;
subflow_request_sock_ipv4_ops.init_req = subflow_v4_init_req;
@@ -309,15 +301,6 @@ int subflow_init(void)
subflow_specific.sk_rx_dst_set = subflow_finish_connect;
subflow_specific.rebuild_header = subflow_rebuild_header;
- ret = tcp_register_ulp(&subflow_ulp_ops);
- if (ret != 0)
- subflow_ops_exit();
-
- return ret;
-}
-
-void subflow_exit(void)
-{
- tcp_unregister_ulp(&subflow_ulp_ops);
- subflow_ops_exit();
+ if (tcp_register_ulp(&subflow_ulp_ops) != 0)
+ panic("MPTCP: failed to register subflows to ULP");
}
--
2.20.1
2 years, 11 months
KSelftests warnings: Replaced mapping before it was done
by Matthieu Baerts
Hello,
As just discussed, I have this warning when launching kselftests:
Replaced mapping before it was done
Here are the logs when KASAN and PROVE_LOCKING are used:
TAP version 13
1..1
# selftests: mptcp: mptcp_connect.sh
[ 40.042417] IPv6: ADDRCONF(NETDEV_CHANGE): ns1eth2: link becomes ready
[ 40.258626] IPv6: ADDRCONF(NETDEV_CHANGE): ns2eth3: link becomes ready
[ 40.488896] IPv6: ADDRCONF(NETDEV_CHANGE): ns3eth4: link becomes ready
# Created /tmp/tmp.GJv3xyPEgr (size 5220870) containing data sent by client
# Created /tmp/tmp.qFsIUFmpRA (size 2720072) containing data sent by server
# ns1 MPTCP -> ns1 (10.0.1.1:10000) MPTCP [ 40.852761] IPv6:
ADDRCONF(NETDEV_CHANGE): ns2eth1: link becomes ready
[ OK ]
# ns1 MPTCP -> ns1 (10.0.1.1:10001) TCP [ OK ]
# ns1 TCP -> ns1 (10.0.1.1:10002) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.1.2:10003) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.1.2:10004) TCP [ OK ]
# ns1 TCP -> ns2 (10.0.1.2:10005) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.2.1:10006) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.2.1:10007) TCP [ OK ]
# ns1 TCP -> ns2 (10.0.2.1:10008) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.2.2:10009) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.2.2:10010) TCP [ OK ]
# ns1 TCP -> ns3 (10.0.2.2:10011) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.3.2:10012) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.3.2:10013) TCP [ OK ]
# ns1 TCP -> ns3 (10.0.3.2:10014) MPTCP [ OK ]
# ns1 MPTCP -> ns4 (10.0.3.1:10015) MPTCP [ 62.510172] Replaced
mapping before it was done
[ 62.510714] Replaced mapping before it was done
[ 62.516202] Replaced mapping before it was done
[ 62.556681] Replaced mapping before it was done
[ 62.561805] Replaced mapping before it was done
[ 62.574194] Replaced mapping before it was done
[ 62.586401] Replaced mapping before it was done
[ 62.599163] Replaced mapping before it was done
[ 62.611202] Replaced mapping before it was done
[ 62.623341] Replaced mapping before it was done
[ 62.624615] Replaced mapping before it was done
[ 62.636842] Replaced mapping before it was done
[ 62.649633] Replaced mapping before it was done
[ 62.662349] Replaced mapping before it was done
[ 62.663527] Replaced mapping before it was done
[ 62.675872] Replaced mapping before it was done
[ 62.677086] Replaced mapping before it was done
[ 62.688965] Replaced mapping before it was done
[ 62.690260] Replaced mapping before it was done
[ 62.702386] Replaced mapping before it was done
[ 62.704102] Replaced mapping before it was done
[ 62.715569] Replaced mapping before it was done
[ 62.717106] Replaced mapping before it was done
[ 62.728812] Replaced mapping before it was done
[ 62.730497] Replaced mapping before it was done
[ 62.731282] Replaced mapping before it was done
[ 62.742104] Replaced mapping before it was done
[ 62.743546] Replaced mapping before it was done
[ 62.744334] Replaced mapping before it was done
[ 62.745559] Replaced mapping before it was done
[ 62.756356] Replaced mapping before it was done
[ OK ]
# ns1 MPTCP -> ns4 (10.0.3.1:10016) TCP [ OK ]
# ns1 TCP -> ns4 (10.0.3.1:10017) MPTCP [ OK ]
# ns2 MPTCP -> ns1 (10.0.1.1:10018) MPTCP [ OK ]
# ns2 MPTCP -> ns1 (10.0.1.1:10019) TCP [ OK ]
# ns2 TCP -> ns1 (10.0.1.1:10020) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.1.2:10021) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.1.2:10022) TCP [ OK ]
# ns2 TCP -> ns2 (10.0.1.2:10023) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.2.1:10024) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.2.1:10025) TCP [ OK ]
# ns2 TCP -> ns2 (10.0.2.1:10026) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.2.2:10027) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.2.2:10028) TCP [ OK ]
# ns2 TCP -> ns3 (10.0.2.2:10029) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.3.2:10030) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.3.2:10031) TCP [ OK ]
# ns2 TCP -> ns3 (10.0.3.2:10032) MPTCP [ OK ]
# ns2 MPTCP -> ns4 (10.0.3.1:10033) MPTCP [ 62.757636] Replaced
mapping before it was done
[ 95.298199] Replaced mapping before it was done
[ 95.327847] Replaced mapping before it was done
[ 95.328602] Replaced mapping before it was done
[ 95.329316] Replaced mapping before it was done
[ 95.351276] Replaced mapping before it was done
[ 95.352074] Replaced mapping before it was done
[ 95.352909] Replaced mapping before it was done
[ 95.353684] Replaced mapping before it was done
[ 95.354498] Replaced mapping before it was done
[ 95.357110] Replaced mapping before it was done
[ 95.358564] Replaced mapping before it was done
[ 95.359667] Replaced mapping before it was done
[ 95.360482] Replaced mapping before it was done
[ 95.366152] Replaced mapping before it was done
[ 95.367832] Replaced mapping before it was done
[ 95.369141] Replaced mapping before it was done
[ 95.370752] Replaced mapping before it was done
[ 95.371547] Replaced mapping before it was done
[ 95.390047] Replaced mapping before it was done
[ 95.390959] Replaced mapping before it was done
[ 95.391833] Replaced mapping before it was done
[ 95.392758] Replaced mapping before it was done
[ 95.393905] Replaced mapping before it was done
[ 95.394920] Replaced mapping before it was done
[ 95.395848] Replaced mapping before it was done
[ 95.396774] Replaced mapping before it was done
[ 95.397696] Replaced mapping before it was done
[ 95.398619] Replaced mapping before it was done
[ 95.399532] Replaced mapping before it was done
[ 95.405810] Replaced mapping before it was done
[ 95.406954] Replaced mapping before it was done
[ 95.407902] Replaced mapping before it was done
[ 95.408827] Replaced mapping before it was done
[ 95.409750] Replaced mapping before it was done
[ 95.410612] Replaced mapping before it was done
[ 95.411502] Replaced mapping before it was done
[ 95.412339] Replaced mapping before it was done
[ 95.413233] Replaced mapping before it was done
[ 95.414120] Replaced mapping before it was done
[ 95.422271] Replaced mapping before it was done
[ 95.423322] Replaced mapping before it was done
[ 95.424358] Replaced mapping before it was done
[ 95.425294] Replaced mapping before it was done
[ 95.426348] Replaced mapping before it was done
[ 95.427287] Replaced mapping before it was done
[ 95.428526] Replaced mapping before it was done
[ 95.429472] Replaced mapping before it was done
[ 95.430418] Replaced mapping before it was done
[ 95.431471] Replaced mapping before it was done
[ 95.432262] Replaced mapping before it was done
[ 95.433056] Replaced mapping before it was done
[ 95.433842] Replaced mapping before it was done
[ 95.434927] Replaced mapping before it was done
[ 95.435701] Replaced mapping before it was done
[ 95.436449] Replaced mapping before it was done
[ 95.437232] Replaced mapping before it was done
[ 95.437993] Replaced mapping before it was done
[ 95.439034] Replaced mapping before it was done
[ 95.439832] Replaced mapping before it was done
[ 95.440600] Replaced mapping before it was done
[ 95.441388] Replaced mapping before it was done
[ 95.442458] Replaced mapping before it was done
[ 95.443240] Replaced mapping before it was done
[ 95.444022] Replaced mapping before it was done
[ 95.444814] Replaced mapping before it was done
[ 95.445599] Replaced mapping before it was done
[ 95.446345] Replaced mapping before it was done
[ 95.447327] Replaced mapping before it was done
[ 95.448120] Replaced mapping before it was done
[ 95.448888] Replaced mapping before it was done
[ 95.449662] Replaced mapping before it was done
[ OK ]
# ns2 MPTCP -> ns4 (10.0.3.1:10034) TCP [ OK ]
# ns2 TCP -> ns4 (10.0.3.1:10035) MPTCP [ OK ]
# ns3 MPTCP -> ns1 (10.0.1.1:10036) MPTCP [ 95.450451] Replaced
mapping before it was done
[ 112.571520] Replaced mapping before it was done
[ 112.587209] Replaced mapping before it was done
[ 112.594369] Replaced mapping before it was done
[ 112.600594] Replaced mapping before it was done
[ 112.612149] Replaced mapping before it was done
[ 112.613490] Replaced mapping before it was done
[ 112.626688] Replaced mapping before it was done
[ 112.644450] Replaced mapping before it was done
[ 112.651502] Replaced mapping before it was done
[ 112.654026] Replaced mapping before it was done
[ 112.656538] Replaced mapping before it was done
[ 112.658511] Replaced mapping before it was done
[ 112.661683] Replaced mapping before it was done
[ 112.666669] Replaced mapping before it was done
[ 112.669327] Replaced mapping before it was done
[ 112.693197] Replaced mapping before it was done
[ 112.697572] Replaced mapping before it was done
[ 112.701228] Replaced mapping before it was done
[ 112.709456] Replaced mapping before it was done
[ 112.718214] Replaced mapping before it was done
[ 112.734514] Replaced mapping before it was done
[ 112.744116] Replaced mapping before it was done
[ 112.751082] Replaced mapping before it was done
[ 112.767345] Replaced mapping before it was done
[ 112.768081] Replaced mapping before it was done
[ 112.771245] Replaced mapping before it was done
[ 112.774876] Replaced mapping before it was done
[ 112.778511] Replaced mapping before it was done
[ 112.787584] Replaced mapping before it was done
[ 112.801550] Replaced mapping before it was done
[ 112.807544] Replaced mapping before it was done
[ 112.810806] Replaced mapping before it was done
[ 112.811494] Replaced mapping before it was done
[ 112.815067] Replaced mapping before it was done
[ 112.821310] Replaced mapping before it was done
[ 112.822963] Replaced mapping before it was done
[ 112.833031] Replaced mapping before it was done
[ 112.878348] Replaced mapping before it was done
[ 112.881293] Replaced mapping before it was done
[ 112.884245] Replaced mapping before it was done
[ 112.887241] Replaced mapping before it was done
[ 112.890213] Replaced mapping before it was done
[ 112.893226] Replaced mapping before it was done
[ 112.896229] Replaced mapping before it was done
[ 112.907315] Replaced mapping before it was done
[ 112.909335] Replaced mapping before it was done
[ 112.914545] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns1 (10.0.1.1:10037) TCP [ OK ]
# ns3 TCP -> ns1 (10.0.1.1:10038) MPTCP [ OK ]
# ns3 MPTCP -> ns2 (10.0.1.2:10039) MPTCP [ 112.915654] Replaced
mapping before it was done
[ 116.878194] Replaced mapping before it was done
[ 116.893826] Replaced mapping before it was done
[ 116.911705] Replaced mapping before it was done
[ 116.951919] Replaced mapping before it was done
[ 116.986086] Replaced mapping before it was done
[ 117.006014] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns2 (10.0.1.2:10040) TCP [ OK ]
# ns3 TCP -> ns2 (10.0.1.2:10041) MPTCP [ OK ]
# ns3 MPTCP -> ns2 (10.0.2.1:10042) MPTCP [ 117.011297] Replaced
mapping before it was done
[ 120.941688] Replaced mapping before it was done
[ 120.948442] Replaced mapping before it was done
[ 120.953012] Replaced mapping before it was done
[ 120.954179] Replaced mapping before it was done
[ 120.955886] Replaced mapping before it was done
[ 120.961897] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns2 (10.0.2.1:10043) TCP [ OK ]
# ns3 TCP -> ns2 (10.0.2.1:10044) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.2.2:10045) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.2.2:10046) TCP [ OK ]
# ns3 TCP -> ns3 (10.0.2.2:10047) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.3.2:10048) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.3.2:10049) TCP [ OK ]
# ns3 TCP -> ns3 (10.0.3.2:10050) MPTCP [ OK ]
# ns3 MPTCP -> ns4 (10.0.3.1:10051) MPTCP [ OK ]
# ns3 MPTCP -> ns4 (10.0.3.1:10052) TCP [ OK ]
# ns3 TCP -> ns4 (10.0.3.1:10053) MPTCP [ OK ]
# ns4 MPTCP -> ns1 (10.0.1.1:10054) MPTCP [ 121.015360] Replaced
mapping before it was done
[ 147.456471] Replaced mapping before it was done
[ 147.506210] Replaced mapping before it was done
[ 147.524400] Replaced mapping before it was done
[ 147.535701] Replaced mapping before it was done
[ 147.540292] Replaced mapping before it was done
[ 147.541784] Replaced mapping before it was done
[ 147.542780] Replaced mapping before it was done
[ 147.553868] Replaced mapping before it was done
[ 147.555707] Replaced mapping before it was done
[ 147.566386] Replaced mapping before it was done
[ 147.567662] Replaced mapping before it was done
[ 147.568929] Replaced mapping before it was done
[ 147.574307] Replaced mapping before it was done
[ 147.575560] Replaced mapping before it was done
[ 147.601309] Replaced mapping before it was done
[ 147.602596] Replaced mapping before it was done
[ 147.603389] Replaced mapping before it was done
[ 147.604688] Replaced mapping before it was done
[ 147.605427] Replaced mapping before it was done
[ 147.606161] Replaced mapping before it was done
[ 147.614362] Replaced mapping before it was done
[ 147.615564] Replaced mapping before it was done
[ 147.620642] Replaced mapping before it was done
[ 147.628157] Replaced mapping before it was done
[ 147.629371] Replaced mapping before it was done
[ 147.642333] Replaced mapping before it was done
[ 147.643834] Replaced mapping before it was done
[ 147.660020] Replaced mapping before it was done
[ 147.660826] Replaced mapping before it was done
[ 147.662040] Replaced mapping before it was done
[ 147.662969] Replaced mapping before it was done
[ 147.678469] Replaced mapping before it was done
[ 147.679238] Replaced mapping before it was done
[ 147.680509] Replaced mapping before it was done
[ 147.682172] Replaced mapping before it was done
[ 147.683383] Replaced mapping before it was done
[ 147.684161] Replaced mapping before it was done
[ 147.686807] Replaced mapping before it was done
[ 147.687537] Replaced mapping before it was done
[ 147.688766] Replaced mapping before it was done
[ 147.689525] Replaced mapping before it was done
[ 147.690748] Replaced mapping before it was done
[ 147.691514] Replaced mapping before it was done
[ 147.728610] Replaced mapping before it was done
[ 147.729397] Replaced mapping before it was done
[ 147.730603] Replaced mapping before it was done
[ 147.731380] Replaced mapping before it was done
[ 147.732616] Replaced mapping before it was done
[ 147.733372] Replaced mapping before it was done
[ 147.734519] Replaced mapping before it was done
[ 147.735289] Replaced mapping before it was done
[ 147.738078] Replaced mapping before it was done
[ 147.741858] Replaced mapping before it was done
[ 147.747656] Replaced mapping before it was done
[ 147.749643] Replaced mapping before it was done
[ 147.752984] Replaced mapping before it was done
[ 147.753760] Replaced mapping before it was done
[ 147.760328] Replaced mapping before it was done
[ 147.761817] Replaced mapping before it was done
[ 147.773499] Replaced mapping before it was done
[ 147.774282] Replaced mapping before it was done
[ 147.775019] Replaced mapping before it was done
[ 147.776088] Replaced mapping before it was done
[ 147.777624] Replaced mapping before it was done
[ 147.778299] Replaced mapping before it was done
[ 147.779434] Replaced mapping before it was done
[ 147.780656] Replaced mapping before it was done
[ 147.781389] Replaced mapping before it was done
[ 147.784510] Replaced mapping before it was done
[ OK ]
# ns4 MPTCP -> ns1 (10.0.1.1:10055) TCP [ OK ]
# ns4 TCP -> ns1 (10.0.1.1:10056) MPTCP [ OK ]
# ns4 MPTCP -> ns2 (10.0.1.2:10057) MPTCP [ 147.785279] Replaced
mapping before it was done
[ 157.452612] Replaced mapping before it was done
[ 157.454093] Replaced mapping before it was done
[ 157.457792] Replaced mapping before it was done
[ 157.463385] Replaced mapping before it was done
[ 157.474383] Replaced mapping before it was done
[ 157.485216] Replaced mapping before it was done
[ 157.493835] Replaced mapping before it was done
[ 157.519095] Replaced mapping before it was done
[ 157.530277] Replaced mapping before it was done
[ 157.538921] Replaced mapping before it was done
[ 157.551129] Replaced mapping before it was done
[ 157.562293] Replaced mapping before it was done
[ 157.588288] Replaced mapping before it was done
[ 157.589520] Replaced mapping before it was done
[ 157.599306] Replaced mapping before it was done
[ 157.600596] Replaced mapping before it was done
[ 157.611909] Replaced mapping before it was done
[ 157.612748] Replaced mapping before it was done
[ 157.614101] Replaced mapping before it was done
[ 157.623566] Replaced mapping before it was done
[ 157.624935] Replaced mapping before it was done
[ 157.636249] Replaced mapping before it was done
[ 157.637547] Replaced mapping before it was done
[ 157.642686] Replaced mapping before it was done
[ 157.649446] Replaced mapping before it was done
[ 157.650227] Replaced mapping before it was done
[ 157.651483] Replaced mapping before it was done
[ 157.662030] Replaced mapping before it was done
[ 157.663748] Replaced mapping before it was done
[ 157.665401] Replaced mapping before it was done
[ 157.666178] Replaced mapping before it was done
[ 157.676388] Replaced mapping before it was done
[ 157.677191] Replaced mapping before it was done
[ 157.678369] Replaced mapping before it was done
[ 157.679087] Replaced mapping before it was done
[ 157.690077] Replaced mapping before it was done
[ 157.690824] Replaced mapping before it was done
[ 157.692002] Replaced mapping before it was done
[ 157.692786] Replaced mapping before it was done
[ 157.694010] Replaced mapping before it was done
[ 157.694784] Replaced mapping before it was done
[ 157.703884] Replaced mapping before it was done
[ 157.704634] Replaced mapping before it was done
[ 157.705816] Replaced mapping before it was done
[ 157.706580] Replaced mapping before it was done
[ 157.708002] Replaced mapping before it was done
[ 157.708800] Replaced mapping before it was done
[ 157.718261] Replaced mapping before it was done
[ 157.719053] Replaced mapping before it was done
[ 157.720240] Replaced mapping before it was done
[ 157.721016] Replaced mapping before it was done
[ 157.722471] Replaced mapping before it was done
[ 157.723247] Replaced mapping before it was done
[ 157.736450] Replaced mapping before it was done
[ 157.737240] Replaced mapping before it was done
[ 157.738429] Replaced mapping before it was done
[ 157.739208] Replaced mapping before it was done
[ 157.740430] Replaced mapping before it was done
[ 157.741213] Replaced mapping before it was done
[ 157.752235] Replaced mapping before it was done
[ 157.753022] Replaced mapping before it was done
[ 157.754222] Replaced mapping before it was done
[ 157.755002] Replaced mapping before it was done
[ 157.755764] Replaced mapping before it was done
[ 157.756923] Replaced mapping before it was done
[ 157.757693] Replaced mapping before it was done
[ 157.764862] Replaced mapping before it was done
[ 157.765613] Replaced mapping before it was done
[ 157.766410] Replaced mapping before it was done
[ 157.767578] Replaced mapping before it was done
[ 157.768789] Replaced mapping before it was done
[ 157.769997] Replaced mapping before it was done
[ 157.770796] Replaced mapping before it was done
[ 157.772156] Replaced mapping before it was done
[ 157.772939] Replaced mapping before it was done
[ 157.778911] Replaced mapping before it was done
[ 157.779687] Replaced mapping before it was done
[ 157.780897] Replaced mapping before it was done
[ 157.781667] Replaced mapping before it was done
[ 157.783569] Replaced mapping before it was done
[ 157.784324] Replaced mapping before it was done
[ 157.785473] Replaced mapping before it was done
[ 157.786384] Replaced mapping before it was done
[ 157.792879] Replaced mapping before it was done
[ 157.796139] Replaced mapping before it was done
[ 157.797561] Replaced mapping before it was done
[ 157.799165] Replaced mapping before it was done
[ 157.799962] Replaced mapping before it was done
[ 157.801428] Replaced mapping before it was done
[ 157.802222] Replaced mapping before it was done
[ 157.804827] Replaced mapping before it was done
[ 157.805598] Replaced mapping before it was done
[ OK ]
# ns4 MPTCP -> ns2 (10.0.1.2:10058) TCP [ OK ]
# ns4 TCP -> ns2 (10.0.1.2:10059) MPTCP [ OK ]
# ns4 MPTCP -> ns2 (10.0.2.1:10060) MPTCP [ 157.806789] Replaced
mapping before it was done
[ 166.903183] Replaced mapping before it was done
[ 166.943365] Replaced mapping before it was done
[ 166.948613] Replaced mapping before it was done
[ 166.962651] Replaced mapping before it was done
[ 166.963987] Replaced mapping before it was done
[ 166.976260] Replaced mapping before it was done
[ 166.987087] Replaced mapping before it was done
[ 166.991032] Replaced mapping before it was done
[ 167.003736] Replaced mapping before it was done
[ 167.014847] Replaced mapping before it was done
[ 167.016107] Replaced mapping before it was done
[ 167.026187] Replaced mapping before it was done
[ 167.038067] Replaced mapping before it was done
[ 167.039304] Replaced mapping before it was done
[ 167.052895] Replaced mapping before it was done
[ 167.054371] Replaced mapping before it was done
[ 167.055112] Replaced mapping before it was done
[ 167.065909] Replaced mapping before it was done
[ 167.067527] Replaced mapping before it was done
[ 167.068299] Replaced mapping before it was done
[ 167.078825] Replaced mapping before it was done
[ 167.080105] Replaced mapping before it was done
[ 167.091030] Replaced mapping before it was done
[ 167.092289] Replaced mapping before it was done
[ 167.103328] Replaced mapping before it was done
[ 167.104098] Replaced mapping before it was done
[ 167.105320] Replaced mapping before it was done
[ 167.106236] Replaced mapping before it was done
[ 167.107474] Replaced mapping before it was done
[ 167.119817] Replaced mapping before it was done
[ 167.125628] Replaced mapping before it was done
[ 167.126415] Replaced mapping before it was done
[ 167.127587] Replaced mapping before it was done
[ 167.128422] Replaced mapping before it was done
[ 167.139439] Replaced mapping before it was done
[ 167.144177] Replaced mapping before it was done
[ 167.145900] Replaced mapping before it was done
[ 167.146792] Replaced mapping before it was done
[ 167.147988] Replaced mapping before it was done
[ 167.148819] Replaced mapping before it was done
[ 167.149992] Replaced mapping before it was done
[ 167.150932] Replaced mapping before it was done
[ 167.152217] Replaced mapping before it was done
[ 167.153009] Replaced mapping before it was done
[ 167.158968] Replaced mapping before it was done
[ 167.159759] Replaced mapping before it was done
[ 167.160533] Replaced mapping before it was done
[ 167.161618] Replaced mapping before it was done
[ 167.162388] Replaced mapping before it was done
[ 167.163119] Replaced mapping before it was done
[ 167.163892] Replaced mapping before it was done
[ 167.165032] Replaced mapping before it was done
[ 167.165993] Replaced mapping before it was done
[ 167.166781] Replaced mapping before it was done
[ 167.177238] Replaced mapping before it was done
[ 167.178028] Replaced mapping before it was done
[ 167.178811] Replaced mapping before it was done
[ 167.180117] Replaced mapping before it was done
[ 167.181053] Replaced mapping before it was done
[ 167.181994] Replaced mapping before it was done
[ 167.183179] Replaced mapping before it was done
[ 167.183928] Replaced mapping before it was done
[ 167.184663] Replaced mapping before it was done
[ 167.185701] Replaced mapping before it was done
[ 167.186422] Replaced mapping before it was done
[ 167.192883] Replaced mapping before it was done
[ 167.193650] Replaced mapping before it was done
[ 167.194830] Replaced mapping before it was done
[ 167.195534] Replaced mapping before it was done
[ 167.196665] Replaced mapping before it was done
[ 167.197387] Replaced mapping before it was done
[ 167.198535] Replaced mapping before it was done
[ 167.199454] Replaced mapping before it was done
[ 167.200589] Replaced mapping before it was done
[ 167.201497] Replaced mapping before it was done
[ 167.211678] Replaced mapping before it was done
[ 167.213060] Replaced mapping before it was done
[ 167.214417] Replaced mapping before it was done
[ 167.215378] Replaced mapping before it was done
[ 167.216302] Replaced mapping before it was done
[ 167.224399] Replaced mapping before it was done
[ 167.225225] Replaced mapping before it was done
[ 167.226002] Replaced mapping before it was done
[ 167.227140] Replaced mapping before it was done
[ OK ]
# ns4 MPTCP -> ns2 (10.0.2.1:10061) TCP [ OK ]
# ns4 TCP -> ns2 (10.0.2.1:10062) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.2.2:10063) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.2.2:10064) TCP [ OK ]
# ns4 TCP -> ns3 (10.0.2.2:10065) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.3.2:10066) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.3.2:10067) TCP [ OK ]
# ns4 TCP -> ns3 (10.0.3.2:10068) MPTCP [ OK ]
# ns4 MPTCP -> ns4 (10.0.3.1:10069) MPTCP [ OK ]
# ns4 MPTCP -> ns4 (10.0.3.1:10070) TCP [ OK ]
# ns4 TCP -> ns4 (10.0.3.1:10071) MPTCP [ OK ]
ok 1 selftests: mptcp: mptcp_connect.sh
make[1]: warning: Clock skew detected. Your build may be incomplete.
A bit less without KASAN and PROVE_LOCKING (launched on May 28, 2019
16:47:08 UTC)
TAP version 13
1..1
# selftests: mptcp: mptcp_connect.sh
[ 15.420305] ip (556) used greatest stack depth: 12168 bytes left
[ 15.506125] IPv6: ADDRCONF(NETDEV_CHANGE): ns1eth2: link becomes ready
# Error: Specified qdisc not found.
[ 15.587395] IPv6: ADDRCONF(NETDEV_CHANGE): ns2eth3: link becomes ready
# Error: Specified qdisc not found.
[ 15.735700] IPv6: ADDRCONF(NETDEV_CHANGE): ns3eth4: link becomes ready
# Created /tmp/tmp.p6Y0N8EF65 (size 142618) containing data sent by client
# Created /tmp/tmp.wDIjuigEtN (size 1320329) containing data sent by server
# ns1 MPTCP -> ns1 (10.0.1.1:10000) MPTCP [ 16.498671] IPv6:
ADDRCONF(NETDEV_CHANGE): ns2eth1: link becomes ready
[ OK ]
# ns1 MPTCP -> ns1 (10.0.1.1:10001) TCP [ OK ]
# ns1 TCP -> ns1 (10.0.1.1:10002) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.1.2:10003) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.1.2:10004) TCP [ OK ]
# ns1 TCP -> ns2 (10.0.1.2:10005) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.2.1:10006) MPTCP [ OK ]
# ns1 MPTCP -> ns2 (10.0.2.1:10007) TCP [ OK ]
# ns1 TCP -> ns2 (10.0.2.1:10008) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.2.2:10009) MPTCP [ 26.111191] Replaced
mapping before it was done
[ 26.111217] Replaced mapping before it was done
[ OK ]
# ns1 MPTCP -> ns3 (10.0.2.2:10010) TCP [ OK ]
# ns1 TCP -> ns3 (10.0.2.2:10011) MPTCP [ OK ]
# ns1 MPTCP -> ns3 (10.0.3.2:10012) MPTCP [ 26.111949] Replaced
mapping before it was done
[ 29.213623] Replaced mapping before it was done
[ 29.214367] Replaced mapping before it was done
[ 29.215425] Replaced mapping before it was done
[ 29.216188] Replaced mapping before it was done
[ 29.216875] Replaced mapping before it was done
[ 29.217566] Replaced mapping before it was done
[ 29.218222] Replaced mapping before it was done
[ 29.218919] Replaced mapping before it was done
[ 29.219606] Replaced mapping before it was done
[ 29.220284] Replaced mapping before it was done
[ 29.220978] Replaced mapping before it was done
[ 29.221677] Replaced mapping before it was done
[ 29.222379] Replaced mapping before it was done
[ 29.223062] Replaced mapping before it was done
[ 29.224121] Replaced mapping before it was done
[ 29.225069] Replaced mapping before it was done
[ 29.225752] Replaced mapping before it was done
[ 29.226462] Replaced mapping before it was done
[ OK ]
# ns1 MPTCP -> ns3 (10.0.3.2:10013) TCP [ OK ]
# ns1 TCP -> ns3 (10.0.3.2:10014) MPTCP [ OK ]
# ns1 MPTCP -> ns4 (10.0.3.1:10015) MPTCP [ 29.227212] Replaced
mapping before it was done
[ 32.331271] Replaced mapping before it was done
[ 32.332024] Replaced mapping before it was done
[ 32.332740] Replaced mapping before it was done
[ 32.333487] Replaced mapping before it was done
[ 32.334283] Replaced mapping before it was done
[ 32.336077] Replaced mapping before it was done
[ OK ]
# ns1 MPTCP -> ns4 (10.0.3.1:10016) TCP [ OK ]
# ns1 TCP -> ns4 (10.0.3.1:10017) MPTCP [ OK ]
# ns2 MPTCP -> ns1 (10.0.1.1:10018) MPTCP [ OK ]
# ns2 MPTCP -> ns1 (10.0.1.1:10019) TCP [ OK ]
# ns2 TCP -> ns1 (10.0.1.1:10020) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.1.2:10021) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.1.2:10022) TCP [ OK ]
# ns2 TCP -> ns2 (10.0.1.2:10023) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.2.1:10024) MPTCP [ OK ]
# ns2 MPTCP -> ns2 (10.0.2.1:10025) TCP [ OK ]
# ns2 TCP -> ns2 (10.0.2.1:10026) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.2.2:10027) MPTCP [ 32.336955] Replaced
mapping before it was done
[ 44.709910] Replaced mapping before it was done
[ 44.711156] Replaced mapping before it was done
[ 44.711993] Replaced mapping before it was done
[ 44.712730] Replaced mapping before it was done
[ 44.713422] Replaced mapping before it was done
[ 44.714121] Replaced mapping before it was done
[ 44.714813] Replaced mapping before it was done
[ 44.715560] Replaced mapping before it was done
[ 44.716425] Replaced mapping before it was done
[ 44.717091] Replaced mapping before it was done
[ 44.717943] Replaced mapping before it was done
[ 44.718569] Replaced mapping before it was done
[ 44.719232] Replaced mapping before it was done
[ 44.719944] Replaced mapping before it was done
[ OK ]
# ns2 MPTCP -> ns3 (10.0.2.2:10028) TCP [ OK ]
# ns2 TCP -> ns3 (10.0.2.2:10029) MPTCP [ OK ]
# ns2 MPTCP -> ns3 (10.0.3.2:10030) MPTCP [ 44.720685] Replaced
mapping before it was done
[ 47.811611] Replaced mapping before it was done
[ 47.812545] Replaced mapping before it was done
[ 47.813250] Replaced mapping before it was done
[ 47.814007] Replaced mapping before it was done
[ 47.814731] Replaced mapping before it was done
[ 47.815444] Replaced mapping before it was done
[ 47.816155] Replaced mapping before it was done
[ 47.816880] Replaced mapping before it was done
[ 47.817570] Replaced mapping before it was done
[ OK ]
# ns2 MPTCP -> ns3 (10.0.3.2:10031) TCP [ OK ]
# ns2 TCP -> ns3 (10.0.3.2:10032) MPTCP [ OK ]
# ns2 MPTCP -> ns4 (10.0.3.1:10033) MPTCP [ 47.818284] Replaced
mapping before it was done
[ 50.919166] Replaced mapping before it was done
[ 50.920186] Replaced mapping before it was done
[ 50.920967] Replaced mapping before it was done
[ 50.921695] Replaced mapping before it was done
[ 50.922365] Replaced mapping before it was done
[ OK ]
# ns2 MPTCP -> ns4 (10.0.3.1:10034) TCP [ OK ]
# ns2 TCP -> ns4 (10.0.3.1:10035) MPTCP [ OK ]
# ns3 MPTCP -> ns1 (10.0.1.1:10036) MPTCP [ 50.923077] Replaced
mapping before it was done
[ 54.023781] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns1 (10.0.1.1:10037) TCP [ OK ]
# ns3 TCP -> ns1 (10.0.1.1:10038) MPTCP [ OK ]
# ns3 MPTCP -> ns2 (10.0.1.2:10039) MPTCP [ 54.024528] Replaced
mapping before it was done
[ 57.122333] Replaced mapping before it was done
[ 57.123256] Replaced mapping before it was done
[ 57.123867] Replaced mapping before it was done
[ 57.125187] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns2 (10.0.1.2:10040) TCP [ OK ]
# ns3 TCP -> ns2 (10.0.1.2:10041) MPTCP [ OK ]
# ns3 MPTCP -> ns2 (10.0.2.1:10042) MPTCP [ 57.125966] Replaced
mapping before it was done
[ 60.223267] Replaced mapping before it was done
[ 60.223975] Replaced mapping before it was done
[ 60.224649] Replaced mapping before it was done
[ OK ]
# ns3 MPTCP -> ns2 (10.0.2.1:10043) TCP [ OK ]
# ns3 TCP -> ns2 (10.0.2.1:10044) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.2.2:10045) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.2.2:10046) TCP [ OK ]
# ns3 TCP -> ns3 (10.0.2.2:10047) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.3.2:10048) MPTCP [ OK ]
# ns3 MPTCP -> ns3 (10.0.3.2:10049) TCP [ OK ]
# ns3 TCP -> ns3 (10.0.3.2:10050) MPTCP [ OK ]
# ns3 MPTCP -> ns4 (10.0.3.1:10051) MPTCP [ OK ]
# ns3 MPTCP -> ns4 (10.0.3.1:10052) TCP [ OK ]
# ns3 TCP -> ns4 (10.0.3.1:10053) MPTCP [ OK ]
# ns4 MPTCP -> ns1 (10.0.1.1:10054) MPTCP [ 60.225606] Replaced
mapping before it was done
[ 72.597843] Replaced mapping before it was done
[ OK ]
# ns4 MPTCP -> ns1 (10.0.1.1:10055) TCP [ OK ]
# ns4 TCP -> ns1 (10.0.1.1:10056) MPTCP [ OK ]
# ns4 MPTCP -> ns2 (10.0.1.2:10057) MPTCP [ 72.598742] Replaced
mapping before it was done
[ OK ]
# ns4 MPTCP -> ns2 (10.0.1.2:10058) TCP [ OK ]
# ns4 TCP -> ns2 (10.0.1.2:10059) MPTCP [ OK ]
# ns4 MPTCP -> ns2 (10.0.2.1:10060) MPTCP [ 75.699965] Replaced
mapping before it was done
[ OK ]
# ns4 MPTCP -> ns2 (10.0.2.1:10061) TCP [ OK ]
# ns4 TCP -> ns2 (10.0.2.1:10062) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.2.2:10063) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.2.2:10064) TCP [ OK ]
# ns4 TCP -> ns3 (10.0.2.2:10065) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.3.2:10066) MPTCP [ OK ]
# ns4 MPTCP -> ns3 (10.0.3.2:10067) TCP [ OK ]
# ns4 TCP -> ns3 (10.0.3.2:10068) MPTCP [ OK ]
# ns4 MPTCP -> ns4 (10.0.3.1:10069) MPTCP [ OK ]
# ns4 MPTCP -> ns4 (10.0.3.1:10070) TCP [ OK ]
# ns4 TCP -> ns4 (10.0.3.1:10071) MPTCP [ OK ]
ok 1 selftests: mptcp: mptcp_connect.sh
make[1]: warning: Clock skew detected. Your build may be incomplete.
Can be reproduced by downloading the two *virtme.sh scripts from the
"scripts" branch:
https://github.com/multipath-tcp/mptcp_net-next/tree/scripts/ci
and launching the Docker script:
bash -x patches/docker/Dockerfile.virtme.sh patches/virtme.sh
Docker is the only real dependence.
Cheers,
Matt
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
2 years, 11 months
[Weekly meetings] MoM - 23rd of May 2019
by Matthieu Baerts
Hello,
We just had our 51st meeting with Mat, Peter and Ossama (Intel OTC),
Paolo, Davide, Florian (Red Hat) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Accepted patches:
- mptcp: plug mptcp_accept memory leaks (3 patches):
→ by Florian
→ accepted by Peter & Mat
→ 2 patches have been squashed, one added at the end
- mptcp: selftests: exercise GSO, retransmission and reorder code path:
→ by Paolo
→ accepted by Florian
→ "squashed" into "mptcp: selftests: switch to netns+veth based
tests"
→ one note by Mat:
the packet reordering is only affecting TCP reassembly, and
does not exercise reassembly at the MPTCP layer differently. The stream
is still delivered to the MPTCP layer in-order.
MPTCP-level reassembly in the prototype implementation does
not yet handle out-of-order mappings. That will get built in when
updating mptcp_recvmsg() for multiple subflows.
→ Still a good thing to test.
→ We will want to test with multiple subflows, different
(and variable) delay
- mptcp: Add explicit check for protocol version:
→ by Peter
→ accepted by Mat
→ "squashed" into "mptcp: Handle MPTCP TCP options"
Pending patches:
- preliminary support for 'ss' (2 patches - RFC):
→ by Davide
→ are you waiting for more comments? → seems OK for the first RFC
→ RFC patch v2 in preparation
→ will propose that to net-next to have comments from ULP
community and maybe already have it in net-next (useful only for kTLS
for the moment)
- mptcp: switch sublist to mptcp socket lock protection:
→ by Florian
→ Paolo did an internal review, will comment on the ML
→ Peter will comment as well
→ waiting for review (v2 available)
- net: mptcp: don't leak 'slab' and 'slab_name' on exit:
→ by Davide
→ v1 reviewed by Mat
→ v2 expected
- MP_JOIN handling WIP:
→ by Peter
→ quickly reviewed by Paolo
→ Paolo suggests to apply it quickly
→ we might need to make sure Selftests are still passing.
→ note that since we are adding some delay/losses/reording, we
might have "random" failures.
netconf:
- planned for next month in Boston (20th of June)
- Paolo and Florian will join
- that will be the opportunity to talk with other net-next devs
Sync with net-next:
- got the first conflict, easy to resolve, more details on the ML
Automatic rebase:
- proposition from Mat from last week: add a tag before destroying
the export branch (with the date). At least commit are not lost.
- Matth: done
- A tag is now generated after each "rebase":
export/<date>
export/20190517T115519
Future points (from last time):
- In the tests, Paolo would like to introduce drops and re-order → done
- Peter has work in progress for the MP_JOIN. → shared
- Peter will try to share a RFC next week, also with ADD_ADDR
handling. → shared
- Mat looking at the DATA-FIN handling. → WIP
Cover letter draft for Eric:
The MPTCP upstreaming community has prepared a pre-net-next RFC
patch set for review:
https://github.com/multipath-tcp/mptcp_net-next/tree/<TBD> → can be
export, an export tag or a dedicated branch
With CONFIG_MPTCP=y, a socket created with IPPROTO_MPTCP will
attempt to create an MPTCP connection but remains compatible with
regular TCP. IPPROTO_TCP socket behavior is unchanged.
This implementation makes use of ULP between the userspace-facing
MPTCP socket and the set of in-kernel TCP sockets it controls. ULP has
been extended for use with listening sockets. skb_ext is used to carry
MPTCP metadata.
The patch set includes a self-test to exercise MPTCP in various
connection and routing scenarios.
We have more work to do to reach the initial feature set for
merging, notably:
* Handling MP_JOIN requests to accept multiple subflows → it should
be part of it
* Coupling receive windows across sibling subflow TCP socket → we
should mention that this is part of RFC 6824, not just a fancy feature
we want to add :)
* IPv6
* Not exposing the subflow ULP type to userspace
Thank you for your review. You can find us at mptcp(a)lists.01.org and
https://is.gd/mptcp_upstream
Questions related to maintainer review:
- CONFIG_MPTCP is a bool, but we have some module infrastructure in
net/mptcp/. Should we remove the module code to make this consistent?
- at least to be removed before sending this to Netdev ML (not to
have people stopping after the first inconsistency)
- same for checkpatch.pl
- maybe some commits would need to be squashed as well
When to send this to Eric:
- MP_JOIN is changing a bit TCP code (original socket doesn't get
the new subflow)
- maybe OK to have the netconf as a limit minus 1 week: first half
of June
mptcpd (Netlink daemon for MPTCP):
- Migrate to multipath-tcp.org generic netlink API. (#15) → merged
in master
- A few things are missing (netlink attributes missing) but it is on
the good way!
- Ossama has some questions, will send them to the ML
mptcp.org:
- new sync v4.19.36 → .44
- new fixes coming for TFO
LPC 2019:
- CfP for Networking sessions should open later.
- confirmed on netdev ML
- would be very nice to participate
Next meeting:
- We propose to have it next Friday, the 31st of May.
- /!\ not on Thursday but on Friday /!\
- Usual time: 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20190531
Feel free to comment on these points and propose new ones for the next
meeting!
Talk to you next week,
Matthieu
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
2 years, 11 months
[Weekly meetings] MoM - 31st of May 2019
by Matthieu Baerts
Hello,
We just had our 52nd meeting with Mat and Ossama (Intel OTC), Christoph
(Apple), Paolo, Davide and Florian (Red Hat) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Accepted patches:
- net: mptcp: don't leak 'slab' and 'slab_name' on exit:
- by Davide
- accepted by Mat
- squashed in "mptcp: Create SUBFLOW socket for incoming
connections"
- Typo in mptcp_connect.sh:
- by Florian
- accepted by Matth
- squashed in "mptcp: selftests: switch to netns+veth based tests"
- mptcp: switch sublist to mptcp socket lock protection:
- by Florian
- v4 accepted by Mat
- added at the end
- mptcp: Make mptcp initialization part of tcp initialization:
- by Peter
- v2 accepted by Florian
- squashed in 3 different commits
- small notifications done when applying the patch, see ML for
more details
- https://lists.01.org/pipermail/mptcp/2019-May/001272.html
Pending patches:
- RFC by Peter:
- he is working on a v2
(+ a rebase after last changes made by Florian)
- mptcp:init: panic in case of error:
- by Matthieu
Sync with net-next:
- no sync last night because of an error: net-next doesn't compile
when IPV6 not compiled:
./include/linux/netfilter_ipv6.h: In function 'nf_ipv6_br_defrag':
./include/linux/netfilter_ipv6.h:110:9: error: implicit
declaration of function 'nf_ct_frag6_gather'; did you mean
'nf_ct_attach'? [-Werror=implicit-function-declaration]
- fix:
https://lore.kernel.org/netdev/20190531081143.21446-1-pablo@netfilter.org...
- fix v2: https://patchwork.ozlabs.org/patch/1108255/
- should we always compile with IPV6 support?
→ We can do that later when we will have MPTCP IPv6 support
How to handle sk_state on the mptcp socket:
- FastClose: better to take the option B: send reset and clear
resources, no need to have an extra state (WAIT_FOR_RST)
- when creating the new MPTCP connection, we maintain our own state
(using TCP state)
- after, we are linked to the data connection → MPTCP connection.
→ if one sf established and one connecting, we are still in
established state
→ we can be in a situation where there is no more subflow:
→ until we get a DATA_FIN
→ for a first version, we can also stop the MPTCP connection if
there is no more subflows if it is easier in the code
→ we can have a timeout when there is no more subflow (and no
DATA_FIN)
→ Break-before-make:
→ Mat will add note in the wiki
→ we will need to support that, can be done later:
→
https://tools.ietf.org/id/draft-defoy-mptcp-considerations-for-5g-00.html...
(MP)TFO:
- do we need to support it now?:
→ Not for a first step
- if no, what to do?:
- we should not break TFO without MPTCP
- ignore TFO with MPTCP for the moment
- be sure that TFO doesn't break MPTCP! (that was the comment
from Paolo on Peter's RFC)
- add some comments (TODO) if we are thinking we would need an
adaptation in the future (not to forget them)
locks:
- (on the ML) Mat: At an earlier point we thought there would be a
need to read the list without holding a lock, but I don't remember what
that case was and looking at the current code the socket lock works well.
- (on the ML) Christoph: I think, that was to support lockless
subflow establishment, similar to the way Linux supports lockless
(meaning, without taking the listener's lock) connection establishment
on the server-side.
- we need to take the lock when we want to add stuff to the list. To
support lock-less establishment, we don't want to take MPTCP lock on the
server side. To avoid taking the lock when anything want to walk through
to list of sf, we need an RCU list. (racing against a 3rd ACK that
confirms the SF establishment). We would only need to access the list
lock when we modify the list, not when we walk through the RCU list.
- Paolo: RCU adds latency overhead, especially when there are
syscalls (sync needed)
- difficult to know the cost of the contention we would have with a
lock instead of RCU.
- we don't have to support the lock-less establishment but TCP was
going on this direction (lock-less)
- when Christoph did that in mptcp.org, he saw a great improvement
with Apache benchmark.
- we can also improve this later: best design first and
optimisations later.
- currently some syscall can modify shared stuff: if run in //, they
could create memleaks or deref pointers:
- Paolo has a patch to fix some problems there
- the idea would be sent them as RFC and postpone their
application for after MP_JOIN support
- no being able to walk through the list can be an issue for the
stats, e.g.: if we want to list the MPTCP and show the number of
subflows, we would like to avoid taking locks there
KSelftests:
- warnings: "Replaced mapping before it was done"
- some were fixed by a fix from Paolo.
- reproducible using:
https://github.com/multipath-tcp/mptcp_net-next/tree/scripts/ci
- running on a single CPU
- but tests are successful
- with and without KASAN and PROVE_LOCKING config.
CI:
- now testing KSelftests
- scripts are available in the 'scripts' branch
- https://github.com/multipath-tcp/mptcp_net-next/tree/scripts/ci
(virtme)
- Suggestions for the future:
- by Mat: enable debug features like CONFIG_KASAN and
CONFIG_PROVE_LOCKING in the test kernel and then check the console
output for KASAN/locking issues. There is a tradeoff in speed, but it
could alert us to problems the selftests alone don't catch.
- done → now always running with them
- But might be interesting to run without and with ↑
- TODO: Matth can update the scripts (feel free to propose
changes for these scripts too!)
netdev 0x14:
- will be next year in March in Canada (west coast, Vancouver)
LPC 2019:
- nothing new
Next meeting:
- We propose to have it next Thursday, the 6th of June.
- Christoph will not be able to join.
- Usual time: 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20190606
Feel free to comment on these points and propose new ones for the next
meeting!
Talk to you next week,
Matthieu
--
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
2 years, 11 months
[PATCH v3] mptcp: Make mptcp initialization part of tcp initialization
by Peter Krystad
Remove remnant module initialization of MPTCP and make it
part of the inet/tcp initialization sequence.
OK to squash but needs to be split up between
"mptcp: Add MPTCP socket stubs" and
"mptcp: Associate MPTCP context with TCP socket"
v2 - ignore
v3 - fix function declaration
Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
include/net/mptcp.h | 6 ++++++
net/ipv4/tcp.c | 2 ++
net/mptcp/protocol.c | 22 +++-------------------
net/mptcp/subflow.c | 15 ++++++++++++---
4 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index ed67b140af33..65dd7f052e94 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -49,6 +49,8 @@ struct mptcp_out_options {
#ifdef CONFIG_MPTCP
+void mptcp_init(void);
+
static inline bool sk_is_mptcp(const struct sock *sk)
{
return tcp_sk(sk)->is_mptcp;
@@ -84,6 +86,10 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts);
#else
+static inline void mptcp_init(void)
+{
+}
+
static inline bool sk_is_mptcp(const struct sock *sk)
{
return false;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index cb072dce81a7..ab242851da3f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -275,6 +275,7 @@
#include <net/icmp.h>
#include <net/inet_common.h>
#include <net/tcp.h>
+#include <net/mptcp.h>
#include <net/xfrm.h>
#include <net/ip.h>
#include <net/sock.h>
@@ -3947,4 +3948,5 @@ void __init tcp_init(void)
tcp_metrics_init();
BUG_ON(tcp_register_congestion_control(&tcp_reno) != 0);
tcp_tasklet_init();
+ mptcp_init();
}
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 06312efc0b90..d1c617852e0f 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1009,7 +1009,7 @@ static struct inet_protosw mptcp_protosw = {
.flags = INET_PROTOSW_ICSK,
};
-static int __init mptcp_init(void)
+void mptcp_init(void)
{
int err;
@@ -1036,26 +1036,10 @@ static int __init mptcp_init(void)
inet_register_protosw(&mptcp_protosw);
- return 0;
-
+ return;
proto_failed:
subflow_exit();
subflow_failed:
- return err;
-}
-
-static void __exit mptcp_exit(void)
-{
- inet_unregister_protosw(&mptcp_protosw);
- proto_unregister(&mptcp_prot);
-
- subflow_exit();
+ return;
}
-
-module_init(mptcp_init);
-module_exit(mptcp_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_MPTCP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_MPTCP);
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index bc8e1a0658ec..e4ae5c5d177d 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -294,6 +294,12 @@ static int subflow_ops_init(struct request_sock_ops *subflow_ops)
return 0;
}
+static void subflow_ops_exit(void)
+{
+ kfree(subflow_request_sock_ops.slab_name);
+ kmem_cache_destroy(subflow_request_sock_ops.slab);
+}
+
int subflow_init(void)
{
int ret;
@@ -312,12 +318,15 @@ int subflow_init(void)
subflow_specific.sk_rx_dst_set = subflow_finish_connect;
subflow_specific.rebuild_header = subflow_rebuild_header;
- return tcp_register_ulp(&subflow_ulp_ops);
+ ret = tcp_register_ulp(&subflow_ulp_ops);
+ if (ret != 0)
+ subflow_ops_exit();
+
+ return ret;
}
void subflow_exit(void)
{
tcp_unregister_ulp(&subflow_ulp_ops);
+ subflow_ops_exit();
}
-
-MODULE_LICENSE("GPL");
--
2.17.2
2 years, 11 months
[RFC 0/3] MP_JOIN handling WIP
by Peter Krystad
Current state of MP_JOIN handling. As I mentioned this is not
functional yet but am sharing for visibility. The intent of this
patchset is to complete the handshake for a second subflow in the
incoming direction. Sending an outgoing SYN with MP_JOIN and the
data path is not addressed.
It will already need some refactor due to Florian's changes to
subflow list locking.
Peter Krystad (3):
mptcp: Slightly refactor mptcp_established_options_xxx()
mptcp: Add ADD_ADDR handling
mptcp: Add handling of incoming MP_JOIN requests
include/linux/tcp.h | 6 ++
include/net/mptcp.h | 44 ++++++++++++--
include/net/tcp.h | 6 ++
net/ipv4/tcp_minisocks.c | 6 ++
net/ipv4/tcp_output.c | 31 ++++++----
net/mptcp/Makefile | 2 +-
net/mptcp/options.c | 127 ++++++++++++++++++++++++++++++++++++---
net/mptcp/pm.c | 24 ++++++++
net/mptcp/protocol.c | 24 ++++++++
net/mptcp/protocol.h | 45 +++++++++++++-
net/mptcp/subflow.c | 42 +++++++++++++
net/mptcp/token.c | 124 ++++++++++++++++++++++++++++++++++++++
12 files changed, 451 insertions(+), 30 deletions(-)
create mode 100644 net/mptcp/pm.c
--
2.17.2
2 years, 11 months
Change in ...mptcp_net-next[scripts]: ci:upd-tg: avoid 'tg push' 'up-to-date' error
by Matthieu Baerts (GerritHub)
Hello Mat Martineau,
I'd like you to do a code review. Please visit
https://review.gerrithub.io/c/multipath-tcp/mptcp_net-next/+/456463
to review the following change.
Change subject: ci:upd-tg: avoid 'tg push' 'up-to-date' error
......................................................................
ci:upd-tg: avoid 'tg push' 'up-to-date' error
When syncing, if our TopGit tree has been updated by someone and there
is also a new update of the base, we will need to launch 'tg update'
twice: once to be sync with our repo, another one to propagate the
modification made in the base to the rest of the tree.
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Change-Id: Ib142a511c240fba2df5f8ec2f0c9ed3f3c86dfa0
---
M ci/update-tg-tree.sh
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/multipath-tcp/mptcp_net-next refs/changes/63/456463/1
--
To view, visit https://review.gerrithub.io/c/multipath-tcp/mptcp_net-next/+/456463
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: multipath-tcp/mptcp_net-next
Gerrit-Branch: scripts
Gerrit-Change-Id: Ib142a511c240fba2df5f8ec2f0c9ed3f3c86dfa0
Gerrit-Change-Number: 456463
Gerrit-PatchSet: 1
Gerrit-Owner: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Gerrit-Reviewer: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Gerrit-MessageType: newchange
2 years, 11 months
[PATCH mptcp v4] mptcp: switch sublist to mptcp socket lock protection
by Florian Westphal
The mptcp sublist is currently guarded by rcu, but this comes with
several artifacts that make little sense.
1. There is a synchronize_rcu after stealing the subflow list on
each mptcp socket close.
synchronize_rcu() is a very expensive call, and should not be
needed.
2. There is a extra spinlock to guard the list, ey we can't use
the lock in some cases because we need to call functions that
might sleep.
3. There is a 'mptcp_subflow_hold()' function that uses
an 'atomic_inc_not_zero' call. This wasn't needed even with
current code: The owning mptcp socket holds references on its
subflows, so a subflow socket that is still found on the list
will always have a nonzero reference count.
This changes the subflow list to always be guarded by the owning
mptcp socket lock. This is safe as long as no code path that holds
a mptcp subflow tcp socket lock will try to lock the owning mptcp
sockets lock.
The inverse -- locking the tcp subflow lock while holding the
mptcp lock -- is fine.
mptcp_subflow_get_ref() will have to be altered later when we
support multiple subflows so it will pick a 'preferred' subflow
rather than the first one in the list.
v4: - remove all sk_state changes added in v2/v3, they do not
belong here -- it should be done as a separate change.
- prefer mptcp_for_each_subflow rather than list_for_each_entry.
v3: use BH locking scheme in mptcp_finish_connect, there is no
guarantee we are always called from backlog processing.
Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
net/mptcp/protocol.c | 161 +++++++++++++++++++------------------------
net/mptcp/protocol.h | 3 +-
2 files changed, 73 insertions(+), 91 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 9a98c8e0c996..6c92c210aac5 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -25,26 +25,20 @@ static inline bool before64(__u64 seq1, __u64 seq2)
#define after64(seq2, seq1) before64(seq1, seq2)
-static bool mptcp_subflow_hold(struct subflow_context *subflow)
-{
- struct sock *sk = mptcp_subflow_tcp_socket(subflow)->sk;
-
- return refcount_inc_not_zero(&sk->sk_refcnt);
-}
-
static struct sock *mptcp_subflow_get_ref(const struct mptcp_sock *msk)
{
struct subflow_context *subflow;
- rcu_read_lock();
+ sock_owned_by_me((const struct sock *)msk);
+
mptcp_for_each_subflow(msk, subflow) {
- if (mptcp_subflow_hold(subflow)) {
- rcu_read_unlock();
- return mptcp_subflow_tcp_socket(subflow)->sk;
- }
+ struct sock *sk;
+
+ sk = mptcp_subflow_tcp_socket(subflow)->sk;
+ sock_hold(sk);
+ return sk;
}
- rcu_read_unlock();
return NULL;
}
@@ -179,9 +173,12 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
return sock_sendmsg(msk->subflow, msg);
}
+ lock_sock(sk);
ssk = mptcp_subflow_get_ref(msk);
- if (!ssk)
+ if (!ssk) {
+ release_sock(sk);
return -ENOTCONN;
+ }
if (!msg_data_left(msg)) {
pr_debug("empty send");
@@ -196,7 +193,6 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
goto put_out;
}
- lock_sock(sk);
lock_sock(ssk);
timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
while (msg_data_left(msg)) {
@@ -214,9 +210,9 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
}
release_sock(ssk);
- release_sock(sk);
put_out:
+ release_sock(sk);
sock_put(ssk);
return ret;
}
@@ -381,14 +377,16 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
return sock_recvmsg(msk->subflow, msg, flags);
}
+ lock_sock(sk);
ssk = mptcp_subflow_get_ref(msk);
- if (!ssk)
+ if (!ssk) {
+ release_sock(sk);
return -ENOTCONN;
+ }
subflow = subflow_ctx(ssk);
tp = tcp_sk(ssk);
- lock_sock(sk);
lock_sock(ssk);
desc.arg.data = &arg;
@@ -566,57 +564,36 @@ static int mptcp_init_sock(struct sock *sk)
pr_debug("msk=%p", msk);
- INIT_LIST_HEAD_RCU(&msk->conn_list);
- spin_lock_init(&msk->conn_list_lock);
+ INIT_LIST_HEAD(&msk->conn_list);
return 0;
}
-static void mptcp_flush_conn_list(struct sock *sk, struct list_head *list)
-{
- struct mptcp_sock *msk = mptcp_sk(sk);
-
- INIT_LIST_HEAD_RCU(list);
- spin_lock_bh(&msk->conn_list_lock);
- list_splice_init(&msk->conn_list, list);
- spin_unlock_bh(&msk->conn_list_lock);
-
- if (!list_empty(list))
- synchronize_rcu();
-}
-
static void mptcp_close(struct sock *sk, long timeout)
{
struct mptcp_sock *msk = mptcp_sk(sk);
struct subflow_context *subflow, *tmp;
struct socket *ssk = NULL;
- struct list_head list;
inet_sk_state_store(sk, TCP_CLOSE);
- spin_lock_bh(&msk->conn_list_lock);
+ lock_sock(sk);
+
if (msk->subflow) {
ssk = msk->subflow;
msk->subflow = NULL;
}
- spin_unlock_bh(&msk->conn_list_lock);
+
if (ssk != NULL) {
pr_debug("subflow=%p", ssk->sk);
sock_release(ssk);
}
- /* this is the only place where we can remove any entry from the
- * conn_list. Additionally acquiring the socket lock here
- * allows for mutual exclusion with mptcp_shutdown().
- */
- lock_sock(sk);
- mptcp_flush_conn_list(sk, &list);
- release_sock(sk);
-
- list_for_each_entry_safe(subflow, tmp, &list, node) {
+ list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) {
pr_debug("conn_list->subflow=%p", subflow);
sock_release(mptcp_subflow_tcp_socket(subflow));
}
+ release_sock(sk);
sock_orphan(sk);
sock_put(sk);
@@ -645,11 +622,14 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
struct sock *new_mptcp_sock;
u64 ack_seq;
+ lock_sock(sk);
+
local_bh_disable();
new_mptcp_sock = sk_clone_lock(sk, GFP_ATOMIC);
if (!new_mptcp_sock) {
*err = -ENOBUFS;
local_bh_enable();
+ release_sock(sk);
kernel_sock_shutdown(new_sock, SHUT_RDWR);
sock_release(new_sock);
return NULL;
@@ -663,10 +643,7 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
msk->token = subflow->token;
pr_debug("token=%u", msk->token);
token_update_accept(new_sock->sk, new_mptcp_sock);
- spin_lock(&msk->conn_list_lock);
- list_add_rcu(&subflow->node, &msk->conn_list);
msk->subflow = NULL;
- spin_unlock(&msk->conn_list_lock);
crypto_key_sha1(msk->remote_key, NULL, &ack_seq);
msk->write_seq = subflow->idsn + 1;
@@ -678,9 +655,11 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,
subflow->tcp_sock = new_sock;
newsk = new_mptcp_sock;
subflow->conn = new_mptcp_sock;
+ list_add(&subflow->node, &msk->conn_list);
bh_unlock_sock(new_mptcp_sock);
local_bh_enable();
inet_sk_state_store(newsk, TCP_ESTABLISHED);
+ release_sock(sk);
} else {
newsk = new_sock->sk;
tcp_sk(newsk)->is_mptcp = 0;
@@ -765,14 +744,33 @@ void mptcp_finish_connect(struct sock *sk, int mp_capable)
if (mp_capable) {
u64 ack_seq;
+ /* sk (new subflow socket) is already locked, but we need
+ * to lock the parent (mptcp) socket now to add the tcp socket
+ * to the subflow list.
+ *
+ * From lockdep point of view, this creates an ABBA type
+ * deadlock: Normally (sendmsg, recvmsg, ..), we lock the mptcp
+ * socket, then acquire a subflow lock.
+ * Here we do the reverse: "subflow lock, then mptcp lock".
+ *
+ * Its alright to do this here, because this subflow is not yet
+ * on the mptcp sockets subflow list.
+ *
+ * IOW, if another CPU has this mptcp socket locked, it cannot
+ * acquire this particular subflow, because subflow->sk isn't
+ * on msk->conn_list.
+ *
+ * This function can be called either from backlog processing
+ * (BH will be enabled) or from softirq, so we need to use BH
+ * locking scheme.
+ */
+ local_bh_disable();
+ bh_lock_sock_nested(sk);
+
msk->remote_key = subflow->remote_key;
msk->local_key = subflow->local_key;
msk->token = subflow->token;
pr_debug("token=%u", msk->token);
- spin_lock_bh(&msk->conn_list_lock);
- list_add_rcu(&subflow->node, &msk->conn_list);
- msk->subflow = NULL;
- spin_unlock_bh(&msk->conn_list_lock);
crypto_key_sha1(msk->remote_key, NULL, &ack_seq);
msk->write_seq = subflow->idsn + 1;
@@ -781,6 +779,11 @@ void mptcp_finish_connect(struct sock *sk, int mp_capable)
subflow->map_seq = ack_seq;
subflow->map_subflow_seq = 1;
subflow->rel_write_seq = 1;
+
+ list_add(&subflow->node, &msk->conn_list);
+ msk->subflow = NULL;
+ bh_unlock_sock(sk);
+ local_bh_enable();
}
inet_sk_state_store(sk, TCP_ESTABLISHED);
}
@@ -899,11 +902,15 @@ static int mptcp_getname(struct socket *sock, struct sockaddr *uaddr,
* is connected and there are multiple subflows is not defined.
* For now just use the first subflow on the list.
*/
+ lock_sock(sock->sk);
ssk = mptcp_subflow_get_ref(msk);
- if (!ssk)
+ if (!ssk) {
+ release_sock(sock->sk);
return -ENOTCONN;
+ }
ret = inet_getname(ssk->sk_socket, uaddr, peer);
+ release_sock(sock->sk);
sock_put(ssk);
return ret;
}
@@ -939,43 +946,23 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
static __poll_t mptcp_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait)
{
- struct subflow_context *subflow, *tmp;
+ struct subflow_context *subflow;
const struct mptcp_sock *msk;
struct sock *sk = sock->sk;
__poll_t ret = 0;
- unsigned int i;
msk = mptcp_sk(sk);
if (msk->subflow)
return tcp_poll(file, msk->subflow, wait);
- i = 0;
- for (;;) {
- int j = 0;
- tmp = NULL;
-
- rcu_read_lock();
- mptcp_for_each_subflow(msk, subflow) {
- if (j < i) {
- j++;
- continue;
- }
-
- if (!mptcp_subflow_hold(subflow))
- continue;
-
- tmp = subflow;
- i++;
- break;
- }
- rcu_read_unlock();
-
- if (!tmp)
- break;
+ lock_sock(sk);
+ mptcp_for_each_subflow(msk, subflow) {
+ struct socket *tcp_sock;
- ret |= tcp_poll(file, mptcp_subflow_tcp_socket(tmp), wait);
- sock_put(mptcp_subflow_tcp_socket(tmp)->sk);
+ tcp_sock = mptcp_subflow_tcp_socket(subflow);
+ ret |= tcp_poll(file, tcp_sock, wait);
}
+ release_sock(sk);
return ret;
}
@@ -994,24 +981,20 @@ static int mptcp_shutdown(struct socket *sock, int how)
}
/* protect against concurrent mptcp_close(), so that nobody can
- * remove entries from the conn list and walking the list breaking
- * the RCU critical section is still safe. We need to release the
- * RCU lock to call the blocking kernel_sock_shutdown() primitive
- * Note: we can't use MPTCP socket lock to protect conn_list changes,
+ * remove entries from the conn list and walking the list
+ * is still safe.
+ *
+ * We can't use MPTCP socket lock to protect conn_list changes,
* as we need to update it from the BH via the mptcp_finish_connect()
*/
lock_sock(sock->sk);
- rcu_read_lock();
- list_for_each_entry_rcu(subflow, &msk->conn_list, node) {
+ mptcp_for_each_subflow(msk, subflow) {
struct socket *tcp_socket;
tcp_socket = mptcp_subflow_tcp_socket(subflow);
- rcu_read_unlock();
pr_debug("conn_list->subflow=%p", subflow);
ret = kernel_sock_shutdown(tcp_socket, how);
- rcu_read_lock();
}
- rcu_read_unlock();
release_sock(sock->sk);
return ret;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 6cfce8499656..d4b2aeb4c70f 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -36,13 +36,12 @@ struct mptcp_sock {
u64 write_seq;
atomic64_t ack_seq;
u32 token;
- spinlock_t conn_list_lock;
struct list_head conn_list;
struct socket *subflow; /* outgoing connect/listener/!mp_capable */
};
#define mptcp_for_each_subflow(__msk, __subflow) \
- list_for_each_entry_rcu(__subflow, &((__msk)->conn_list), node)
+ list_for_each_entry(__subflow, &((__msk)->conn_list), node)
static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)
{
--
2.21.0
2 years, 11 months
Change in ...mptcp_net-next[scripts]: ci:virtme: turn on KASAN and PROVE_LOCKING
by Matthieu Baerts (GerritHub)
Hello Mat Martineau,
I'd like you to do a code review. Please visit
https://review.gerrithub.io/c/multipath-tcp/mptcp_net-next/+/456219
to review the following change.
Change subject: ci:virtme: turn on KASAN and PROVE_LOCKING
......................................................................
ci:virtme: turn on KASAN and PROVE_LOCKING
To debug memory and locking issues. There is a tradeoff in speed, but it
could alert us to problems the selftests alone don't catch.
Suggested-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Change-Id: I54868cc70c8ab994fea5f6926866913c133b108d
---
M ci/virtme.sh
1 file changed, 12 insertions(+), 5 deletions(-)
git pull ssh://review.gerrithub.io:29418/multipath-tcp/mptcp_net-next refs/changes/19/456219/1
--
To view, visit https://review.gerrithub.io/c/multipath-tcp/mptcp_net-next/+/456219
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: multipath-tcp/mptcp_net-next
Gerrit-Branch: scripts
Gerrit-Change-Id: I54868cc70c8ab994fea5f6926866913c133b108d
Gerrit-Change-Number: 456219
Gerrit-PatchSet: 1
Gerrit-Owner: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Gerrit-Reviewer: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Gerrit-MessageType: newchange
2 years, 11 months