]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ipv4: rate limit updating of next hop exceptions with same pmtu
authorTimo Teräs <timo.teras@iki.fi>
Mon, 27 May 2013 20:46:32 +0000 (20:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2013 07:07:43 +0000 (00:07 -0700)
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>
net/ipv4/route.c

index 561a37833d86c3d3d13c002e4e7a18005f97b751..a4082be1b9b476b9315b4a013cd49c7fd9de0d73 100644 (file)
@@ -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);