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
3 years, 5 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
3 years, 11 months
[Weekly meetings] MoM - 31th of May 2018
by Matthieu Baerts
Hello,
We just had our 12th 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:
- Mat and Peter: had an issue with their v2 (how the DSS ACK is
uploaded -- lockless issues). They hope sharing it before the next meeting.
- Mat and Matth: worked a bit on the Netdev's paper
- For the others: not so much to say, busy with other deadlines.
Should be better soon.
Netdev conf:
- Matth: we should have the right content for the intro + abstract.
Sentences will certainly need to be improved, can be done later.
- put somewhere in the paper: we want to support the v1 in the
upstream version, not the v0
- we still have plenty of time (but some people are off in June)
Plumbers conf:
- Submission deadline July 11:
http://vger.kernel.org/lpc-networking.html (careful, different than
https://linuxplumbersconf.org/event/2/abstracts/ )
- Submission = Title, A list of submitter names, and a description
of up to 350 words.
- 1st draft of the Slides and papers are due by October 25th, 2018.
Final drafts are due by November 4th, 2018.
- We want to finish the submission for the end of June, let's focus
on the Netdev stuff first (reminder added for the 21th of June. I can
set it sooner/later: is it ok for you Mat? Maybe better the week before?)
Next steps:
- Netdev conf: slides + paper. Matth will try to look at it.
- a v2 for Mat and Peter's patches
- continue the work on the userspace PM Open-Source by Ossama
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- proposition: the 7th of June. Usual time 9am PDT - 16:00 UTC (9am
PDT, 6pm CEST)
- open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180607
Feel free to comment 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.
3 years, 11 months
Weekly meeting - 31 May 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_20180531
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.
3 years, 11 months
Fwd: 0x12: Nuts-n-bolts Talk!How hard can it be? Adding Multipath TCP to the upstream kernel
by Matthieu Baerts
Hello,
Here is the official introduction for those who wants more info about our
future talk at Netdev 0x12 in July.
Best regards,
Matthieu
---------- Forwarded message ---------
From: Jamal Hadi Salim <jhs(a)mojatatu.com>
Date: Mon, May 28, 2018 at 5:13 PM
Subject: 0x12: Nuts-n-bolts Talk!How hard can it be? Adding Multipath TCP
to the upstream kernel
To: people <people(a)netdevconf.org>
Cc: <program-committee(a)netdevconf.org>, <matthieu.baerts(a)tessares.net>, <
peter.krystad(a)intel.com>, <cpaasch(a)apple.com>, <
mathew.j.martineau(a)linux.intel.com>
New Nuts-n-bolts Talk paper accepted.
Christoph Paasch, Mat Martineau, Peter Krystad and Matthieu Baerts
have been working very hard on kernel Multipath TCP(RFC 6824) support.
There have been difficulties in the past in upstreaming this
implementation due to its invasive architecture; however,
the authors feel that they have better understanding since
the last time they showed up at netdev conf 0.1:
The current MPTCP implementation has moved from it researchy
origins and is already used by millions of devices in production
environments. The protocol standardization is also now complete.
For these reasons the authors feel that experience has gained
them a lot of insight and they are ready to move forward
with upstreaming.
In this talk, the authors will do a gentle introduction of
Multipath TCP and mention some uses cases already in production.
They will discuss the challenges faced - both resolved and
ongoing. More importantly they will be looking for feedback on how to
best revamp the current implementation for upstreaming purposes.
More info:
https://www.netdevconf.org/0x12/session.html?how-hard-can-it-be-adding-mu...
cheers,
jamal
Again reminder:
1) June 1st is the deadline for early bird (20% off) registration fees.
2) We do have bursaries for folks who need help getting to the
conference.Closes on June 20th. Open to all members of the community.
--
[image: Tessares SA] <http://www.tessares.net> 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
<https://www.google.com/maps?q=1+Avenue+Jean+Monnet,+1348+Ottignies-Louvai...>
--
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.
3 years, 11 months
[Weekly meetings] MoM - 24th of May 2018
by Matthieu Baerts
Hello,
We just had our 11th 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:
Netdev conf:
- we have been accepted \o/
- Comment from Program Committee: PC requests the authors to also
think about how this will evolve in the future, as newer/better
congestion control algorithms like BBR are introduced to adapt to a
changing internet.
- we need to prepare slides + paper
- Note about the registration: there are invitation code for
speakers and an Early Bird Rate (May 01-June 01, 2018)
Netdev's Paper:
* To read / modify it:
Paper RW: https://www.sharelatex.com/8294638822ybsnsmmwkzcp
(account needed)
Paper RO: https://www.sharelatex.com/read/mdnhtfgxpkhg
* deadline is end of June
* Could be good to finish the draft for slides and paper for June
23th due to some holidays
* Matthieu will rework the abstract/introduction, maybe with some
helps from Tessares. And fill-in sections.
* Anybody can also fill-in sections, it is collaborative, feel free
to add your name in the document
* We can switch to GDoc if LaTeX is an issue.
* If the document no longer compiles, don't worry, some people will
certainly quickly fix it for you later ;-)
Netdev' Slides:
* same comments as for the paper for the deadline and trying to
finish it for June 23th or mid-June.
* We don't have to be all there to talk because it is only 30 minutes
* We hope to be 4 there: Christoph, Mat, Peter, Matthieu
mptcp_net-next:
* when there is an update (merge with net-next) but nothing to say,
Mat will simply not send an email, that's normal.
Mat and Peter's v2 patch:
* making some good progress
* in review internally
* should be available shortly
Next steps:
- Mat and Peter will propose a v2, be prepared for the reviews!
- Matthieu will look at the paper
- For the rest, it is the same as last week.
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- proposition: the 31th of May. Usual time 9am PDT - 16:00 UTC (9am
PDT, 6pm CEST)
- open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180531
Feel free to comment 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.
3 years, 11 months
Weekly meeting - 24 May 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_20180524
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.
3 years, 11 months
[Weekly meetings] MoM - 17th of May 2018
by Matthieu Baerts
Hello,
Back to normal, we just had our 10th 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:
Netdev participation:
* Matthieu got the confirmation this week: he will be there
* Mat and Peter have to wait
* (Christoph already said he will be there)
Netdev proposal:
* at the meeting, we finished the review of the proposal
* main change: we set a list of challenges to add a tiny bit more
details to prove we are working on something
* the proposal has been posted just after the meeting
Update of mptcp_trunk (by Christoph):
- no real issue
- Christoph will share more changes (bug-fixes)
- Christoph will look at Mat's comment from
https://lists.01.org/pipermail/mptcp/2018-May/000620.html (should check
with RCU debugging tools?)
Comment: Is it guaranteed that RCU synchronization happens
between here and when the tcp_sock is freed? Do you need to set
SOCK_RCU_FREE?
Architecture proposal v2 for the receiver part by Peter and Mat:
- Peter found a bug, Mat is looking at that before sharing a v2.
mptcp_net-next:
- Peter confirms that creating subflows is still possible (related
to a question raised by Christoph at the last meeting)
Next steps: (almost same as after the last meeting)
- We hope to get an answer for Netdevconf before the next meeting,
nothing else we can do about that
- Mat & Peter: looking at the v2 of their patches
- Christoph: fixing some bugs in mptcp_trunk + check Mat's question
(RCU related)
- Ossama: looking at a userspace Open-Source code to use the
Open-Source Netlink PM
- Matthieu: propose a v2 for the PM Netlink, still should not change
the API, useful info for Ossama.
- As usual, update the wiki if there are new stuffs to put in!
Next meeting:
- proposition: the 24th of May. Usual time 9am PDT - 16:00 UTC (9am
PDT, 6pm CEST)
- open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180524
Feel free to comment these points and propose new ones for the next meeting!
Talk to you in two weeks,
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.
4 years
Weekly meeting - 17 May 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_20180517
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.
4 years