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, 6 months
Weekly meeting - 1 August 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_20180801
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, 10 months
[Weekly meetings] MoM - 26th of July 2018
by Matthieu Baerts
Hello,
We just had our 15th meeting with Mat, Ossama, Peter (Intel OTC),
Christoph (Apple) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Linux Plumber:
- we sent a proposition of talk but no news
- now a 2-days track
- there are new announcements on the list (new talks accepted)
mptcp_net-next:
- new patches (3) are coming from mptcp_trunk (and applied)
- sync with net-next done by Mat
- Christoph will look at upstreaming MPTCPv1 (first on mptcp_trunk)
Netdev's debriefing:
- we got good feedbacks:
- people want to have MPTCP upstream and are supportive (Tom
Herbert and Eric Dumazet)
- some concerns about not modifying binaries and still use MPTCP
(without LD_PRELOAD), something possible with mptcp_trunk.
- there were some discussions/reminders about using per cgroups
ebpf hooks (e.g. for API extension):
- BPF/netdev background:
http://vger.kernel.org/netconf2018_files/AlexeiStarovoitov_netconf2018.pdf
- skb buff: we got advises from Eric Dumazet: add a pointer at the
end is no longer costly (see the next topic)
- changes in TCP stack: we didn't got propositions/discussions about
that, what we could do then:
- either propose code change (RFC)
- having other possibilities to talk about architecture
- RFC about a design/API (internal API first before exposing
that to userspace)
- for the userspace API, it could be nice to expose subflows
or only a part of them (err queue, send queue info)
Mat and Peter's patches:
- can be updated after Eric Dumazet comments:
- it is fine to add a few bytes *as long as we don't touch them*
(not to affect cache misses)
- "size doesn't matter"... he said (somehow)
- Mat: could still be good to check if we need a separated queue
- Christoph: callback + memory generator:
- could be good in case of splitting (tcp_fragment: to point
to the same memory if it is linked to the same DSS)
- should be ok for the incoming and outgoing path
- TODO: write in the wiki a design based on Eric's idea (adding a
few bytes at the end of the SKB is OK)
- Mat will start that and share the wiki page.
Next steps:
- Peter: working on MP_JOIN stuff
- Christoph: MPTCPv1 + bug fixes + test mptcp_net-next
- Mat: new design + new test setup between two VMs but difficult to
track regression (for mptcp_net-next)
- Matth: use recent kernel and try to test mptcp_net-next with our
test-suite. + update netlink code after that.
- Ossama: more debugging on userspace code
Next meeting:
- We propose to have it next Wednesday this time to have more people
available, the 1st of August then. Usual time 9am PDT - 16:00 UTC (9am
PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180801
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.
3 years, 11 months
[PATCH 0/2] Forward-ports from mptcp_trunk
by Christoph Paasch
Two of the recent additions to mptcp_trunk.
Christoph Paasch (2):
mptcp: Fix: Correct version-negotiation when SYN-cookies are set
mptcp: Disable MPTCP when interface is non-MPTCP
include/net/mptcp.h | 6 +++---
net/mptcp/mptcp_ctrl.c | 29 +++++++++++++++++++++--------
2 files changed, 24 insertions(+), 11 deletions(-)
--
2.16.2
3 years, 11 months
Weekly meeting - 26 July 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_20180726
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
[PATCH] mptcp:fullmesh: fix compilation warning if no IPv6
by Christoph Paasch
From: Matthieu Baerts <matthieu.baerts(a)tessares.net>
if_idx would be seen as an unitialized variable even if it should never
happen in case of !CONFIG_IPV6. But let makes the compiler happy!
Fixes: 9e763119cccc6 (mptcp: Check interface index in fullmesh pm)
Signed-off-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
Signed-off-by: Christoph Paasch <cpaasch(a)apple.com>
(cherry picked from commit e2b2f250f15fe9c4442483c1263af83cf8d8a0d5)
Signed-off-by: Christoph Paasch <cpaasch(a)apple.com>
---
net/mptcp/mptcp_fullmesh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/mptcp_fullmesh.c b/net/mptcp/mptcp_fullmesh.c
index cbeea9b83910..1e12af79a1b8 100644
--- a/net/mptcp/mptcp_fullmesh.c
+++ b/net/mptcp/mptcp_fullmesh.c
@@ -1301,9 +1301,9 @@ static void full_mesh_new_session(const struct sock *meta_sk)
struct fullmesh_priv *fmp = fullmesh_get_priv(mpcb);
const struct mptcp_fm_ns *fm_ns = fm_get_ns(sock_net(meta_sk));
struct tcp_sock *master_tp = tcp_sk(mpcb->master_sk);
- int i, index, if_idx;
+ int i, index, if_idx = 0;
union inet_addr saddr, daddr;
- sa_family_t family;
+ sa_family_t family = AF_INET;
bool meta_v4 = meta_sk->sk_family == AF_INET;
/* Init local variables necessary for the rest */
--
2.16.2
3 years, 11 months
Weekly meeting - canceled this week
by Matthieu Baerts
Hello,
With Mat, Peter and Christoph, we are proposing to cancel our meeting
this week. Not all of us are available this week and we would prefer to
be all present to debrief what we did last week.
Feel free to say something if you have (urgent) topic(s) you which to
discuss.
If you have other topics that you would like to discuss next week, as
always, feel free to add them in the list ;-)
https://annuel2.framapad.org/p/mptcp_upstreaming_20180726
Speak 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
LPC proposal draft
by Mat Martineau
Hello -
Those of us in the weekly web conference yesterday discussed options for
a Linux Plumber's Conference networking track talk
(http://vger.kernel.org/lpc-networking.html). The deadline is coming up
very soon, on Wednesday, 11 July.
Here's a draft proposal, please comment!
"""
Implementing Multipath TCP requires both adding a layer above TCP and
modifying the core in a number of places. The layer additions are
relatively straightforward: adding a new IPPROTO_MPTCP protocol type,
overriding existing callbacks from the IP layer, and adding to TCP option
handling. But even after extensive efforts to minimize changes to the TCP
core there are a handful of modifications required in order to support
MPTCP. Unlike protocols that layer cleanly entirely above TCP, MPTCP must
integrate with low-level TCP operations involving receive windows, sending
and receiving ACKs, and the RST and FIN signals. We will show where the
TCP core will be affected, why the changes cannot be avoided, and what we
have done to avoid impacting TCP performance.
"""
--
Mat Martineau
Intel OTC
3 years, 11 months
[Weekly meetings] MoM - 5th of July 2018
by Matthieu Baerts
Hello,
We just had our 14th meeting with Mat, Ossama, Peter (Intel OTC),
Christoph (Apple) and myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Netdev paper:
- We just fixed a few details about the phrasing
- Remaining topic: the introduction that Olivier would like to improve.
- Matthieu: will send a new version tomorrow (still possible to do
some corrections, even next week, but just in case we forget!)
Netdev Slides:
- We did some comments directly on the slides
- Matthieu: will send a new version on Monday, just in case we forget
Netdev in Montreal:
- if you want to discuss about MPTCP, feel free to contact one of us
going there or on the ML!
Linux Plumber conf:
- we will focus on technical aspects, maybe focus in changes in TCP
core (and struct skbuff?)
- Mat and Peter will look at producing a description this end of the
week.
Next steps:
- Matthieu:
- paper: improve the introduction with Olivier
- slides: removed last TODO in the slides
- re-check the timing with a dry-run
- Christoph & Matthieu: support Belgium soccer team tomorrow!
- Mat:
- slides: improve his part, maybe add some parts in the backup
slides desk
- slides: dry-run and check the timing
- Linux Plumber Conf: prepare a description with Peter.
- 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:
- There will no be any meeting next week online but many on site
- It can change but next one should be the 19th of July. Usual time
9am PDT - 16:00 UTC (9am PDT, 6pm CEST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20180719
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.
3 years, 11 months