summaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorBrian Vazquez <brianvv@google.com>2021-02-01 17:41:31 +0000
committerJakub Kicinski <kuba@kernel.org>2021-02-03 14:51:39 -0800
commitf67fbeaebdc0356e0cbc94f4b099f45ebe174b02 (patch)
tree77b794d20e7e5ebfdbe63a7c899c96e787c50a08 /include/net/dst.h
parent6585d7dc491d9d5e323ed52ee32ad071e04c9dfa (diff)
downloadlinux-stable-f67fbeaebdc0356e0cbc94f4b099f45ebe174b02.tar.gz
linux-stable-f67fbeaebdc0356e0cbc94f4b099f45ebe174b02.tar.bz2
linux-stable-f67fbeaebdc0356e0cbc94f4b099f45ebe174b02.zip
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/dst.h')
-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 */