Skip to content

Commit feb770c

Browse files
idoschgregkh
authored andcommitted
ipv6_tunnel: Rate limit warning messages
commit 6cee105 upstream. The warning messages can be invoked from the data path for every packet transmitted through an ip6gre netdev, leading to high CPU utilization. Fix that by rate limiting the messages. Fixes: 09c6bbf ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime") Reported-by: Maksym Yaremchuk <maksymy@nvidia.com> Tested-by: Maksym Yaremchuk <maksymy@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 00849de commit feb770c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎net/ipv6/ip6_tunnel.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,14 +1066,14 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
10661066

10671067
if (unlikely(!ipv6_chk_addr_and_flags(net, laddr, ldev, false,
10681068
0, IFA_F_TENTATIVE)))
1069-
pr_warn("%s xmit: Local address not yet configured!\n",
1070-
p->name);
1069+
pr_warn_ratelimited("%s xmit: Local address not yet configured!\n",
1070+
p->name);
10711071
else if (!(p->flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) &&
10721072
!ipv6_addr_is_multicast(raddr) &&
10731073
unlikely(ipv6_chk_addr_and_flags(net, raddr, ldev,
10741074
true, 0, IFA_F_TENTATIVE)))
1075-
pr_warn("%s xmit: Routing loop! Remote address found on this node!\n",
1076-
p->name);
1075+
pr_warn_ratelimited("%s xmit: Routing loop! Remote address found on this node!\n",
1076+
p->name);
10771077
else
10781078
ret = 1;
10791079
rcu_read_unlock();

0 commit comments

Comments
 (0)