aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorBrian Vazquez <brianvv@google.com>2021-02-01 17:41:32 +0000
committerJakub Kicinski <kuba@kernel.org>2021-02-03 14:51:40 -0800
commitbbd807dfbf20506f5548b0297c430a09326e7c4b (patch)
treecb2a2d1c678a1b3546d119d6b3a32ebb8ec7818e /include/net/dst.h
parentnet: use indirect call helpers for dst_mtu (diff)
downloadlinux-dev-bbd807dfbf20506f5548b0297c430a09326e7c4b.tar.xz
linux-dev-bbd807dfbf20506f5548b0297c430a09326e7c4b.zip
net: indirect call helpers for ipv4/ipv6 dst_check functions
This patch avoids the indirect call for the common case: ip6_dst_check and ipv4_dst_check Signed-off-by: Brian Vazquez <brianvv@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 9f474a79ed7d..26f134ad3a25 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -459,10 +459,15 @@ static inline int dst_input(struct sk_buff *skb)
ip6_input, ip_local_deliver, skb);
}
+INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
+ u32));
+INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
+ u32));
static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
{
if (dst->obsolete)
- dst = dst->ops->check(dst, cookie);
+ dst = INDIRECT_CALL_INET(dst->ops->check, ip6_dst_check,
+ ipv4_dst_check, dst, cookie);
return dst;
}