From bbd807dfbf20506f5548b0297c430a09326e7c4b Mon Sep 17 00:00:00 2001 From: Brian Vazquez Date: Mon, 1 Feb 2021 17:41:32 +0000 Subject: 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 Signed-off-by: Jakub Kicinski --- include/net/dst.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/net/dst.h') 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; } -- cgit v1.2.3