[PATCH v2 0/2] mptcp: disallow setting the MPTCP ULP from userspace
by Davide Caratti
with this series we make
setscokopt(..., IPPROTO_TCP, TCP_ULP, "mptcp", sizeof("mptcp"));
return -1 and set errno to -EOPNOPSUPPORT.
this allows attaching MPTCP ULP only to a TCP socket that has been
created through sock_create_kern().
- Patch 1/2 lets subflow_init() fail with -EOPNOTSUPPORT in case users
try to setsockopt(..., TCP_ULP) on a TCP socket that has been created
by a userspace program. I suggest squashing this patch in "mptcp:
Associate MPTCP context with TCP socket".
- Patch 2/2 includes kselftest code. I suggest squashing it with "mptcp:
add basic kselftest for mptcp".
Changes since v1:
- don't redirect the selftest output to /dev/null
- test output depends on the value of 'errno', to avoid false negative
in case kernel is built without CONFIG_MPTCP
Davide Caratti (2):
mptcp: subflow: disallow setsockopt(... TCP_ULP, "mptcp")
selftests: test setsockopt(..., TCP_ULP, "mptcp", ...)
net/mptcp/subflow.c | 7 +++
.../selftests/net/mptcp/mptcp_connect.c | 52 +++++++++++++++++--
.../selftests/net/mptcp/mptcp_connect.sh | 19 +++++++
3 files changed, 75 insertions(+), 3 deletions(-)
--
2.21.0
2 years, 8 months
[PATCH net-next] mptcp: fix 'assignment from incompatible pointer type' warning
by Paolo Abeni
when building vs 32 bits arches pfrag->offset is 16bits , otherwise 32.
Instead of using conditional definitions in multiple places, let's
drop 'poffset' variable altogether.
sendmsg_frag() updates only the pfrag offset, if pfrag is available,
while dfrag offset update is up to the caller.
Squash-to: "mptcp: rework mptcp_sendmsg_frag to accept optional dfrag"
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
net/mptcp/protocol.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b5287bc40c59..46a67f9da9c3 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -179,7 +179,6 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
struct page *page;
u64 *write_seq;
size_t psize;
- int *poffset;
/* use the mptcp page cache so that we can easily move the data
* from one substream to another, but do per subflow memory accounting
@@ -240,7 +239,6 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
offset = dfrag->offset;
frag_truesize = dfrag->overhead;
}
- poffset = &pfrag->offset;
psize = min_t(size_t, pfrag->size - offset, avail_size);
/* Copy to page */
@@ -257,7 +255,6 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
return -ENOMEM;
} else {
offset = dfrag->offset;
- poffset = &dfrag->offset;
psize = min_t(size_t, dfrag->data_len, avail_size);
}
@@ -316,7 +313,8 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
*/
out:
- *poffset += frag_truesize;
+ if (!retransmission)
+ pfrag->offset += frag_truesize;
*write_seq += ret;
mptcp_subflow_ctx(ssk)->rel_write_seq += ret;
@@ -820,6 +818,7 @@ static void mptcp_retransmit(struct work_struct *work)
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RETRANSSEGS);
copied += ret;
dfrag->data_len -= ret;
+ dfrag->offset += ret;
}
if (copied)
tcp_push(ssk, msg.msg_flags, mss_now, tcp_sk(ssk)->nonagle,
--
2.21.0
2 years, 8 months
[GIT] add Co-developed-by tag
by Matthieu Baerts
Hi,
As requested by our new layer Paolo (OK, now it is your turn to be
authorized to hate me!), I just added Co-developed-by tags using a
script [1]. Here is an example of the modification that has been applied
for "mptcp: add basic kselftest for mptcp":
From Matthieu Baerts: Add sysctl test
From Paolo Abeni: Use tc/ethtool to test more skb handling code paths
-Signed-off-by: Florian Westphal <fw(a)strlen.de>
+Co-developed-by: Paolo Abeni <pabeni(a)redhat.com>
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
+Co-developed-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
Signed-off-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
+Co-developed-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
+Co-developed-by: Davide Caratti <dcaratti(a)redhat.com>
Signed-off-by: Davide Caratti <dcaratti(a)redhat.com>
+Signed-off-by: Florian Westphal <fw(a)strlen.de>
I hope I correctly understood the doc[2]. Here are the modifications I did:
- bd7e711d2a32: added Co-developed-by in t/mptcp-Add-MPTCP-to-skb-extensions
- 4af61fb78bb5: added Co-developed-by in
t/tcp-Export-TCP-functions-and-ops-struct
- 1585f0f743cc: added Co-developed-by in t/tcp-clean-ext-on-tx-recycle
- cc24553aa9c8: added Co-developed-by in t/mptcp-Add-MPTCP-socket-stubs
- b40d1790eef7: added Co-developed-by in t/mptcp-Handle-MPTCP-TCP-options
- f96e8008e96c: added Co-developed-by in
t/mptcp-Associate-MPTCP-context-with-TCP-socket
- 23ddd0d11365: added Co-developed-by in
t/mptcp-Create-SUBFLOW-socket-for-incoming-connections
- 862a3b653fbe: added Co-developed-by in
t/mptcp-Add-key-generation-and-token-tree
- bda17a63d162: added Co-developed-by in
t/mptcp-Add-setsockopt-getsockopt-socket-operations
- 2e8e4c744388: added Co-developed-by in
t/mptcp-Write-MPTCP-DSS-headers-to-outgoing-data-packets
- 0c71387abf95: added Co-developed-by in
t/mptcp-Implement-MPTCP-receive-path
- 6e6feed018bf: added Co-developed-by in t/mptcp-Add-path-manager-interface
- f6937fc624d7: added Co-developed-by in
t/mptcp-harmonize-locking-on-all-socket-operations
- 26dbeddb01c4: added Co-developed-by in
t/mptcp-add-basic-kselftest-for-mptcp
- ff04a4e0c349: added Co-developed-by in
t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
- 6f36e3956483: added Co-developed-by in
t/mptcp-Implement-path-manager-interface-commands
- 0e9ca364b916: added Co-developed-by in
t/mptcp-allow-dumping-subflow-context-to-userspace
Next time we have signed-off to add, Co-developed-by will be added
automatically as well.
Cheers,
Matt
[1]
https://github.com/multipath-tcp/mptcp_net-next/blob/scripts/utils/add_co...
[2]
https://elixir.bootlin.com/linux/v5.4-rc2/source/Documentation/process/su...
--
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, 8 months
[PATCH mptcp-next 0/3] mptcp_poll should not block on each subflow
by Florian Westphal
This is a (very simplified) version of the mptcp poll refactoring.
I've removed all of the code from mptcp_should_wake_parent(), the reason
is that Paolo is working on moving more code from mptcp_recvmsg to the
subflow data_ready callback so we can weed out duplicate data before
waking up userspace.
So this only contains the new 'subflow_write_space' callback to notify
mptcp layer when a subflow isn't blocked anymore on write-side, plus the
__tcp_poll split so we can call the tcp layer from mptcp without placing
the subflow socket on a wait list.
Comments welcome.
2 years, 8 months
[Weekly meetings] MoM - 10th of October 2019
by Matthieu Baerts
Hello,
Today, we just had our 70th meeting with Mat (Intel OTC), Christoph
(Apple), Paolo, Florian and Davide (RedHat) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Accepted patches:
- mptcp:diag: prefix exposed items:
- by Matth
- v1 commented by Davide & Florian
- v2 sent
- Squashed "tcp: Expose tcp struct and routine for MPTCP" into
"tcp: Export TCP functions and ops struct":
- proposed by Mat
- Yet another rebase/squash/cleanup proposal:
- by Florian
- Reviewed by Paolo, Mat, Matth
- Summary:
- folds two commits
- fixes the kbuild warnings we got with rfcv2
- gets rid of refcounting in mptcp_subflow_get_ref
- squash "mptcp: Make MPTCP socket block/wakeup ignore
sk_receive_queue" into "MPTCP receive path":
- by Mat
- mptcp: timout delta must be signed:
- by Paolo
- Accepted by Matth
- mptcp: mib: fix sparse warnings:
- by Florian
- Accepted by Matth
- mptcp: fix kbuild warning:
- by Matth
- Accepted by Matth
- PATCH kbuild:
- by Mat
- 3 patches
- Accepted by Matth
Pending patches:
- mptcp: Interim Path Manager:
- by Peter
- v2 sent
- *Waiting for a last review*
- mptcp_poll should not block on each subflow:
- by Florian
- no longer an RFC
- *Waiting for a last review*
- selftests: prepare for mptcp ipv6 support:
- by Florian
- commented by Paolo and Peter (+ who can do what) and Alexander
- *Waiting for a last review*
- mptcp: disallow setting the MPTCP ULP from userspace:
- by Davide
- Commented by Matth, Paolo
- v2 expected
- mptcp: fix warnings reported by checkpatch:
- by Matth
- 5 patches
- *Waiting for review*
- questions about remaining warnings:
- no need to cut if just above 80 chars if hard to read
after the cut
- warnings: memory barrier without comment. Paolo has
proposed a new comment
- MAINTAINERS file
- mptcp: fix 'assignment from incompatible pointer type' warning:
- By Paolo
- *Waiting for review*
Commit message:
- According to the doc, we should have a pair of "Co-developed-by:
<xxx>" immediately followed by "Signed-off-by: <xxx>"
- Then a "Signed-off-by" for the one sending the patches
- checkpatch.pl will not complain if "Co-developed-by: <xxx>" is
not added, only if the following signed-off is not OK
-
https://elixir.bootlin.com/linux/v5.4-rc2/source/Documentation/process/su...
- > Checkpatch has "Check Co-developed-by: immediately followed by
Signed-off-by: with same name and email"
- *@Matth* can look at that
Remaining items for the initial submission:
- IPv6 support:
- Peter is working on it
- Simple test cases working, will post an RFC patch soon
- MPTCP v1 support:
- To be done
- Do we need also the support in mptcp.org (out-of-tree)
- patches that had been shared were working, at least v1 → v1
- DATA_FIN:
- Mat is working on it
- working fine with a single subflow, WIP for multiple ones
- Mat hopes to prepare a RFC patch soon
- It seems there are work to do on MPTCP shutdown side.
- Shared recv window:
- we at least need protections again "deadlocks" if we accept
having multiple subflows
- work to be done, e.g. drop out of order MPTCP data
- Active backup support:
- Paolo is working on it
- Florian plans to work on a basic scheduler.
- Limit subflow ULP visibility to kernel space:
- Davide is working on it
- should be closed soon
- optimisation of options in TCP "struct mptcp_options_received":
- work to be done
- MP_FAST_CLOSE, seems not implemented:
- Do we want to add it now?
- We might be able to live without it *for the moment*
- implementation is easier with MPTCPv1
- worst case if we don't support it:
- one end with MPTCPv1 but using the old method: sending an
ACK with FC
- the other end with MPTCPv1 upstream: we don't react to
this ACK
- RST not sent
- but initiator should anyway drop the connections
RFCv3:
- sent by Mat yesterday (20191009)
- no feedback yet
KBuild:
- possible to cc warnings/errors to the ML?
- Mat will check if:
- the system can monitor the mailing
- the system can continue to monitor Mat's repo but send
messages to our ML (not only the people listed in the commit message)
Patent question:
- By Paolo:
- It appears its best that the implementation submitted for
mainline kernel inclusion of the detail that appears to be the subject
of the patent be done with code authored by you as and Apple employee.
- It should be apparent from the written records (e.g. mailing
list archives) that you've consulted with others at Apple who are aware
of the relationship between the patent and the implementation.
- Failing that, a Signed-off-by from you -- using your
@apple.com address on the patch implementing the relevant V1 bits.
- Signed-off-by from Christoph is enough?:
- the best would be to have Christoph writing the code covered
by the patent
CI:
- now checking that each commit can compile
selftests:
- new functionality tests?:
- diag, mib, etc.
- packetdrill:
- 2 lines to add the new socket support
- Davide will have a look at this to know what is possible to
do with the existing implementation
- (ideally we should re-implement MPTCP support on top of the
last version of packetdrill)
lwn:
- https://lwn.net/Articles/800501/
- now public
for the next chunk of patches:
- we hope to have feedback from David Miller
- could be good to send a new RFC of the second chunk later
- for IPv6, we could implement the workaround proposed by Florian
last week
- (also hard to comply with the other request: smaller patch-set)
RFC6824bis:
- progressing
- there were new comments from IESG
- For the moment at the RFC Editor state, checking typo
- https://datatracker.ietf.org/doc/draft-ietf-mptcp-rfc6824bis/
- hard to give a date
Next meeting:
- We propose to have it next Thursday, the 17th of October.
- Usual time: 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20191017
Feel free to comment on these points and propose new ones for the next
meeting!
Talk to you next week,
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, 8 months
Checkpatch: questions about what is reported
by Matthieu Baerts
Hi,
This afternoon, I was quickly looking at the output of checkpatch.pl for
each patch. Everything was already OK for the 10 first ones we sent to
netdev.
I just sent the different patches I have, nothing important but we have
to fix these warnings one day I guess :)
I also have a few questions:
mptcp: Implement MPTCP receive path
===================================
I got these warnings:
WARNING: line over 80 characters
#134: FILE: net/mptcp/options.c:104:
+ mp_opt->data_fin = (mp_opt->dss_flags &
MPTCP_DSS_DATA_FIN) != 0;
WARNING: memory barrier without comment
#470: FILE: net/mptcp/protocol.c:327:
+ smp_mb__before_atomic();
WARNING: memory barrier without comment
#472: FILE: net/mptcp/protocol.c:329:
+ smp_mb__after_atomic();
WARNING: memory barrier without comment
#530: FILE: net/mptcp/protocol.c:397:
+ smp_mb__before_atomic();
WARNING: memory barrier without comment
#532: FILE: net/mptcp/protocol.c:399:
+ smp_mb__after_atomic();
WARNING: memory barrier without comment
#838: FILE: net/mptcp/subflow.c:172:
+ smp_mb__before_atomic();
WARNING: memory barrier without comment
#840: FILE: net/mptcp/subflow.c:174:
+ smp_mb__after_atomic();
For the first one, maybe clearer to keep the line like this even if it
has more than 80 chars (81 in fact...).
But for the rest, should we add comments?
General
=======
At some points, we will have to fix this one:
WARNING: added, moved or deleted file(s), does MAINTAINERS need
updating?
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, 8 months
[PATCH kbuild] mptcp: mptcp_timer_pending() can be static
by Mat Martineau
Fixes: b364de141961 ("mptcp: introduce MPTCP retransmission timer")
Signed-off-by: kbuild test robot <lkp(a)intel.com>
---
Forwarding additional kbuild suggestions that were not sent to everyone.
protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b94769f95ccc7..acbcb150cdb5a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -29,7 +29,7 @@ static void mptcp_set_timeout(const struct sock *sk, const struct sock *ssk)
mptcp_sk(sk)->timer_ival = tout > 0 ? tout : TCP_RTO_MIN;
}
-bool mptcp_timer_pending(struct sock *sk)
+static bool mptcp_timer_pending(struct sock *sk)
{
return timer_pending(&inet_csk(sk)->icsk_retransmit_timer);
}
2 years, 8 months
[PATCH kbuild] mptcp: mptcp_page_frag_refill() can be static
by Mat Martineau
Fixes: c5a81c3da8f6 ("mptcp: queue data for mptcp level retransmission")
Signed-off-by: kbuild test robot <lkp(a)intel.com>
---
Forwarding additional kbuild suggestions that were not sent to everyone.
protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b49316178994c..986fc441dbbb7 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -96,7 +96,7 @@ static void mptcp_clean_una(struct sock *sk)
/* ensure we get enough memory for the frag hdr, beyond some minimal amount of
* data
*/
-bool mptcp_page_frag_refill(struct sock *sk, struct page_frag *pfrag)
+static bool mptcp_page_frag_refill(struct sock *sk, struct page_frag *pfrag)
{
if (likely(skb_page_frag_refill(32U + sizeof(struct mptcp_data_frag),
pfrag, sk->sk_allocation)))
2 years, 8 months
[PATCH kbuild] mptcp: update_una() can be static
by Mat Martineau
Fixes: e0c0e8d7b6cd ("mptcp: update per unacked sequence on pkt reception")
Signed-off-by: kbuild test robot <lkp(a)intel.com>
---
Forwarding additional kbuild suggestions that were not sent to everyone.
options.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index be05d99e6bfa5..ef53f5ddb7325 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -550,7 +550,7 @@ static u64 expand_ack(u64 old_ack, u64 cur_ack, bool use_64bit)
return cur_ack;
}
-void update_una(struct mptcp_sock *msk, struct mptcp_options_received *mp_opt)
+static void update_una(struct mptcp_sock *msk, struct mptcp_options_received *mp_opt)
{
u64 new_snd_una, snd_una, old_snd_una = atomic64_read(&msk->snd_una);
2 years, 8 months
[PATCH 0/2] mptcp: disallow setting the MPTCP ULP from userspace
by Davide Caratti
with this series we make
setscokopt(..., IPPROTO_TCP, TCP_ULP, "mptcp", sizeof("mptcp"));
return -1 and set errno to -EOPNOPSUPPORT.
this allows attaching MPTCP ULP only to a TCP socket that has been
created through sock_create_kern().
- Patch 1/2 lets subflow_init() fail with -EOPNOTSUPPORT in case users
try to setsockopt(..., TCP_ULP) on a TCP socket that has been created
by a userspace program. I suggest squashing this patch in "mptcp:
Associate MPTCP context with TCP socket".
- Patch 2/2 includes kselftest code. I suggest squashing it with "mptcp:
add basic kselftest for mptcp".*** SUBJECT HERE ***
Davide Caratti (2):
mptcp: subflow: disallow setsockopt(... TCP_ULP, "mptcp")
selftests: test setsockopt(..., TCP_ULP, "mptcp", ...)
net/mptcp/subflow.c | 7 +++
.../selftests/net/mptcp/mptcp_connect.c | 49 +++++++++++++++++--
.../selftests/net/mptcp/mptcp_connect.sh | 19 +++++++
3 files changed, 72 insertions(+), 3 deletions(-)
--
2.21.0
2 years, 8 months