Skip to contentSkip to conversation

netfilter: conntrack: tell compile to not inline nf_ct_resolve_clash

PATCH Applied Florian Westphal 2 participants 2 messages Nov 28, 2019 – Nov 29, 2019

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: conntrack: tell compile to not inline nf_ct_resolve_clash

At this time compiler inlines it, but this code will not be executed under normal conditions.

Also, no inlining allows to use "nf_ct_resolve_clash%return" perf probe.

---
 net/netfilter/nf_conntrack_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_core.c +4 -3
index 0af1898af2b8..739b193970b6 100644
@@ -895,9 +895,10 @@ static void nf_ct_acct_merge(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
 }
 
 /* Resolve race on insertion if this protocol allows this. */
-static int nf_ct_resolve_clash(struct net *net, struct sk_buff *skb,
-			       enum ip_conntrack_info ctinfo,
-			       struct nf_conntrack_tuple_hash *h)
+static __cold noinline int
+nf_ct_resolve_clash(struct net *net, struct sk_buff *skb,
+		    enum ip_conntrack_info ctinfo,
+		    struct nf_conntrack_tuple_hash *h)
 {
 	/* This is the conntrack entry already in hashes that won race. */
 	struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h);
Signature · 1 line
2.23.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Florian Westphal

At this time compiler inlines it, but this code will not be executed under normal conditions.

Also, no inlining allows to use "nf_ct_resolve_clash%return" perf probe.

Applied, thanks Florian.