summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorBrian Vazquez <brianvv@google.com>2021-02-01 20:41:31 +0300
committerJakub Kicinski <kuba@kernel.org>2021-02-04 01:51:39 +0300
commitf67fbeaebdc0356e0cbc94f4b099f45ebe174b02 (patch)
tree77b794d20e7e5ebfdbe63a7c899c96e787c50a08 /include/net
parent6585d7dc491d9d5e323ed52ee32ad071e04c9dfa (diff)
downloadlinux-f67fbeaebdc0356e0cbc94f4b099f45ebe174b02.tar.xz
net: use indirect call helpers for dst_mtu
This patch avoids the indirect call for the common case: ip6_mtu and ipv4_mtu Signed-off-by: Brian Vazquez <brianvv@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 3932e9931f08..9f474a79ed7d 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -194,9 +194,11 @@ dst_feature(const struct dst_entry *dst, u32 feature)
return dst_metric(dst, RTAX_FEATURES) & feature;
}
+INDIRECT_CALLABLE_DECLARE(unsigned int ip6_mtu(const struct dst_entry *));
+INDIRECT_CALLABLE_DECLARE(unsigned int ipv4_mtu(const struct dst_entry *));
static inline u32 dst_mtu(const struct dst_entry *dst)
{
- return dst->ops->mtu(dst);
+ return INDIRECT_CALL_INET(dst->ops->mtu, ip6_mtu, ipv4_mtu, dst);
}
/* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */