mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
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: 09c6bbf090
("[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>
This commit is contained in:
parent
e2f08207c5
commit
6cee105e7f
@ -1036,14 +1036,14 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
|
||||
|
||||
if (unlikely(!ipv6_chk_addr_and_flags(net, laddr, ldev, false,
|
||||
0, IFA_F_TENTATIVE)))
|
||||
pr_warn("%s xmit: Local address not yet configured!\n",
|
||||
p->name);
|
||||
pr_warn_ratelimited("%s xmit: Local address not yet configured!\n",
|
||||
p->name);
|
||||
else if (!(p->flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) &&
|
||||
!ipv6_addr_is_multicast(raddr) &&
|
||||
unlikely(ipv6_chk_addr_and_flags(net, raddr, ldev,
|
||||
true, 0, IFA_F_TENTATIVE)))
|
||||
pr_warn("%s xmit: Routing loop! Remote address found on this node!\n",
|
||||
p->name);
|
||||
pr_warn_ratelimited("%s xmit: Routing loop! Remote address found on this node!\n",
|
||||
p->name);
|
||||
else
|
||||
ret = 1;
|
||||
rcu_read_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user