[PATCH] mptcp: propagate sendbuf setting to subflow on fallback
by Florian Westphal
For normal mptcp subflows we do not need to propagate the sndbuf size
because all skbs to be transmitted via mptcp get charged to the mptcp
send buffer, i.e. mptcp sndbuf will limit the amount of data handed to
the subflow sockets.
However, when we enter fallback mode, the mptcp xmit function is cut
short and no mptcp-level socket accouting takes place.
Therefore for the sndbuf limit to have any effect we need to set it
on the fallback socket.
Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
I'll pass this to netdev@ unless there are objections.
net/mptcp/protocol.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8d6ab825bdab..ddfd02ab6e31 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -57,15 +57,27 @@ static bool __mptcp_needs_tcp_fallback(const struct mptcp_sock *msk)
return msk->first && !sk_is_mptcp(msk->first);
}
+static void sync_sndbuf(const struct sock *msk, struct sock *ssk)
+{
+ if (unlikely((msk->sk_userlocks & SOCK_SNDBUF_LOCK) &&
+ ssk->sk_sndbuf != msk->sk_sndbuf)) {
+ ssk->sk_userlocks |= SOCK_SNDBUF_LOCK;
+ WRITE_ONCE(ssk->sk_sndbuf, msk->sk_sndbuf);
+ }
+}
+
static struct socket *__mptcp_tcp_fallback(struct mptcp_sock *msk)
{
- sock_owned_by_me((const struct sock *)msk);
+ struct sock *sk = (struct sock *)msk;
+
+ sock_owned_by_me(sk);
if (likely(!__mptcp_needs_tcp_fallback(msk)))
return NULL;
if (msk->subflow) {
- release_sock((struct sock *)msk);
+ sync_sndbuf(sk, msk->subflow->sk);
+ release_sock(sk);
return msk->subflow;
}
--
2.24.1
2 years, 3 months
[GIT] Sync with net-next on 20200313: conflicts
by Matthieu Baerts
Hello,
Recently, one MPTCP-related patch from Davide has been applied in
'net-next' repo:
- 767d3ded5fb8 (net: mptcp: don't hang before sending 'MP capable with
data')
This created conflicts:
- 21a8666f4683: conflict in t/mptcp-Add-path-manager-interface
- c1aa2cd27a83: conflict in
t/mptcp-update-per-unacked-sequence-on-pkt-reception
I hope they have been resolved as expected.
Tests are all green and the "export" branch has been updated.
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, 3 months
[Weekly meetings] MoM - 12th of March 2020
by Matthieu Baerts
Hello,
Last Thursday, we had our 90th meeting with Mat, Peter and Ossama (Intel
OTC), Paolo, Davide and Florian (RedHat) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Accepted patches:
- The list of accepted patches can be seen on PatchWork:
https://patchwork.ozlabs.org/project/mptcp/list/?state=3
net-next: (by Paolo and Davide)
1250410: Awaiting Upstream: [net-next,1/2] mptcp: create msk early
1250408: Awaiting Upstream: [net-next,2/2] mptcp: drop unneeded checks
1253142: Applied: [net-next] net: mptcp: don't hang before sending 'MP
capable with data'
our repo: (by Paolo)
1249653 [v2,12/12] Squash-to: "selftests: add test-cases for MPTCP MP_J
1249654 [v2,11/12] Squash-to: "selftests: add PM netlink functional tes
1249648 [v2,10/12] Squash-to: "mptcp: add netlink based PM"
1249656 [v2,9/12] Squash-to: "subflow: place further subflows on new 'j
1249657 [v2,8/12] Squash-to: "mptcp: increment MIB counters in a few pl
1249650 [v2,7/12] Squash-to: "mptcp: add MIB counter infrastructure"
1249647 [v2,6/12] Squash-to: "mptcp: allow dumping subflow context to u
1249655 [v2,5/12] Squash-to: "mptcp: Implement path manager interface c
1249651 [v2,4/12] Squash-to: "mptcp: Add handling of outgoing MP_JOIN r
1249638 [v2,3/12] Squash-to: "mptcp: Add handling of incoming MP_JOIN r
1249652 [v2,2/12] Squash-to: "mptcp: Add ADD_ADDR handling"
1249649 [v2,1/12] mptcp: rename fourth ack field
1252338 Squash-to: "mptcp: add netlink based PM"
Pending patches:
- The list of pending patches can be seen on PatchWork:
https://patchwork.ozlabs.org/project/mptcp/list/?state=*
- By Matthieu, Peter, Florian, Paolo
1196109: RFC: [10/10,RFC] selftests:mptcp: decrease timeout to 100 sec:
- still the bug?
1245636: Needs Review / ACK: mptcp: re-check dsn before reading from
subflow:
- Mat is going to look at it
1253090: New: [v4,1/5] mptcp: Re-factor mptcp_crypto_hmac_sha()
1253086: New: [v4,2/5] mptcp: v1 ADD_ADDR changes: options and parsing
1253087: New: [v4,3/5] mptcp: v1 ADD_ADDR changes: add_addr_hmac_valid
1253088: New: [v4,4/5] mptcp: v1 ADD_ADDR changes: add subflow_generate_
1253091: New: [v4,5/5] mptcp: v1 ADD_ADDR changes: use subflow_generate_
- Paolo looked at it, a minor comment → can be applied after
"mptcp: simplify mptcp_accept()"
1253668: New: mptcp: propagate sendbuf setting to subflow on fallback
1253672: New: mptcp: copy mptcp receive buffer setting to subflow
1253677: New: tcp: mptcp: use mptcp receive buffer space to select rcv
window:
- to review
FYI: Current Roadmap: (part 3 has been updated)
- Part 3 (next merge window):
- PM: [Done]
- locking [Done]
- basic → netlink support [Done]
- MP_JOIN [Done]
- ADD_ADDR for MPTCP v1 [In review]
- clean the current patches [TODO]
- squash the current patches [TODO]:
- "subflow: place further subflows on new 'join_list'"
- need to make sure we continue to support the protocol →
workaround for shared received windows [In progress]
- PM basic [Done]
- fix sender ID in MP_JOIN [Done]
- Part 4 (to fully support MPTCP):
- Shared recv window (full support)
- IPv6 - IPv4 mapped support
- not dropping MPTCP options (ADD_ADDR, etc.)
- FAST_CLOSE
- full MPTCP v1 support (reliable add_addr, etc.)
- after a few attempts of failed MPTCP, we fallback to TCP
(like TFO is doing)
- PM server (more advanced)
- reduce locks when mptcp_stream_accept (currently 3 locks) but
we might need to add an helper in inet API
- Full DATA_FIN support [WIP]:
- could be nice to have it: if ready
- Active backup support [WIP]
- ADD_ADDR for MPTCPv1: echo bit
- Opti in TCP option structures (unions) [to be rebased]
- Part 5 (extra needed for prod):
- opti/perfs
- TFO
- PM netlink
- PM bpf
- Scheduler bpf
- syncookies
- [gs]etsockopt per subflow
- notify the userspace when a subflow is added/removed → cmsg
Part 3 remaining stuff:
- Review commit messages:
- needed for the next merge window: not urgent
- format-patch is maybe already adding the last signed-off
- but Matth can also add them if we know who is going to send them
- there are also a couple of patches at the end of the series we
will have to rebase/squash:
- TODO
- at least: "subflow: place further subflows on new 'join_list'"
- Matth can squash it if he gets instruction
- Or we can use a branch to recreate the topgit tree: but then
please notify Matth before starting the work to free the export branch
- ADD_ADDR for MPTCPv1:
- Peter is looking at that
- Patches are in
- Shared received windows:
- Florian is looking at that indirectly
- is there anything we want to add for part 3?:
- it seems we can send what we have for the moment and
improve it in "part 4".
When to send it?:
- Send it next week after the meeting
- TODO list:
- Review commit messages
- squash "subflow: place further subflows on new 'join_list'"
- ADD_ADDR for MPTCPv1
- intensive tests in a loop next week
Extra tests:
- news about Syzkaller? (Christoph):
- Christoph is looking at fuzzing the Netlink API
- it seems more work is needed to guide Syzkaller to do more
than only the connection.
- there is a question on the ML: if you have experience with
Syzkaller, it can be helpful
- new about Intel's kbuild? (Mat):
- It seems it is building more than "export", e.g.
t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
- the TopGit can be unstable when updating it: one patch is
applied then pushed, then the next one, etc.
- it seems there are other options to restrict kbuild to
validate only the export branch. *Mat* is going to look at that.
- packetdrill (Davide):
- testing now MP_CAPABLE + Data
- and found an issue, see the patch on net-next.
CI:
- mptcp_connect.sh -m mmap → not yet (still the bug)
- mptcp_connect.sh: more to run? e.g. -R, -S?
- TODO, Matth: mptcp_connect.sh with -R ; -S
Userspace PM:
- we need a tool to interact from the userspace with the kernel
- mptcpd: Ossama is adding support to it
- iproute2 is the usual tool to interact with the kernel for the
network part
- iproute2 support should be added for the current PM ("basic" usage)
- once the PM has integrated what is in mptcp.org (per connection
management), that will be only managed from mptcpd ("advanced" usage)
Next meeting:
- We propose to have the next meeting on Thursday, the 19th of March.
- /!\ *NOT* the Usual time: 16:00 UTC (9am PDT, 5pm CET) /!\
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20200319
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, 3 months
[PATCH v2 0/12] pm netlink: followup and fixes
by Paolo Abeni
This series bring some fixes and improvement related to the PM netlink,
specifically:
- renames 4th_ack subflow field to 'fully_established':
this is hopefully more accurate
- implements support to enforce the maximum number of subflows per msk
- implements MP_JOIN 3rd ack retransmission and 4th ack delivery:
this [ab]use the TCP delack timer. I personally think the idea is nice and
avoids changes to the core TCP stack, but I guess it could be disputed
- more accurare 'fully established' accounting as per RFC
- drop the msk level 'fully_established' field, as we can use the first subflow
status without additional locking instead. This simplify core PM event
handling
- adds more MP_JOIN related mib counters
- update the PM netlink to enforce a configurable maximum number of subflows
per msk
- extend the pm netlink self-tests to check the above APIs
- uses amost all the above to fix the currently disable mp join self-tests and
re-enable them
Note: mp join self tests are still unstable, e.g. can fail randomly, due to an
old race between mptcp_token_update_accept() and mptcp_token_get_sock(): e.g.
a client may legitly try to create a subflow after that the first one is fully
established but before the server has accepted the initial socket:
mptcp_token_get_sock() will fail and MP_JOIN will fail too, incrementing
MPTCP_MIB_JOINNOTOKEN.
I think the above should be addressed in a separate series - otherwise this one
will be too big.
The up2date branch for this series (v2) is available here:
https://github.com/pabeni/mptcp/tree/mptcp_net-next_part3_7
v1 -> v2:
- comments and readability changes in patch 04
include/uapi/linux/mptcp.h | 23 ++-
net/mptcp/diag.c | 4
net/mptcp/mib.c | 3
net/mptcp/mib.h | 3
net/mptcp/options.c | 141 +++++++++++++++++-------
net/mptcp/pm.c | 35 ++++-
net/mptcp/pm_netlink.c | 93 +++++++++++----
net/mptcp/protocol.c | 23 ++-
net/mptcp/protocol.h | 8 +
net/mptcp/subflow.c | 9 +
tools/testing/selftests/net/mptcp/mptcp_join.sh | 100 +++++++++++++----
tools/testing/selftests/net/mptcp/pm_netlink.sh | 17 ++
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 46 ++++---
13 files changed, 364 insertions(+), 141 deletions(-)
2 years, 3 months
[PATCH net-next] net: mptcp: don't hang before sending 'MP capable with data'
by Davide Caratti
the following packetdrill script
socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
> S 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8,mpcapable v1 flags[flag_h] nokey>
< S. 0:0(0) ack 1 win 65535 <mss 1460,sackOK,TS val 700 ecr 100,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey=2]>
> . 1:1(0) ack 1 win 256 <nop, nop, TS val 100 ecr 700,mpcapable v1 flags[flag_h] key[ckey,skey]>
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
fcntl(3, F_SETFL, O_RDWR) = 0
write(3, ..., 1000) = 1000
doesn't transmit 1KB data packet after a successful three-way-handshake,
using mp_capable with data as required by protocol v1, and write() hangs
forever:
PID: 973 TASK: ffff97dd399cae80 CPU: 1 COMMAND: "packetdrill"
#0 [ffffa9b94062fb78] __schedule at ffffffff9c90a000
#1 [ffffa9b94062fc08] schedule at ffffffff9c90a4a0
#2 [ffffa9b94062fc18] schedule_timeout at ffffffff9c90e00d
#3 [ffffa9b94062fc90] wait_woken at ffffffff9c120184
#4 [ffffa9b94062fcb0] sk_stream_wait_connect at ffffffff9c75b064
#5 [ffffa9b94062fd20] mptcp_sendmsg at ffffffff9c8e801c
#6 [ffffa9b94062fdc0] sock_sendmsg at ffffffff9c747324
#7 [ffffa9b94062fdd8] sock_write_iter at ffffffff9c7473c7
#8 [ffffa9b94062fe48] new_sync_write at ffffffff9c302976
#9 [ffffa9b94062fed0] vfs_write at ffffffff9c305685
#10 [ffffa9b94062ff00] ksys_write at ffffffff9c305985
#11 [ffffa9b94062ff38] do_syscall_64 at ffffffff9c004475
#12 [ffffa9b94062ff50] entry_SYSCALL_64_after_hwframe at ffffffff9ca0008c
RIP: 00007f959407eaf7 RSP: 00007ffe9e95a910 RFLAGS: 00000293
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007f959407eaf7
RDX: 00000000000003e8 RSI: 0000000001785fe0 RDI: 0000000000000008
RBP: 0000000001785fe0 R8: 0000000000000000 R9: 0000000000000003
R10: 0000000000000007 R11: 0000000000000293 R12: 00000000000003e8
R13: 00007ffe9e95ae30 R14: 0000000000000000 R15: 0000000000000000
ORIG_RAX: 0000000000000001 CS: 0033 SS: 002b
Fix it ensuring that socket state is TCP_ESTABLISHED on reception of the
third ack.
Fixes: 1954b86016cf ("mptcp: Check connection state before attempting send")
Suggested-by: Paolo Abeni <pabeni(a)redhat.com>
Signed-off-by: Davide Caratti <dcaratti(a)redhat.com>
---
net/mptcp/protocol.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 95007e433109..c0cef07f4382 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1049,6 +1049,10 @@ void mptcp_finish_connect(struct sock *ssk)
WRITE_ONCE(msk->write_seq, subflow->idsn + 1);
WRITE_ONCE(msk->ack_seq, ack_seq);
WRITE_ONCE(msk->can_ack, 1);
+ if (inet_sk_state_load(sk) != TCP_ESTABLISHED) {
+ inet_sk_state_store(sk, TCP_ESTABLISHED);
+ sk->sk_state_change(sk);
+ }
}
static void mptcp_sock_graft(struct sock *sk, struct socket *parent)
--
2.24.1
2 years, 3 months
[mptcp:t/mptcp-Implement-path-manager-interface-commands 2/5] net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
by kbuild test robot
tree: https://github.com/multipath-tcp/mptcp_net-next.git t/mptcp-Implement-path-manager-interface-commands
head: 90aea70d750f21826580faf6aa7a9e8d99d1f245
commit: 02ebff8a2889f87e129febe6fddc73f45d516317 [2/5] tgupdate: merge t/mptcp-Implement-path-manager-interface-commands base into t/mptcp-Implement-path-manager-interface-commands
config: xtensa-randconfig-a001-20200311 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 02ebff8a2889f87e129febe6fddc73f45d516317
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Note: the mptcp/t/mptcp-Implement-path-manager-interface-commands HEAD 90aea70d750f21826580faf6aa7a9e8d99d1f245 builds fine.
It only hurts bisectibility.
All error/warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:11,
from net/mptcp/pm.c:6:
net/mptcp/pm.c: In function 'mptcp_pm_fully_established':
>> net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
73 | if (READ_ONCE(pm->fully_established))
| ^~
include/linux/compiler.h:261:17: note: in definition of macro '__READ_ONCE'
261 | union { typeof(x) __val; char __c[1]; } __u; \
| ^
>> net/mptcp/pm.c:73:6: note: in expansion of macro 'READ_ONCE'
73 | if (READ_ONCE(pm->fully_established))
| ^~~~~~~~~
>> net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
73 | if (READ_ONCE(pm->fully_established))
| ^~
include/linux/compiler.h:263:22: note: in definition of macro '__READ_ONCE'
263 | __read_once_size(&(x), __u.__c, sizeof(x)); \
| ^
>> net/mptcp/pm.c:73:6: note: in expansion of macro 'READ_ONCE'
73 | if (READ_ONCE(pm->fully_established))
| ^~~~~~~~~
>> net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
73 | if (READ_ONCE(pm->fully_established))
| ^~
include/linux/compiler.h:263:42: note: in definition of macro '__READ_ONCE'
263 | __read_once_size(&(x), __u.__c, sizeof(x)); \
| ^
>> net/mptcp/pm.c:73:6: note: in expansion of macro 'READ_ONCE'
73 | if (READ_ONCE(pm->fully_established))
| ^~~~~~~~~
>> net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
73 | if (READ_ONCE(pm->fully_established))
| ^~
include/linux/compiler.h:265:30: note: in definition of macro '__READ_ONCE'
265 | __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
| ^
>> net/mptcp/pm.c:73:6: note: in expansion of macro 'READ_ONCE'
73 | if (READ_ONCE(pm->fully_established))
| ^~~~~~~~~
>> net/mptcp/pm.c:73:18: error: 'struct mptcp_pm_data' has no member named 'fully_established'
73 | if (READ_ONCE(pm->fully_established))
| ^~
include/linux/compiler.h:265:50: note: in definition of macro '__READ_ONCE'
265 | __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
| ^
>> net/mptcp/pm.c:73:6: note: in expansion of macro 'READ_ONCE'
73 | if (READ_ONCE(pm->fully_established))
| ^~~~~~~~~
net/mptcp/pm.c:77:19: error: 'struct mptcp_pm_data' has no member named 'fully_established'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~
include/linux/compiler.h:261:17: note: in definition of macro '__READ_ONCE'
261 | union { typeof(x) __val; char __c[1]; } __u; \
| ^
net/mptcp/pm.c:77:7: note: in expansion of macro 'READ_ONCE'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~~~~~~~~
net/mptcp/pm.c:77:19: error: 'struct mptcp_pm_data' has no member named 'fully_established'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~
include/linux/compiler.h:263:22: note: in definition of macro '__READ_ONCE'
263 | __read_once_size(&(x), __u.__c, sizeof(x)); \
| ^
net/mptcp/pm.c:77:7: note: in expansion of macro 'READ_ONCE'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~~~~~~~~
net/mptcp/pm.c:77:19: error: 'struct mptcp_pm_data' has no member named 'fully_established'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~
include/linux/compiler.h:263:42: note: in definition of macro '__READ_ONCE'
263 | __read_once_size(&(x), __u.__c, sizeof(x)); \
| ^
net/mptcp/pm.c:77:7: note: in expansion of macro 'READ_ONCE'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~~~~~~~~
net/mptcp/pm.c:77:19: error: 'struct mptcp_pm_data' has no member named 'fully_established'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~
include/linux/compiler.h:265:30: note: in definition of macro '__READ_ONCE'
265 | __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
| ^
net/mptcp/pm.c:77:7: note: in expansion of macro 'READ_ONCE'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~~~~~~~~
net/mptcp/pm.c:77:19: error: 'struct mptcp_pm_data' has no member named 'fully_established'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~
include/linux/compiler.h:265:50: note: in definition of macro '__READ_ONCE'
265 | __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
| ^
net/mptcp/pm.c:77:7: note: in expansion of macro 'READ_ONCE'
77 | if (!READ_ONCE(pm->fully_established) &&
| ^~~~~~~~~
net/mptcp/pm.c:79:16: error: 'struct mptcp_pm_data' has no member named 'fully_established'
79 | WRITE_ONCE(pm->fully_established, true);
| ^~
include/linux/compiler.h:286:17: note: in definition of macro 'WRITE_ONCE'
286 | union { typeof(x) __val; char __c[1]; } __u = \
| ^
net/mptcp/pm.c:79:16: error: 'struct mptcp_pm_data' has no member named 'fully_established'
79 | WRITE_ONCE(pm->fully_established, true);
| ^~
include/linux/compiler.h:287:30: note: in definition of macro 'WRITE_ONCE'
287 | { .__val = (__force typeof(x)) (val) }; \
| ^
net/mptcp/pm.c:79:16: error: 'struct mptcp_pm_data' has no member named 'fully_established'
79 | WRITE_ONCE(pm->fully_established, true);
| ^~
include/linux/compiler.h:288:22: note: in definition of macro 'WRITE_ONCE'
288 | __write_once_size(&(x), __u.__c, sizeof(x)); \
| ^
net/mptcp/pm.c:79:16: error: 'struct mptcp_pm_data' has no member named 'fully_established'
79 | WRITE_ONCE(pm->fully_established, true);
| ^~
include/linux/compiler.h:288:42: note: in definition of macro 'WRITE_ONCE'
288 | __write_once_size(&(x), __u.__c, sizeof(x)); \
| ^
vim +73 net/mptcp/pm.c
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 65
532e0037f0c3af Peter Krystad 2020-02-26 66 void mptcp_pm_fully_established(struct mptcp_sock *msk)
532e0037f0c3af Peter Krystad 2020-02-26 67 {
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 68 struct mptcp_pm_data *pm = &msk->pm;
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 69
532e0037f0c3af Peter Krystad 2020-02-26 70 pr_debug("msk=%p", msk);
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 71
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 72 /* try to avoid acquiring the lock below */
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 @73 if (READ_ONCE(pm->fully_established))
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 74 return;
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 75
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 76 spin_lock_bh(&pm->lock);
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 77 if (!READ_ONCE(pm->fully_established) &&
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 78 mptcp_pm_schedule_work(msk, MPTCP_PM_ESTABLISHED))
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 79 WRITE_ONCE(pm->fully_established, true);
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 80
d90e5e0f64ebb5 Paolo Abeni 2020-02-24 81 spin_unlock_bh(&pm->lock);
532e0037f0c3af Peter Krystad 2020-02-26 82 }
532e0037f0c3af Peter Krystad 2020-02-26 83
:::::: The code at line 73 was first introduced by commit
:::::: d90e5e0f64ebb50375778bb14ec9ac5e2f37455a Squash-to: "mptcp: Implement path manager interface commands"
:::::: TO: Paolo Abeni <pabeni(a)redhat.com>
:::::: CC: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[mptcp:t/mptcp-allow-dumping-subflow-context-to-userspace 1/7] net/mptcp/diag.c:46:8: error: 'struct mptcp_subflow_context' has no member named 'fourth_ack'
by kbuild test robot
Hi Matthieu,
First bad commit (maybe != root cause):
tree: https://github.com/multipath-tcp/mptcp_net-next.git t/mptcp-allow-dumping-subflow-context-to-userspace
head: bac8494b909da28ffdf11b03fa39d3c2a3a264ba
commit: 8b8c7c1c3ab581375074b0ce33fa7612fd4b947f [1/7] tgupdate: merge t/mptcp-allow-dumping-subflow-context-to-userspace base into t/mptcp-allow-dumping-subflow-context-to-userspace
config: openrisc-randconfig-a001-20200312 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8b8c7c1c3ab581375074b0ce33fa7612fd4b947f
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=openrisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Note: the mptcp/t/mptcp-allow-dumping-subflow-context-to-userspace HEAD bac8494b909da28ffdf11b03fa39d3c2a3a264ba builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
net/mptcp/diag.c: In function 'subflow_get_info':
>> net/mptcp/diag.c:46:8: error: 'struct mptcp_subflow_context' has no member named 'fourth_ack'
46 | if (sf->fourth_ack)
| ^~
vim +46 net/mptcp/diag.c
5b04a26c66f161 Davide Caratti 2020-02-26 15
5b04a26c66f161 Davide Caratti 2020-02-26 16 static int subflow_get_info(const struct sock *sk, struct sk_buff *skb)
5b04a26c66f161 Davide Caratti 2020-02-26 17 {
5b04a26c66f161 Davide Caratti 2020-02-26 18 struct mptcp_subflow_context *sf;
5b04a26c66f161 Davide Caratti 2020-02-26 19 struct nlattr *start;
5b04a26c66f161 Davide Caratti 2020-02-26 20 u32 flags = 0;
5b04a26c66f161 Davide Caratti 2020-02-26 21 int err;
5b04a26c66f161 Davide Caratti 2020-02-26 22
5b04a26c66f161 Davide Caratti 2020-02-26 23 start = nla_nest_start_noflag(skb, INET_ULP_INFO_MPTCP);
5b04a26c66f161 Davide Caratti 2020-02-26 24 if (!start)
5b04a26c66f161 Davide Caratti 2020-02-26 25 return -EMSGSIZE;
5b04a26c66f161 Davide Caratti 2020-02-26 26
5b04a26c66f161 Davide Caratti 2020-02-26 27 rcu_read_lock();
5b04a26c66f161 Davide Caratti 2020-02-26 28 sf = rcu_dereference(inet_csk(sk)->icsk_ulp_data);
5b04a26c66f161 Davide Caratti 2020-02-26 29 if (!sf) {
5b04a26c66f161 Davide Caratti 2020-02-26 30 err = 0;
5b04a26c66f161 Davide Caratti 2020-02-26 31 goto nla_failure;
5b04a26c66f161 Davide Caratti 2020-02-26 32 }
5b04a26c66f161 Davide Caratti 2020-02-26 33
5b04a26c66f161 Davide Caratti 2020-02-26 34 if (sf->mp_capable)
5b04a26c66f161 Davide Caratti 2020-02-26 35 flags |= MPTCP_SUBFLOW_FLAG_MCAP_REM;
5b04a26c66f161 Davide Caratti 2020-02-26 36 if (sf->request_mptcp)
5b04a26c66f161 Davide Caratti 2020-02-26 37 flags |= MPTCP_SUBFLOW_FLAG_MCAP_LOC;
5b04a26c66f161 Davide Caratti 2020-02-26 38 if (sf->mp_join)
5b04a26c66f161 Davide Caratti 2020-02-26 39 flags |= MPTCP_SUBFLOW_FLAG_JOIN_REM;
5b04a26c66f161 Davide Caratti 2020-02-26 40 if (sf->request_join)
5b04a26c66f161 Davide Caratti 2020-02-26 41 flags |= MPTCP_SUBFLOW_FLAG_JOIN_LOC;
5b04a26c66f161 Davide Caratti 2020-02-26 42 if (sf->backup)
5b04a26c66f161 Davide Caratti 2020-02-26 43 flags |= MPTCP_SUBFLOW_FLAG_BKUP_REM;
5b04a26c66f161 Davide Caratti 2020-02-26 44 if (sf->request_bkup)
5b04a26c66f161 Davide Caratti 2020-02-26 45 flags |= MPTCP_SUBFLOW_FLAG_BKUP_LOC;
5b04a26c66f161 Davide Caratti 2020-02-26 @46 if (sf->fourth_ack)
5b04a26c66f161 Davide Caratti 2020-02-26 47 flags |= MPTCP_SUBFLOW_FLAG_4THACK;
5b04a26c66f161 Davide Caratti 2020-02-26 48 if (sf->conn_finished)
5b04a26c66f161 Davide Caratti 2020-02-26 49 flags |= MPTCP_SUBFLOW_FLAG_CONNECTED;
5b04a26c66f161 Davide Caratti 2020-02-26 50 if (sf->map_valid)
5b04a26c66f161 Davide Caratti 2020-02-26 51 flags |= MPTCP_SUBFLOW_FLAG_MAPVALID;
5b04a26c66f161 Davide Caratti 2020-02-26 52
5b04a26c66f161 Davide Caratti 2020-02-26 53 if (nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_TOKEN_REM, sf->remote_token) ||
5b04a26c66f161 Davide Caratti 2020-02-26 54 nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_TOKEN_LOC, sf->token) ||
5b04a26c66f161 Davide Caratti 2020-02-26 55 nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
5b04a26c66f161 Davide Caratti 2020-02-26 56 sf->rel_write_seq) ||
5b04a26c66f161 Davide Caratti 2020-02-26 57 nla_put_u64_64bit(skb, MPTCP_SUBFLOW_ATTR_MAP_SEQ, sf->map_seq,
5b04a26c66f161 Davide Caratti 2020-02-26 58 MPTCP_SUBFLOW_ATTR_PAD) ||
5b04a26c66f161 Davide Caratti 2020-02-26 59 nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
5b04a26c66f161 Davide Caratti 2020-02-26 60 sf->map_subflow_seq) ||
5b04a26c66f161 Davide Caratti 2020-02-26 61 nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_SSN_OFFSET, sf->ssn_offset) ||
5b04a26c66f161 Davide Caratti 2020-02-26 62 nla_put_u16(skb, MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
5b04a26c66f161 Davide Caratti 2020-02-26 63 sf->map_data_len) ||
5b04a26c66f161 Davide Caratti 2020-02-26 64 nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_FLAGS, flags) ||
5b04a26c66f161 Davide Caratti 2020-02-26 65 nla_put_u8(skb, MPTCP_SUBFLOW_ATTR_ID_REM, sf->remote_id) ||
5b04a26c66f161 Davide Caratti 2020-02-26 66 nla_put_u8(skb, MPTCP_SUBFLOW_ATTR_ID_LOC, sf->local_id)) {
5b04a26c66f161 Davide Caratti 2020-02-26 67 err = -EMSGSIZE;
5b04a26c66f161 Davide Caratti 2020-02-26 68 goto nla_failure;
5b04a26c66f161 Davide Caratti 2020-02-26 69 }
5b04a26c66f161 Davide Caratti 2020-02-26 70
5b04a26c66f161 Davide Caratti 2020-02-26 71 rcu_read_unlock();
5b04a26c66f161 Davide Caratti 2020-02-26 72 nla_nest_end(skb, start);
5b04a26c66f161 Davide Caratti 2020-02-26 73 return 0;
5b04a26c66f161 Davide Caratti 2020-02-26 74
5b04a26c66f161 Davide Caratti 2020-02-26 75 nla_failure:
5b04a26c66f161 Davide Caratti 2020-02-26 76 rcu_read_unlock();
5b04a26c66f161 Davide Caratti 2020-02-26 77 nla_nest_cancel(skb, start);
5b04a26c66f161 Davide Caratti 2020-02-26 78 return err;
5b04a26c66f161 Davide Caratti 2020-02-26 79 }
5b04a26c66f161 Davide Caratti 2020-02-26 80
:::::: The code at line 46 was first introduced by commit
:::::: 5b04a26c66f161428203e8e504af59dd05ed2a8d mptcp: allow dumping subflow context to userspace
:::::: TO: Davide Caratti <dcaratti(a)redhat.com>
:::::: CC: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[mptcp:t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests 1/4] net//mptcp/options.c:391:41: error: 'struct mptcp_subflow_context' has no member named 'fourth_ack'
by kbuild test robot
tree: https://github.com/multipath-tcp/mptcp_net-next.git t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
head: d1a5f94551a0e54cc7cdcd7305e22971aa2dbacb
commit: e06605d017e3bf2ee4c4803da4d25b2544735718 [1/4] tgupdate: merge t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests base into t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
config: openrisc-randconfig-a001-20200312 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout e06605d017e3bf2ee4c4803da4d25b2544735718
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=openrisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Note: the mptcp/t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests HEAD d1a5f94551a0e54cc7cdcd7305e22971aa2dbacb builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
net//mptcp/options.c: In function 'mptcp_established_options_mp':
>> net//mptcp/options.c:391:41: error: 'struct mptcp_subflow_context' has no member named 'fourth_ack'
391 | } else if (subflow->mp_join && !subflow->fourth_ack) {
| ^~
net//mptcp/options.c:395:10: error: 'struct mptcp_subflow_context' has no member named 'fourth_ack'
395 | subflow->fourth_ack = 1;
| ^~
vim +391 net//mptcp/options.c
cec37a6e41aae7 Peter Krystad 2020-01-21 343
cc7972ea193233 Christoph Paasch 2020-01-21 344 static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,
cc7972ea193233 Christoph Paasch 2020-01-21 345 unsigned int *size,
6d0060f600adfd Mat Martineau 2020-01-21 346 unsigned int remaining,
cec37a6e41aae7 Peter Krystad 2020-01-21 347 struct mptcp_out_options *opts)
cec37a6e41aae7 Peter Krystad 2020-01-21 348 {
cec37a6e41aae7 Peter Krystad 2020-01-21 349 struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
cc7972ea193233 Christoph Paasch 2020-01-21 350 struct mptcp_ext *mpext;
cc7972ea193233 Christoph Paasch 2020-01-21 351 unsigned int data_len;
cc7972ea193233 Christoph Paasch 2020-01-21 352
9ca72cd814cdd8 Paolo Abeni 2020-03-05 353 pr_debug("subflow=%p fully established=%d seq=%x:%x remaining=%d",
9ca72cd814cdd8 Paolo Abeni 2020-03-05 354 subflow, subflow->fully_established, subflow->snd_isn,
cc7972ea193233 Christoph Paasch 2020-01-21 355 skb ? TCP_SKB_CB(skb)->seq : 0, remaining);
cc7972ea193233 Christoph Paasch 2020-01-21 356
9ca72cd814cdd8 Paolo Abeni 2020-03-05 357 if (subflow->mp_capable && !subflow->fully_established && skb &&
cc7972ea193233 Christoph Paasch 2020-01-21 358 subflow->snd_isn == TCP_SKB_CB(skb)->seq) {
cc7972ea193233 Christoph Paasch 2020-01-21 359 /* When skb is not available, we better over-estimate the
cc7972ea193233 Christoph Paasch 2020-01-21 360 * emitted options len. A full DSS option is longer than
cc7972ea193233 Christoph Paasch 2020-01-21 361 * TCPOLEN_MPTCP_MPC_ACK_DATA, so let's the caller try to fit
cc7972ea193233 Christoph Paasch 2020-01-21 362 * that.
cc7972ea193233 Christoph Paasch 2020-01-21 363 */
cc7972ea193233 Christoph Paasch 2020-01-21 364 mpext = mptcp_get_ext(skb);
cc7972ea193233 Christoph Paasch 2020-01-21 365 data_len = mpext ? mpext->data_len : 0;
cec37a6e41aae7 Peter Krystad 2020-01-21 366
cc7972ea193233 Christoph Paasch 2020-01-21 367 /* we will check ext_copy.data_len in mptcp_write_options() to
cc7972ea193233 Christoph Paasch 2020-01-21 368 * discriminate between TCPOLEN_MPTCP_MPC_ACK_DATA and
cc7972ea193233 Christoph Paasch 2020-01-21 369 * TCPOLEN_MPTCP_MPC_ACK
cc7972ea193233 Christoph Paasch 2020-01-21 370 */
cc7972ea193233 Christoph Paasch 2020-01-21 371 opts->ext_copy.data_len = data_len;
cec37a6e41aae7 Peter Krystad 2020-01-21 372 opts->suboptions = OPTION_MPTCP_MPC_ACK;
cec37a6e41aae7 Peter Krystad 2020-01-21 373 opts->sndr_key = subflow->local_key;
cec37a6e41aae7 Peter Krystad 2020-01-21 374 opts->rcvr_key = subflow->remote_key;
cc7972ea193233 Christoph Paasch 2020-01-21 375
cc7972ea193233 Christoph Paasch 2020-01-21 376 /* Section 3.1.
cc7972ea193233 Christoph Paasch 2020-01-21 377 * The MP_CAPABLE option is carried on the SYN, SYN/ACK, and ACK
cc7972ea193233 Christoph Paasch 2020-01-21 378 * packets that start the first subflow of an MPTCP connection,
cc7972ea193233 Christoph Paasch 2020-01-21 379 * as well as the first packet that carries data
cc7972ea193233 Christoph Paasch 2020-01-21 380 */
cc7972ea193233 Christoph Paasch 2020-01-21 381 if (data_len > 0)
cc7972ea193233 Christoph Paasch 2020-01-21 382 *size = ALIGN(TCPOLEN_MPTCP_MPC_ACK_DATA, 4);
cc7972ea193233 Christoph Paasch 2020-01-21 383 else
cec37a6e41aae7 Peter Krystad 2020-01-21 384 *size = TCPOLEN_MPTCP_MPC_ACK;
cc7972ea193233 Christoph Paasch 2020-01-21 385
cc7972ea193233 Christoph Paasch 2020-01-21 386 pr_debug("subflow=%p, local_key=%llu, remote_key=%llu map_len=%d",
cc7972ea193233 Christoph Paasch 2020-01-21 387 subflow, subflow->local_key, subflow->remote_key,
cc7972ea193233 Christoph Paasch 2020-01-21 388 data_len);
cc7972ea193233 Christoph Paasch 2020-01-21 389
cec37a6e41aae7 Peter Krystad 2020-01-21 390 return true;
58d3e05e59695f Peter Krystad 2020-02-26 @391 } else if (subflow->mp_join && !subflow->fourth_ack) {
58d3e05e59695f Peter Krystad 2020-02-26 392 opts->suboptions = OPTION_MPTCP_MPJ_ACK;
58d3e05e59695f Peter Krystad 2020-02-26 393 memcpy(opts->hmac, subflow->hmac, MPTCPOPT_HMAC_LEN);
58d3e05e59695f Peter Krystad 2020-02-26 394 *size = TCPOLEN_MPTCP_MPJ_ACK;
58d3e05e59695f Peter Krystad 2020-02-26 395 subflow->fourth_ack = 1;
58d3e05e59695f Peter Krystad 2020-02-26 396 pr_debug("subflow=%p", subflow);
58d3e05e59695f Peter Krystad 2020-02-26 397 return true;
cec37a6e41aae7 Peter Krystad 2020-01-21 398 }
cec37a6e41aae7 Peter Krystad 2020-01-21 399 return false;
cec37a6e41aae7 Peter Krystad 2020-01-21 400 }
cec37a6e41aae7 Peter Krystad 2020-01-21 401
:::::: The code at line 391 was first introduced by commit
:::::: 58d3e05e59695fb74330e0a7dc80b67d3101f6e9 mptcp: Add handling of outgoing MP_JOIN requests
:::::: TO: Peter Krystad <peter.krystad(a)linux.intel.com>
:::::: CC: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[PATCH] Squash-to: "mptcp: add netlink based PM"
by Paolo Abeni
Remove typo in enum name. It looks like anonymous enum
is the most common choice, so drop the enum type name
completely.
Reported-by: Christoph Paasch <cpaasch(a)apple.com>
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
include/uapi/linux/mptcp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index d061c5a6ae05..dfd6674c39b0 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -40,7 +40,7 @@ enum {
/*
* ATTR types defined for MPTCP
*/
-enum mptcp_pm_attrs {
+enum {
MPTCP_PM_ATTR_UNSPEC,
MPTCP_PM_ATTR_ADDR, /* nested address */
@@ -52,7 +52,7 @@ enum mptcp_pm_attrs {
#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
-enum mptcp_pm_addr_addrs {
+enum {
MPTCP_PM_ADDR_ATTR_UNSPEC,
MPTCP_PM_ADDR_ATTR_FAMILY, /* u16 */
--
2.21.1
2 years, 3 months
[PATCH v3 0/5] Add support for v1 of ADD_ADDR option
by Peter Krystad
Support parsing and writing the new option format, with hmac generation
and validation.
Support for echoing ADD_ADDR still to come.
v2: check msg len in mptcp_crypto_hmac_sha().
remove obsolete casts
v3: Rebase and split for squashing, patches ready to be applied.
Peter Krystad (5):
mptcp: v1 ADD_ADDR changes: use subflow_generate_hmac()
mptcp: v1 ADD_ADDR changes: add subflow_generate_hmac()
mptcp: v1 ADD_ADDR changes: add_addr_hmac_valid
mptcp: Add ADD_ADDR handling
mptcp: Re-factor mptcp_crypto_hmac_sha()
include/linux/tcp.h | 12 +++++
include/net/mptcp.h | 7 +++
net/mptcp/crypto.c | 17 +++---
net/mptcp/options.c | 121 ++++++++++++++++++++++++++++++++++++++++---
net/mptcp/protocol.h | 20 ++++++-
5 files changed, 161 insertions(+), 16 deletions(-)
--
2.17.2
2 years, 3 months