[PATCH] Squash-to: "mptcp: recvmsg() can drain data from multiple subflows"
by Paolo Abeni
Fix reverse X-mas tree variable declaration.
I guess we don't want to mess that right now ;)
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
net/mptcp/protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index c33639b38ff2..13f3a202662a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -110,8 +110,8 @@ static bool mptcp_ext_cache_refill(struct mptcp_sock *msk)
static struct sock *mptcp_subflow_recv_lookup(const struct mptcp_sock *msk)
{
- struct sock *sk = (struct sock *)msk;
struct mptcp_subflow_context *subflow;
+ struct sock *sk = (struct sock *)msk;
sock_owned_by_me(sk);
--
2.21.0
2 years, 6 months
[PATCH] Squash-to: "mptcp: Handle MP_CAPABLE options for outgoing connections"
by Paolo Abeni
mptcp_established_options() definition will be changed in a couple of patches,
let's introduce early it's final form
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
include/net/mptcp.h | 5 ++++-
net/ipv4/tcp_output.c | 9 ++++-----
net/mptcp/options.c | 3 ++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index d7af03848f5a..588abcb76da3 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -55,7 +55,8 @@ bool mptcp_syn_options(struct sock *sk, unsigned int *size,
void mptcp_rcv_synsent(struct sock *sk);
bool mptcp_synack_options(const struct request_sock *req, unsigned int *size,
struct mptcp_out_options *opts);
-bool mptcp_established_options(struct sock *sk, unsigned int *size,
+bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
+ unsigned int *size, unsigned int remaining,
struct mptcp_out_options *opts);
void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts);
@@ -104,7 +105,9 @@ static inline bool mptcp_synack_options(const struct request_sock *req,
}
static inline bool mptcp_established_options(struct sock *sk,
+ struct sk_buff *skb,
unsigned int *size,
+ unsigned int remaining,
struct mptcp_out_options *opts)
{
return false;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index a4bf1197f577..d123d67026d5 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -798,11 +798,10 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb
unsigned int remaining = MAX_TCP_OPTION_SPACE - size;
unsigned int opt_size = 0;
- if (mptcp_established_options(sk, &opt_size, &opts->mptcp)) {
- if (remaining >= opt_size) {
- opts->options |= OPTION_MPTCP;
- size += opt_size;
- }
+ if (mptcp_established_options(sk, skb, &opt_size, remaining,
+ &opts->mptcp)) {
+ opts->options |= OPTION_MPTCP;
+ size += opt_size;
}
}
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 26203dfb6be6..89aef0d0beb1 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -196,7 +196,8 @@ void mptcp_rcv_synsent(struct sock *sk)
}
}
-bool mptcp_established_options(struct sock *sk, unsigned int *size,
+bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
+ unsigned int *size, unsigned int remaining,
struct mptcp_out_options *opts)
{
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
--
2.21.0
2 years, 6 months
[PATCH] Squash-to: "mptcp: Add key generation and token tree"
by Paolo Abeni
include net/tcp.h instead of linux/tcp.h
We will switch to the latter header later in part 4, but
in between, and after "mptcp: new sysctl to control the activation per NS"
we get some sparse warning due to missing ipv6-related fuction declaration.
Alternativelly we add an include for "net/tcp.h" in ctrl.c in patch
"mptcp: new sysctl to control the activation per NS".
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
net/mptcp/protocol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 4cf9620d19ec..5f43fa0275c0 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -8,7 +8,7 @@
#define __MPTCP_PROTOCOL_H
#include <linux/random.h>
-#include <linux/tcp.h>
+#include <net/tcp.h>
#include <net/inet_connection_sock.h>
#define MPTCP_SUPPORTED_VERSION 0
--
2.21.0
2 years, 6 months
[PATCH] Squash-to: "mptcp: Implement MPTCP receive path"
by Paolo Abeni
drop duplicate line indroduced by the 'Squash-to' commit.
Note: this will cause some conflict in v1 patches. Resolution
is trivial, howver the patches must be rebased on top of this
one.
---
net/mptcp/protocol.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1ede654057ba..5b73a1ae0da9 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -559,8 +559,6 @@ void mptcp_finish_connect(struct sock *ssk)
subflow->map_subflow_seq = 1;
subflow->rel_write_seq = 1;
- subflow->rel_write_seq = 1;
-
/* the socket is not connected yet, no msk/subflow ops can access/race
* accessing the field below
*/
--
2.21.0
2 years, 6 months
more performance figures
by Paolo Abeni
Hi all,
I was finally able to collect some performance figures on a MPTCP non
debug build (using a plain config from a somewhat notorious distro)
TCP MPTCP
ab 86529.19 71504.38 (higher is better)
(100 concurrent connections)
ab 12076.22 11983.72 (higher is better)
(10000 concurrent connections)
netperf 41895.41 53244.68 (higher is better!!!)
'ab' is apache-bench, vs ngnix web server.
not sure why on plain stream transfer MPTCP apparently perform better
than plain TCP. This is for sure a test artifact, but still:
- at least we don't have tragic delta
- it's nice ;)
On a more serious side, the mesurable delta will a little number of
connection hints at the room for improvement we currently have in
mptcp_{stream_}accept().
Cheers,
Paolo
2 years, 6 months
[PATCH net-next v2 00/11] Multipath TCP: Prerequisites
by Mat Martineau
v2 changes: sk_pacing_shift left as a regular struct member, and modified SACK
space check based on recent -net fix.
The MPTCP upstreaming community has been collaborating on an
upstreamable MPTCP implementation that complies with RFC 8684. A minimal
set of features to comply with the specification involves a sizeable set
of code changes, so David requested that we split this work in to
multiple, smaller patch sets to build up MPTCP infrastructure.
The minimal MPTCP feature set we are proposing for review in the v5.6
timeframe begins with these three parts:
Part 1 (this patch set): MPTCP prerequisites. Introduce some MPTCP
definitions, additional ULP and skb extension features, TCP option space
checking, and a few exported symbols.
Part 2: Single subflow implementation and self tests.
Part 3: Switch from MPTCP v0 (RFC 6824) to MPTCP v1 (new RFC 8684,
publication expected in the next few days).
We plan to send those over the next week. Additional patches for
multiple subflow support, path management, active backup, and other
features are in the pipeline for submission after making progress with
the above reviews.
Clone/fetch:
https://github.com/multipath-tcp/mptcp_net-next.git (tag: netdev-v2-part1)
Browse:
https://github.com/multipath-tcp/mptcp_net-next/tree/netdev-v2-part1
Thank you for your review. You can find us at mptcp(a)lists.01.org and
https://is.gd/mptcp_upstream
Mat Martineau (9):
net: Make sock protocol value checks more specific
sock: Make sk_protocol a 16-bit value
tcp: Define IPPROTO_MPTCP
tcp: Add MPTCP option number
tcp, ulp: Add clone operation to tcp_ulp_ops
mptcp: Add MPTCP to skb extensions
tcp: Prevent coalesce/collapse when skb has MPTCP extensions
tcp: Export TCP functions and ops struct
tcp: Check for filled TCP option space before SACK
Paolo Abeni (2):
tcp: clean ext on tx recycle
skb: add helpers to allocate ext independently from sk_buff
MAINTAINERS | 10 ++++++++
include/linux/skbuff.h | 6 +++++
include/net/mptcp.h | 43 +++++++++++++++++++++++++++++++++
include/net/sock.h | 6 ++---
include/net/tcp.h | 22 +++++++++++++++++
include/trace/events/sock.h | 5 ++--
include/uapi/linux/in.h | 2 ++
net/ax25/af_ax25.c | 2 +-
net/core/skbuff.c | 42 ++++++++++++++++++++++++++++++--
net/decnet/af_decnet.c | 2 +-
net/ipv4/inet_connection_sock.c | 2 ++
net/ipv4/tcp.c | 6 ++---
net/ipv4/tcp_input.c | 10 ++++++--
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv4/tcp_output.c | 12 ++++++---
net/ipv4/tcp_ulp.c | 12 +++++++++
net/ipv6/tcp_ipv6.c | 6 ++---
tools/include/uapi/linux/in.h | 2 ++
18 files changed, 170 insertions(+), 22 deletions(-)
create mode 100644 include/net/mptcp.h
--
2.24.1
2 years, 6 months
[PATCH] Squash-to: "sock: Make sk_protocol a 16-bit value"
by Matthieu Baerts
move sk_type to a separate field to:
- avoid extra operations to fetch sk->sk_type on some arches (Eric)
- allow compilers to emit better code to access/manipulate native types
compared to bitfields. (Paolo)
Suggested-by: Eric Dumazet <edumazet(a)google.com>
Suggested-by: Paolo Abeni <pabeni(a)redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
Notes:
to be squashed in "sock: Make sk_protocol a 16-bit value"
include/net/sock.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 0930f46c600c..b93cadba1a3b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -451,13 +451,13 @@ struct sock {
#define SK_FL_TYPE_MASK 0xffff0000
#endif
- unsigned int sk_padding : 1,
+ u8 sk_padding : 1,
sk_kern_sock : 1,
sk_no_check_tx : 1,
sk_no_check_rx : 1,
- sk_userlocks : 4,
- sk_type : 16;
+ sk_userlocks : 4;
u8 sk_pacing_shift;
+ u16 sk_type;
u16 sk_protocol;
u16 sk_gso_max_segs;
unsigned long sk_lingertime;
--
2.24.0
2 years, 6 months
[PATCH] Squash-to: "mptcp: cope with later TCP fallback"
by Paolo Abeni
Clean subflow->conn, under the ssk socket lock, and make
__mptcp_tcp_fallback() less unreadable
---
This should address Mat's concern on the fallback code path
---
net/mptcp/protocol.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2b20f4d3e179..9e288559e228 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -49,7 +49,17 @@ static struct socket *__mptcp_fallback_to_tcp(struct mptcp_sock *msk,
sock->sk = NULL;
/* socket is now TCP */
+ lock_sock(ssk);
sock_graft(ssk, sock);
+ if (subflow->conn) {
+ /* Clearing the 'conn' field will make the ULP-ovverriden
+ * oops behaving alike plain TCP ones.
+ * Note: we can't release the ULP data on a live socket.
+ */
+ sock_put(subflow->conn);
+ subflow->conn = NULL;
+ }
+ release_sock(ssk);
sock->ops = sk->sk_family == AF_INET6 ? &inet6_stream_ops :
&inet_stream_ops;
@@ -76,8 +86,8 @@ static bool __mptcp_needs_tcp_fallback(const struct mptcp_sock *msk)
return msk->first && !tcp_sk(msk->first)->is_mptcp;
}
-/* if the mp_capable handshake is failed, return a tcp socket
- * return it.
+/* if the mp_capable handshake is failed, fallback msk to plain tcp,
+ * release the socket lock and returns a reference to the now TCP socket
* Otherwise returns NULL
*/
static struct socket *__mptcp_tcp_fallback(struct mptcp_sock *msk)
--
2.21.0
2 years, 6 months
[PATCH] Squash-to: "sock: Make sk_protocol a 16-bit value"
by Paolo Abeni
move sk_pacing_shift to a separate field, so we can READ_ONCE() it.
Binary layout of struct sock dose not change (except for the
sk_pacing_shift position)
---
This addresses Eric's upstream feedback on v1
---
include/net/sock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 9dd225f62012..0930f46c600c 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -456,8 +456,8 @@ struct sock {
sk_no_check_tx : 1,
sk_no_check_rx : 1,
sk_userlocks : 4,
- sk_pacing_shift : 8,
sk_type : 16;
+ u8 sk_pacing_shift;
u16 sk_protocol;
u16 sk_gso_max_segs;
unsigned long sk_lingertime;
--
2.21.0
2 years, 6 months