summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-05-27 20:46:32 +0000
committerDavid S. Miller <davem@davemloft.net>2013-06-03 00:07:43 -0700
commitf016229e303c294afac721de4cd4427e634950ea (patch)
tree9289683f82bc09ccadba983778f39e842ddaa2f2 /net/ipv4
parent387aa65a89434abe3128d36d1a6fc3842c94905d (diff)
downloadop-kernel-dev-f016229e303c294afac721de4cd4427e634950ea.zip
op-kernel-dev-f016229e303c294afac721de4cd4427e634950ea.tar.gz
ipv4: rate limit updating of next hop exceptions with same pmtu
The tunnel devices call update_pmtu for each packet sent, this causes contention on the fnhe_lock. Ignore the pmtu update if pmtu is not actually changed, and there is still plenty of time before the entry expires. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 561a378..a4082be 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -947,6 +947,10 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
if (mtu < ip_rt_min_pmtu)
mtu = ip_rt_min_pmtu;
+ if (rt->rt_pmtu == mtu &&
+ time_before(jiffies, dst->expires - ip_rt_mtu_expires / 2))
+ return;
+
rcu_read_lock();
if (fib_lookup(dev_net(dst->dev), fl4, &res) == 0) {
struct fib_nh *nh = &FIB_RES_NH(res);
OpenPOWER on IntegriCloud