From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29698AD4B for ; Sun, 9 Jul 2023 15:13:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B21C9C611B7; Sun, 9 Jul 2023 15:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688915595; bh=tPlnrUOB44ixW+YBquQhtPmxhbOHRKsLyCXO3Ctx5n8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WnzdxPuwXCns771s1GEMFAk+ro0/IfZlf2O1hsC2DMU6N7DJTbyAFGOZb0VSD5VKI +2V1k07kSvzNZIhY4MrrSuXQa+KLKI1UiPN1aeWhKGALyTFqL3LN4/IV94IettZok7 QGNxW3WuennZC97dXraVHc3tIwVa+0xcQOtJkKVSU6wbazUI1OyEV5d1N/odVISl0E 3pbnpxcjX3OdF0uKBzDUn8O5CcyCdiPJ/tSaL9cht46zGkCdW49UmZPbRfgOWVHfiN KKVB6WMDEpXVOMBl88yV7/3JDrlB3+9pce3THJDVHscYcaGkBxHedBHg5e99GMsTf1 Vpm2/sJ362nLg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jakub Kicinski , Jiri Pirko , Sasha Levin , jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.4 11/26] devlink: make health report on unregistered instance warn just once Date: Sun, 9 Jul 2023 11:12:40 -0400 Message-Id: <20230709151255.512931-11-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230709151255.512931-1-sashal@kernel.org> References: <20230709151255.512931-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.2 Content-Transfer-Encoding: 8bit From: Jakub Kicinski [ Upstream commit 6f4b98147b8dfcabacb19b5c6abd087af66d0049 ] Devlink health is involved in error recovery. Machines in bad state tend to be fairly unreliable, and occasionally get stuck in error loops. Even with a reasonable grace period devlink health may get a thousand reports in an hour. In case of reporting on an unregistered devlink instance the subsequent reports don't add much value. Switch to WARN_ON_ONCE() to avoid flooding dmesg and fleet monitoring dashboards. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20230531015523.48961-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/devlink/health.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/devlink/health.c b/net/devlink/health.c index 0839706d5741a..194340a8bb863 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -480,7 +480,7 @@ static void devlink_recover_notify(struct devlink_health_reporter *reporter, int err; WARN_ON(cmd != DEVLINK_CMD_HEALTH_REPORTER_RECOVER); - WARN_ON(!xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED)); + ASSERT_DEVLINK_REGISTERED(devlink); msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); if (!msg) -- 2.39.2