Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp860582pxb; Tue, 1 Feb 2022 11:57:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzGlyKzFTMdmh51H4zPH5dZTKIr1GjRljY8bVPAZ/xihBpDMNA3HgoI18E/yYKXZXSJbQX X-Received: by 2002:a05:6402:50c:: with SMTP id m12mr26692549edv.141.1643745473395; Tue, 01 Feb 2022 11:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745473; cv=none; d=google.com; s=arc-20160816; b=ThS51XOH3CH2IspPWXgEjtp0NsbTNcSQYwdpELJYdBg6F6AOyjbUseBJtrTsJ02iF2 SwDuGFA8xFvrbpKAvTQvYpY6F8B4nukzqIw5x+ZRQxtL6xGvU4Te3/rEJyMrPyO6J3wD FC1VwM3YFwjD0uwS9SXu7D8vxe9nh7kvIstdvXuUZ9USCTe1zVF2pT72ERC8zfatH4zU QbiU3AGrFFLPjZ4wjrrymICfjrJ0K37ytgtM9nNN+bZFsp8v/van/1Q1XXHA7NjawJ12 N8YjmogaZ1uMEqmbfJ6oHP7cNEpV5gakYpt2Fp4pALyixCLVU7IhH95xA+QDIZUInBh1 RRqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3fas8RflQHAedoQWahLiHg2QNz4ubUY0CA3JvCnbtjg=; b=ZdTxLyHPiLP+RpYQofl+B3SZX2JB69mUVbnKoymp+0PHevUzjjsT+UxoujCe02ROuq Y9t69EEn3ijN2DA7Np/nmVr6rbJzkwlq4t7eLqN8TFrlkJXAAfn8uKUVWD9Xq+Th2S7l htfNx7X/dOf8fyoMYyXj0kXDBJCJkxvEIe9rgIKeKpbuPZMXmgvSZ+N1Hl+zEFMkLogF KxVDKSllcTRRL5xcAUoP1jLHt8qgM9JhTfxDbrJR3YLd/JJQ6pw77VexaotfmeJKaI/V DoTQMHABElP0Kt1ufEYrV9iUayg87tTlGBWjyePHDFbPB/olCMqry4Tp1IDCfKxi2oUr 96bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eLUnr8Z9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si10858667edx.440.2022.02.01.11.57.29; Tue, 01 Feb 2022 11:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eLUnr8Z9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359244AbiAaLGz (ORCPT + 99 others); Mon, 31 Jan 2022 06:06:55 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38196 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358345AbiAaLDo (ORCPT ); Mon, 31 Jan 2022 06:03:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 29C9E60EDB; Mon, 31 Jan 2022 11:03:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BA59C340E8; Mon, 31 Jan 2022 11:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627023; bh=8kwQ4IlCL4lt3evFQMydDkoqm2Wx6KwGPAVive888gE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLUnr8Z981yUUJiRFgfEuve5y9mbv3d41+TyT6L4JMQXhe5ghtpxjVdT6mMnjyWty AEElYYdY3HmB/fpk71Rpni+LKePYQa3l4hj2abMa6w2BTnhEgQ4/JHGXdkaCCNeuIn 1+arZfQjafGIz0k7FX+PFJgGOiy+pbfHrMLwxr2k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maksym Yaremchuk , Ido Schimmel , Amit Cohen , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 051/100] ipv6_tunnel: Rate limit warning messages Date: Mon, 31 Jan 2022 11:56:12 +0100 Message-Id: <20220131105222.155835649@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ido Schimmel commit 6cee105e7f2ced596373951d9ea08dacc3883c68 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: 09c6bbf090ec ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime") Reported-by: Maksym Yaremchuk Tested-by: Maksym Yaremchuk Signed-off-by: Ido Schimmel Reviewed-by: Amit Cohen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- net/ipv6/ip6_tunnel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1066,14 +1066,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();