Skip to content

Commit f016229

Browse files
fableddavem330
authored andcommitted
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>
1 parent 387aa65 commit f016229

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/ipv4/route.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,10 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
947947
if (mtu < ip_rt_min_pmtu)
948948
mtu = ip_rt_min_pmtu;
949949

950+
if (rt->rt_pmtu == mtu &&
951+
time_before(jiffies, dst->expires - ip_rt_mtu_expires / 2))
952+
return;
953+
950954
rcu_read_lock();
951955
if (fib_lookup(dev_net(dst->dev), fl4, &res) == 0) {
952956
struct fib_nh *nh = &FIB_RES_NH(res);

0 commit comments

Comments
 (0)