One approach to indirect call optimization
by Mat Martineau
I noticed this patch on netdev to avoid an indirect call to md5_lookup,
which was accepted. It is mitigating the cost of an existing indirect call
rather than adding a new one, but shows how the maintainers are looking at
the problem.
--
Mat Martineau
Intel OTC
---------- Forwarded message ----------
Date: Mon, 23 Apr 2018 14:46:25
From: Eric Dumazet <edumazet(a)google.com>
To: David S . Miller <davem(a)davemloft.net>
Cc: netdev <netdev(a)vger.kernel.org>, Eric Dumazet <edumazet(a)google.com>,
Eric Dumazet <eric.dumazet(a)gmail.com>
Subject: [PATCH net-next] tcp: md5: only call tp->af_specific->md5_lookup() for
md5 sockets
RETPOLINE made calls to tp->af_specific->md5_lookup() quite expensive,
given they have no result.
We can omit the calls for sockets that have no md5 keys.
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
---
net/ipv4/tcp_output.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 383cac0ff0ec059ca7dbc1a6304cc7f8183e008d..95feffb6d53f8a9eadfb15a2fffeec498d6e993a 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -585,14 +585,15 @@ static unsigned int tcp_syn_options(struct sock *sk, struct sk_buff *skb,
unsigned int remaining = MAX_TCP_OPTION_SPACE;
struct tcp_fastopen_request *fastopen = tp->fastopen_req;
+ *md5 = NULL;
#ifdef CONFIG_TCP_MD5SIG
- *md5 = tp->af_specific->md5_lookup(sk, sk);
- if (*md5) {
- opts->options |= OPTION_MD5;
- remaining -= TCPOLEN_MD5SIG_ALIGNED;
+ if (unlikely(rcu_access_pointer(tp->md5sig_info))) {
+ *md5 = tp->af_specific->md5_lookup(sk, sk);
+ if (*md5) {
+ opts->options |= OPTION_MD5;
+ remaining -= TCPOLEN_MD5SIG_ALIGNED;
+ }
}
-#else
- *md5 = NULL;
#endif
/* We always get an MSS option. The option bytes which will be seen in
@@ -720,14 +721,15 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb
opts->options = 0;
+ *md5 = NULL;
#ifdef CONFIG_TCP_MD5SIG
- *md5 = tp->af_specific->md5_lookup(sk, sk);
- if (unlikely(*md5)) {
- opts->options |= OPTION_MD5;
- size += TCPOLEN_MD5SIG_ALIGNED;
+ if (unlikely(rcu_access_pointer(tp->md5sig_info))) {
+ *md5 = tp->af_specific->md5_lookup(sk, sk);
+ if (*md5) {
+ opts->options |= OPTION_MD5;
+ size += TCPOLEN_MD5SIG_ALIGNED;
+ }
}
-#else
- *md5 = NULL;
#endif
if (likely(tp->rx_opt.tstamp_ok)) {
--
2.17.0.484.g0c8726318c-goog
2 years, 4 months
[Weekly meetings] MoM - 26th of June 2018
by Matthieu Baerts
Hello,
We just had our 14th meeting with Mat, Ossama (Intel OTC), Christoph
(Apple) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Netdev paper:
- Mat is now the main author
- Comments have been directly applied in the text
- 2 main todo are left (conclusion + intro challenge networking),
Mat will try to have a look today.
- Feel free to share comments by emails!
- https://www.sharelatex.com/read/mdnhtfgxpkhg
- Matth will send the first draft tomorrow
Netdev Slides:
- We dividing up sections of the talk to deliver
- We discussed role of slides and which visuals can help →
everything is in the notes of the slides on Google Drive
- We will present on Friday at 9.55am
https://www.netdevconf.org/0x12/schedule.html
- Matth will send a frist draft tomorrow (with Mat's additions)
and/or at end of the week (with Matth's additions)
Netdev misc:
- participate to this?
https://www.netdevconf.org/0x12/news.html?bits-nibbles-bytes-and-words
- we already have the talk and we know a few people with who we
would like to talk with, we think we don't need this but more than
welcome to talk with people about this project!
Linux Plumber conf:
- we would need a description ~300 words
- focus on technical aspects skb, changes in TCP core, etc.
- Mat and Peter will check what we could talk about
- deadline: 11th of July
Next steps:
- Netdev conf: Finish last details about slides + paper
- Prepare a description for the Linux Plumber conf
- Come back from or Go on holidays for some
- Mat and Peter's patches: review and discussion should continue on
the ML.
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- We propose to switch back to Thursday for the next time: the
5th of July. Usual time 9am PDT - 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180705
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 9 months
Weekly meeting - 26 June 2018 16:00 UTC (9am PDT, 6pm CEST)
by Matthieu Baerts
Hello,
Our public MPTCP upstreaming weekly web conference is scheduled for
tomorrow, exceptionally on a Tuesday.
The list of topics is here:
https://annuel2.framapad.org/p/mptcp_upstreaming_20180626
Feel free to add/modify topics!
Meeting link: https://talky.io/mptcp_upstreaming
Speak to you tomorrow!
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 9 months
[Weekly meetings] MoM - 13th of June 2018
by Matthieu Baerts
Hello,
We just had our 13th meeting with Mat, Peter (Intel OTC), Christoph
(Apple) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Netconf:
- Some summaries are available, interesting reading:
https://lwn.net/Articles/757204/
Mat and Peter's patches:
- discussions started
- but we need more time to review them, sorry
- Feel free to review them!
Netdev conf:
- The paper is almost finish, next to the end.
- (discussions about it continued on the paper directly)
- Feel free to read it and comment it!
Linux Plumber conf:
- we will need to write a description for the end of this month if
we want to participate.
- we first need to agree about what to present.
- in November: we should have more concrete code, current RFC code
should be somewhere, we hope having more technical details to present.
- there, we could come with more technical ideas, maybe already
mentioning them in the description.
- we should think about that the coming week to finalise something
at the next meeting, ~300 words.
- deadline: just before Netdev (~11th July)
Next steps:
- Netdev conf: slides + paper: we should have a first draft for the
next meeting. Continue the discussions on the ML.
- Linux Plumber conf: discuss about the description in more details
and hope to have ~300 words to send.
- Mat and Peter's patches: review and discussion should continue on
the ML.
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- We propose to exceptionally switch to next Tuesday next time: the
26th of June. Usual time 9am PDT - 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180626
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 10 months
[RFC PATCH v2 00/19] MPTCP architecture proposal for discussion
by Mat Martineau
Hello everyone,
Peter and I have been working on this patch set to show how how MPTCP
can fit in to the Linux networking stack using these design ideas:
* Applications opt-in to MPTCP using IPPROTO_MPTCP, regular TCP sockets
are still the default. A socket created with
socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP) will attempt to form a
MPTCP connection. IPPROTO_MPTCP == 99 as a placeholder.
* Subflows exist within the kernel as separate sockets, owned by a
MPTCP connection-level socket that is visible to userspace.
* Adds an optional area to struct sk_buff to store MPTCP metadata
without increasing the size of normal sk_buffs.
* Adds the CONFIG_MPTCP option to Kconfig.
The following patches can form an MPTCP connection with the
multipath-tcp.org kernel (tested with v0.94), and send DSS mappings that
are accepted for the initial data packet. It is an early implementation,
and I don't represent it as being upstreamable as-is or being everyone's
idea of what an eventual upstream implementation will necessarily look
like. It has significant limitations:
* Only one subflow is supported, no joins, and only ipv4.
* Does not support DSS checksums. Checksums must be disabled on the
remote stack (for multipath-tcp.org, 'sudo sysctl -w
net.mptcp.mptcp_checksum=0')
* Lots of debug statements (although they use dynamic debug and are
disabled by default) and TODOs.
* It's only been tested sending small amounts of data, and will reject
system calls attempting to write more data than can fit in one
mapping.
Hopefully there are are some interesting concepts to discuss, and this
code helps us assess how workable the above design principles
are. Thanks in advance for your feedback on the benefits or drawbacks of
this code, how it might be improved, or how other approaches might
compare.
The patch set applies to net-next (as of commit 75d4e704fa8d on
2018-06-05). I have also pushed it to:
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(mptcp-proposal branch)
v2 changes: Added receive path implementation (last two patches).
Reworked TCP option writing. Miscellaneous bug fixes including
header dependency cleanup.
Mat Martineau (8):
tcp: Add MPTCP option number
tcp: Define IPPROTO_MPTCP
skbuff: Add shared control buffer
tcp: Export low-level TCP functions
mptcp: More efficient byte order handling
mptcp: Write MPTCP DSS headers to outgoing data packets
mptcp: Disable TCP coalesce/collapse for MPTCP subflows
mptcp: Implement MPTCP receive path
Peter Krystad (11):
mptcp: Add MPTCP socket stubs
mptcp: Handle MPTCP TCP options
tcp: Add IPPROTO_SUBFLOW
tcp: expose tcp routines and structs for MPTCP
mptcp: Create SUBFLOW socket for outgoing connections
mptcp: Create SUBFLOW socket for incoming connections
mptcp: Add key generation and token tree
mptcp: Add getname() socket operation
mptcp: Add shutdown() socket operation
mptcp: Implement setsockopt()/getsockopt()
mptcp: Rework handling of the MPTCP sub-options
include/linux/skbuff.h | 24 +-
include/linux/tcp.h | 26 ++
include/net/inet_common.h | 3 +
include/net/mptcp.h | 188 ++++++++
include/net/tcp.h | 8 +
include/uapi/linux/in.h | 4 +
net/Kconfig | 1 +
net/Makefile | 1 +
net/core/skbuff.c | 53 ++-
net/ipv4/af_inet.c | 2 +-
net/ipv4/tcp.c | 12 +-
net/ipv4/tcp_input.c | 26 +-
net/ipv4/tcp_ipv4.c | 4 +-
net/ipv4/tcp_output.c | 235 +++++++++-
net/mptcp/Kconfig | 10 +
net/mptcp/Makefile | 3 +
net/mptcp/crypto.c | 209 +++++++++
net/mptcp/options.c | 230 ++++++++++
net/mptcp/protocol.c | 904 ++++++++++++++++++++++++++++++++++++++
net/mptcp/subflow.c | 374 ++++++++++++++++
net/mptcp/token.c | 222 ++++++++++
21 files changed, 2501 insertions(+), 38 deletions(-)
create mode 100644 include/net/mptcp.h
create mode 100644 net/mptcp/Kconfig
create mode 100644 net/mptcp/Makefile
create mode 100644 net/mptcp/crypto.c
create mode 100644 net/mptcp/options.c
create mode 100644 net/mptcp/protocol.c
create mode 100644 net/mptcp/subflow.c
create mode 100644 net/mptcp/token.c
--
2.17.1
2 years, 10 months
Weekly meeting - 13 June 2018 16:00 UTC (9am PDT, 6pm CEST)
by Matthieu Baerts
Hello,
Our public MPTCP upstreaming weekly web conference is scheduled for
tomorrow, exceptionally on a Wednesday.
The list of topics is here:
https://annuel2.framapad.org/p/mptcp_upstreaming_20180613
Feel free to add/modify topics!
Meeting link: https://talky.io/mptcp_upstreaming
Speak to you tomorrow!
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 10 months
[PATCH mptcp-net-next 00/14] Forward-ports from mptcp_trunk to mptcp-net-next
by Christoph Paasch
Here are some forward-ports from mptcp_trunk to mptcp-net-next of the
lockless subflows patches and the two bug-fixes.
Christoph Paasch (14):
mptcp: Cleanup
mptcp: Improved debugging
mptcp: Use correct tcp_queue when calling mptcp_fragment
mptcp: Use mptcp_can_new_subflow where possible
mptcp: Render mptcp_sub_inherit_sockopts lockless
mptcp: Make mptcp_set_new_pathindex lockless
mptcp: Remove cnt_subflows
mptcp: Remove cnt_established
mptcp: Rename tw_lock to mpcb_list_lock
mptcp: Make subflow-list an RCU-list
mptcp: Don't take meta-lock when receiving third ACK
mptcp: Make mptcp_do_join_short and mptcp_lookup_join lockless
mptcp: Reset tsorted_anchor after call to tcp_fragment
mptcp: Pick correct sk when iterating in mptcp_set_rto
include/net/mptcp.h | 127 ++++++++++++-----------------
net/ipv4/af_inet.c | 9 ++-
net/ipv4/ip_sockglue.c | 7 +-
net/ipv4/tcp.c | 31 +++++---
net/ipv4/tcp_ipv4.c | 41 +---------
net/ipv4/tcp_minisocks.c | 9 ++-
net/ipv6/tcp_ipv6.c | 41 +---------
net/mptcp/mptcp_ctrl.c | 186 ++++++++++++++++++++++++++++---------------
net/mptcp/mptcp_fullmesh.c | 30 ++++---
net/mptcp/mptcp_input.c | 150 ++++++++++++----------------------
net/mptcp/mptcp_ipv4.c | 34 +++-----
net/mptcp/mptcp_ipv6.c | 15 ++--
net/mptcp/mptcp_ndiffports.c | 2 +-
net/mptcp/mptcp_output.c | 61 ++++++++++----
net/mptcp/mptcp_sched.c | 32 ++++----
15 files changed, 371 insertions(+), 404 deletions(-)
--
2.16.2
2 years, 10 months
[Weekly meetings] MoM - 7th of June 2018
by Matthieu Baerts
Hello,
We just had our 13th meeting with Mat, Peter, Ossama (Intel OTC),
Christoph (Apple) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Progress from last week visible on the ML:
- Mat and Peter have released the v2 of their patches.
- Mat, Matth and Christoph: worked on the Netdev's paper
New TCP maintainer (Eric Dumazet):
- we don't know what it means in practice, will see
- but sounds very good to have a maintainer for TCP only
- would be nice if we can talk with him at Netdev Conf (if he goes
there, anyone knows?)
Netconf:
- slides are available online: http://vger.kernel.org/netconf2018.html
- there were some presentations about indirections, ULPs, and others
that could be interesting for us.
Netdev conf:
- we should finish a first draft before the next meeting
- and already start slides → easier to use google docs:
https://docs.google.com/presentation/d/1giewlChJKBSgtd6qB32FiFuzW8VbgqqLE...
- for the slides: we will not use templates from one company as it
is a shared effort.
- Could be good to talk about people participating to the IETF
after. But they will maybe participating to Netdev. For example, it
could be good to talk about APIs with Lorenzo (@Lorenzo, will you be
there? :) )
Mat and Peter's v2 patches:
- v2 is available:
https://lists.01.org/pipermail/mptcp/2018-June/000643.html
- waiting for reviews, feel free to review!
- not everything is working as mentioned in the cover letter, e.g.
DATA_FIN are not sent (note that when testing with a server suing
MPTCP.org implementation, you will not see any timeout, that's normal), etc.
- it is also to share the idea of the architecture in more details
- main changes: last two patches (one is disabling coalescing and
collapsing ; last is the receive path stuff)
- next step: keep coalescing/collapsing → we could keep a list of
coalesced/collapsed chunks (if we can add an 'if' statement in the core
code base like TLS devs did ; we can also enable these "optimisations"
later)
- (and of course support multiple subflows, etc. as stated in the
cover letter)
- Nobody here had time this week to start reviewing them. But that
will come!
Next steps:
- Netdev conf: slides + finalise paper ; Mat, Christoph and Matth
will try to do that starting from today/tomorrow
- Mat and Peter's patches: review and discussion on the ML will come.
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- We propose to exceptionally switch to Wednesday next time: the
13th of June. Usual time 9am PDT - 16:00 UTC (9am PDT, 6pm CEST)
- still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180613
- we also propose to have one meeting the 26th of June, 16:00 UTC.
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 10 months
Weekly meeting - 7 June 2018 16:00 UTC (9am PDT, 6pm CEST)
by Matthieu Baerts
Hello,
Our public MPTCP upstreaming weekly web conference is scheduled for
tomorrow.
The list of topics is here:
https://annuel2.framapad.org/p/mptcp_upstreaming_20180607
Feel free to add/modify topics!
Meeting link: https://talky.io/mptcp_upstreaming
Speak to you tomorrow!
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
--
DISCLAIMER.
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named. If you are not the named addressee
you should not disseminate, distribute or copy this e-mail. Please notify
the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.
2 years, 10 months