Skip to content

Commit 6cee105

Browse files
idoschdavem330
authored andcommitted
ipv6_tunnel: Rate limit warning messages
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>
1 parent e2f0820 commit 6cee105

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
@@ -1036,14 +1036,14 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
10361036

10371037
if (unlikely(!ipv6_chk_addr_and_flags(net, laddr, ldev, false,
10381038
0, IFA_F_TENTATIVE)))
1039-
pr_warn("%s xmit: Local address not yet configured!\n",
1040-
p->name);
1039+
pr_warn_ratelimited("%s xmit: Local address not yet configured!\n",
1040+
p->name);
10411041
else if (!(p->flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) &&
10421042
!ipv6_addr_is_multicast(raddr) &&
10431043
unlikely(ipv6_chk_addr_and_flags(net, raddr, ldev,
10441044
true, 0, IFA_F_TENTATIVE)))
1045-
pr_warn("%s xmit: Routing loop! Remote address found on this node!\n",
1046-
p->name);
1045+
pr_warn_ratelimited("%s xmit: Routing loop! Remote address found on this node!\n",
1046+
p->name);
10471047
else
10481048
ret = 1;
10491049
rcu_read_unlock();

0 commit comments

Comments
 (0)