Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3389941pxb; Mon, 17 Jan 2022 19:24:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcakE6XxG2Jtgz2S33Zr6xGEv5d/SbYAZkhFmophpdOzlwr9X9IYUa64ECpaCtcR6gadZT X-Received: by 2002:a63:7946:: with SMTP id u67mr21524293pgc.83.1642476245082; Mon, 17 Jan 2022 19:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476245; cv=none; d=google.com; s=arc-20160816; b=Y7mztqPKYxcKtyk8voMHfazyXVQQp/g6b9N7LorkbmPKoAKEHg+Yng99mF8kVksrTC qvQWOKyh0bo5BRqn751rlZaGIWQkjds30tJTMNv4IINfEVyhfg0ZzIa8Jn0VrFDdYnxa Pgypfja6n0Op9Cf21uS5aeG9nh370epnVyZgB50Rqhe5/0nBkRyGUmuNUH1F0vd4jnzd GbcyCLZEZQRrfc2HyD/sRTKeWadLt3/AVxMwZPIwd5kT77m693SC61CauIQBJ7/WV2hz MAnUb/dJO0LLzVTqTkZLAkjTQfu0mW4ISkQ3zjBanuqC6RERxzyvE7kyhAc+ApX2qEEt ynWw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JXmNIg+n7I/ItAgKk+U5shaeoW+m8BpdQ6itQMcVxoQ=; b=q1noXvSuq9fe7nflSHFjENRqpVP/hxrrKw/gVLgi73XR4hf48KlAMzmgQqovhVtdBH TQco5p+HgWeoIdtYVRNqmb9MG2tmC5RaCqro2XImtJbu1RgTxzVPkMSh4lYxiFIbioka zuguAi9M8MvhaiK8oqh1V0cs4ciID5bQzgs2RkChW0NsIquVpWmbU5BQszQ7od1wyXlc y/CsTFyiL+uGdOX6ooQCHS75TLgqiCEx3yxRk4ODYhCEQsHHzlf4xFGobBaiGW9EAruv Tf7m1Vhys1VSvX0Rdb3YePzZmJZs5ewqUMOGUHnaNRm9Pv2e/5MM8k2rGlbCV4+ubHfc yvmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kzR1MQvl; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si17947267pfc.69.2022.01.17.19.23.52; Mon, 17 Jan 2022 19:24:05 -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=@kernel.org header.s=k20201202 header.b=kzR1MQvl; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245480AbiARCdV (ORCPT + 99 others); Mon, 17 Jan 2022 21:33:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344077AbiARC2w (ORCPT ); Mon, 17 Jan 2022 21:28:52 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C0B3C0612AB; Mon, 17 Jan 2022 18:26:00 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 2F0D3B81250; Tue, 18 Jan 2022 02:26:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACFF0C36AF2; Tue, 18 Jan 2022 02:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472758; bh=eFTZK+BDoNPOY/zrtFGms/hGWY8oU/F68SCn7MXvx3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzR1MQvllkGvyp2CVrHCp+esmExNidVv91PN9wORziV67p9UoBxjB1CM3WDYt1d6O No7sd422mc+7A/d2ThUwwWp/UZabExsHt2iBn4Rk1tIPKlR46Mx0I9hxalIYRRouw5 3OZh3/jBDdCSjikVey6lubJf3n4iGRnnzgzfnKtb2wW7OJORVC1WGRCrcx5Zebh/wU jJ4nuc2y1nh+oc7XvKcMJlhFUSarcBwenGzfOx9W6sw2x1R6o4kS9QdjN4GI7isi2H fSYT8rn2bznG/n0ZBxMNqYv1Wa9YI9sV87rgPuBPa7eWm76G8wIQFM/oy6SkGTPB9X ZqKCGCbTS2tmA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Suresh Kumar , Suresh Kumar , "David S . Miller" , Sasha Levin , j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, kuba@kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 127/217] net: bonding: debug: avoid printing debug logs when bond is not notifying peers Date: Mon, 17 Jan 2022 21:18:10 -0500 Message-Id: <20220118021940.1942199-127-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suresh Kumar [ Upstream commit fee32de284ac277ba434a2d59f8ce46528ff3946 ] Currently "bond_should_notify_peers: slave ..." messages are printed whenever "bond_should_notify_peers" function is called. +++ Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Received LACPDU on port 1 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Rx Machine: Port=1, Last State=6, Curr State=6 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): partner sync=1 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 ... Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Received LACPDU on port 2 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Rx Machine: Port=2, Last State=6, Curr State=6 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): partner sync=1 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 +++ This is confusing and can also clutter up debug logs. Print logs only when the peer notification happens. Signed-off-by: Suresh Kumar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ff8da720a33a7..0ac964359fbfe 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1096,9 +1096,6 @@ static bool bond_should_notify_peers(struct bonding *bond) slave = rcu_dereference(bond->curr_active_slave); rcu_read_unlock(); - netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n", - slave ? slave->dev->name : "NULL"); - if (!slave || !bond->send_peer_notif || bond->send_peer_notif % max(1, bond->params.peer_notif_delay) != 0 || @@ -1106,6 +1103,9 @@ static bool bond_should_notify_peers(struct bonding *bond) test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state)) return false; + netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n", + slave ? slave->dev->name : "NULL"); + return true; } -- 2.34.1