Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2210527rdb; Tue, 20 Feb 2024 23:51:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFb1/vqQWrHxQj4VNwcvkG33zlSuIgoJL0XDAKs020sWCd6SOKGfEg2puy2W3o6cRIZeTynq/H5/8DNF19mRT9yQwIinixccgfJsPTvg== X-Google-Smtp-Source: AGHT+IHLm6XrRtiUBxwPMI1mHYCF7ATzOk2zhL+qhtuNwb6iEeA/gC0mMEuduMtNlHCloD58Kov3 X-Received: by 2002:a17:906:7c8:b0:a3e:e524:b20a with SMTP id m8-20020a17090607c800b00a3ee524b20amr4642332ejc.25.1708501877706; Tue, 20 Feb 2024 23:51:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708501877; cv=pass; d=google.com; s=arc-20160816; b=CDgb53GwS5dyhvgnsvfb1kndKJaouFYL7ysIricanBx2zxiLD25csPUvNSQ+dYOhJd LibK2mBUmXWArL8Q4e1sv6o/swho43ryW+5kVRYcTAhP9OrTRMNHRq8Mhur9ucg4+Gc5 8fu2u0kKVLKm1TZLTCmSIwWwmyzvP1lwXtE1UJHvV2fY4ALs89qctvakmK34kpmXbD2h 2XYBch8ZblMulTBg0DRSqg5wngQZ6BcJwB3g/1ES2qyUnOftcSkaTGDgiy33kmtXrVjm F/UYepIiyDskuNHKlwrte9AiUpd5eEb/bLwnpiGlRZwryhbjFFn73G/8NzI10w5z/MHj WvSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5WxYfPd5VUxR2AqwN/E1W/Qk2rLQTXMyaj5oNoN/9CA=; fh=+W9zPBJ6cIcrWPAxZbtqnOo7J39uZI7IouZEaEIkcYQ=; b=YnvAOIyvnK0/yrNbqNMFEQNiI48rzmKwqWdyipssBsouP3/NA+EyCsBP3ZApWoOVvE YmlzLHyAMQMdTf2rgzTXqAyQncJfxUtp6MIHXlFYtLH6gsWB4/4x6nh7jn6J6VAkMA5x Tgo+bz30eYrHBg4L216eZScG3z1n4aMIAS/c16KkEIO7R4XzdMnxHvG0Ps0jpxW+6xmW 4WH+/pn59PeruCeU0OlDhCbUaBFi4bt6goEQsWH2HBAN2ucyKG9xkwIH8JSuK93ftlnd 9w+7F4agTZh32Yb9XexSvy/DN6KxWAIP1P15/QCcojmyrnsrHSfPV7A22v8DgbktaTNy GCTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=na7ZfenU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-74262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y20-20020a056402359400b005641883d724si4196881edc.674.2024.02.20.23.51.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 23:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=na7ZfenU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-74262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 56EB61F26C94 for ; Wed, 21 Feb 2024 07:51:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5B023B785; Wed, 21 Feb 2024 07:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="na7ZfenU" Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63A5F3AC26; Wed, 21 Feb 2024 07:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708501863; cv=none; b=fkVzDIFlzAjgsV45toAOKpWmIdiGSx33t41DKO4bNGD9HXFmc+sO+zW9VGvnC98VNkLXlFU5ME09ALGO08NtCr8okb+LkjOzEC2eGTnUkRm7eiwllFlGVjoPKER2AfQTzHzL7gdR7onkPtp2E6hHDKCXssXmLGPXl/GgdUvILnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708501863; c=relaxed/simple; bh=WMEVPRk/cMv9MwbUdnJDZQNfMyeamxwLXtEaC9Nkglg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HIGARl/pLUIzwjXiio2HPoVZB64md/HnHa5LHNkG6je6xElBv5ZBG3W4xYyOvVHH4TxOozji3jOgAclv/4v/xGnlKFJStYejM6JWEayo0xPQR8lQH/JSVR+mI/sSqLrczrjxCq2+bp/h9WhSTWhZJUiJT4qKFDuTgdGmxTdHmZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=na7ZfenU; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-3bd72353d9fso4722303b6e.3; Tue, 20 Feb 2024 23:51:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708501861; x=1709106661; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5WxYfPd5VUxR2AqwN/E1W/Qk2rLQTXMyaj5oNoN/9CA=; b=na7ZfenURI5j8c6yWx2v3wV7UjEFr03fWdPvu9cekMaPFsG68tbWsJSxep2vx9/uzl AQcT+I0feD2LyVME9Wmgw+FArgdO5+bq6R23wjVqaFKRjqiklNQcoCkgOI/RwUpueZ9L GqpnSGrFNWMuOxDmquDNEtsu3haAPr6tI/+jM1cusOb8fD5ewJZcOJ4UAvXlBKaqufiU ZYwS+pJptDkQ6bkB4ums5/ScFo677xQjEm5KQQLFwX7+A4IQUYD38wxH3jTlj1GWzOd0 mNTylBkpHtJ83dYNuCu1RGT55gFv7XrSgzyqTlb3QCOaghHIj/R2M3S6xaD3/8zFAcuK j2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708501861; x=1709106661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5WxYfPd5VUxR2AqwN/E1W/Qk2rLQTXMyaj5oNoN/9CA=; b=SdxeWKKqrHp62L3QLrLPQ/sbNs89nsGNGFC3wzJV63TB31upiyVLZenlEDCiLr2v1f bGGHxSZjYIXKYTItKIZQv0TzhIWRf0q5FYlXervDb/1PH2mE7pJkPbtzBvbPJ1L+nbqS TGRB6Tb32xrPm7SEbIT7v4JtzDwrgItpGqsozEp2PkRYFMd8MFyasBQDSHoRwMOGdgIv DaFMMrC56DoZQw0DE8N2aAMQjbU+To1WZFolnk9UWM4fqo3tBAJJIQZ0mExJGnzNAzIj zAzmg2ZqB6DRi+ZGbHaxZL4BW7qQOqqcga5dPYtIhMvBjnk3VY1L5IpPorzlJGkCHXCG /VFA== X-Forwarded-Encrypted: i=1; AJvYcCWQf9dowa4Uwkaw+tTpok78BCxdtUsrFJ3rvb93zomyPPXcup2CRN+ceP630heFed5NAh+Tv3MD5R6MR1+18qIGhHNVUP2H6uGBMQ3klxW3sFlZipqTyj+0Izxr8BDEv5w83oQ5 X-Gm-Message-State: AOJu0YxVX0//VGbEvHE9Tr74HWjq6OOxX4g4HVZ0kZ5bkzsHdxph3wJI Fdidu3D0mZQ51t22G1FW2/4cm4dBDLLK6st2RRdUYNpIaqnwzdyi X-Received: by 2002:a05:6808:220c:b0:3bf:f4bb:7630 with SMTP id bd12-20020a056808220c00b003bff4bb7630mr23413978oib.45.1708501861356; Tue, 20 Feb 2024 23:51:01 -0800 (PST) Received: from Laptop-X1 ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id by41-20020a056a0205a900b005dc4ce8d2a4sm6745749pgb.58.2024.02.20.23.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 23:51:00 -0800 (PST) Date: Wed, 21 Feb 2024 15:50:55 +0800 From: Hangbin Liu To: Praveen Kumar Kannoju Cc: j.vosburgh@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rajesh.sivaramasubramaniom@oracle.com, rama.nichanamatlu@oracle.com, manjunath.b.patil@oracle.com Subject: Re: [PATCH net-next v5] bonding: rate-limit bonding driver inspect messages Message-ID: References: <20240221050809.4372-1-praveen.kannoju@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240221050809.4372-1-praveen.kannoju@oracle.com> On Wed, Feb 21, 2024 at 10:38:09AM +0530, Praveen Kumar Kannoju wrote: > Through the routine bond_mii_monitor(), bonding driver inspects and commits > the slave state changes. During the times when slave state change and > failure in aqcuiring rtnl lock happen at the same time, the routine > bond_mii_monitor() reschedules itself to come around after 1 msec to commit > the new state. > > During this, it executes the routine bond_miimon_inspect() to re-inspect > the state chane and prints the corresponding slave state on to the console. > Hence we do see a message at every 1 msec till the rtnl lock is acquired > and state chage is committed. > > This patch doesn't change how bond functions. It only simply limits this > kind of log flood. > > Signed-off-by: Praveen Kumar Kannoju > --- > v5: > - Redundant indentation addressed. > v4: https://lore.kernel.org/all/20240220050437.5623-1-praveen.kannoju@oracle.com/ > - Rectification in the patch subject and versioning details. > v3: https://lore.kernel.org/lkml/20240219133721.4567-1-praveen.kannoju@oracle.com/ > - Commit message is modified to provide summary of the issue, because of > which rate-limiting the bonding driver messages is needed. > v2: https://lore.kernel.org/lkml/20240215172554.4211-1-praveen.kannoju@oracle.com/ > - Use exising net_ratelimit() instead of introducing new rate-limit > parameter. > v1: https://lore.kernel.org/lkml/20240214044245.33170-1-praveen.kannoju@oracle.com/ > --- > drivers/net/bonding/bond_main.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > index 4e0600c..c8482cd 100644 > --- a/drivers/net/bonding/bond_main.c > +++ b/drivers/net/bonding/bond_main.c > @@ -2609,12 +2609,12 @@ static int bond_miimon_inspect(struct bonding *bond) > bond_propose_link_state(slave, BOND_LINK_FAIL); > commit++; > slave->delay = bond->params.downdelay; > - if (slave->delay) { > + if (slave->delay && net_ratelimit()) { > slave_info(bond->dev, slave->dev, "link status down for %sinterface, disabling it in %d ms\n", > (BOND_MODE(bond) == > - BOND_MODE_ACTIVEBACKUP) ? > - (bond_is_active_slave(slave) ? > - "active " : "backup ") : "", > + BOND_MODE_ACTIVEBACKUP) ? > + (bond_is_active_slave(slave) ? > + "active " : "backup ") : "", Why these lines changed? Hangbin