From: rama nichanamatlu <rama.nichanamatlu@oracle.com>
To: netdev@vger.kernel.org
Subject: [PATCH] bonding: avoid repeated display of same link status change
Date: Thu, 9 Aug 2018 14:12:57 -0700 [thread overview]
Message-ID: <4d0ff757-ea60-2dae-cc66-45d3fe2dcca0@oracle.com> (raw)
From 9927a1c2a632d9479a80c63b7d9fda59ea8374bc Mon Sep 17 00:00:00 2001
From: Rama Nichanamatlu <rama.nichanamatlu@oracle.com>
Date: Tue, 31 Jul 2018 07:09:52 -0700
Subject: [PATCH] bonding: avoid repeated display of same link status change
When link status change needs to be committed and rtnl lock couldn't be
taken, avoid redisplay of same link status change message.
Signed-off-by: Rama Nichanamatlu <rama.nichanamatlu@oracle.com>
---
drivers/net/bonding/bond_main.c | 6 ++++--
include/net/bonding.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c
b/drivers/net/bonding/bond_main.c
index 63e3844..3dd1091 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2086,7 +2086,7 @@ 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 && !bond->rtnl_needed) {
netdev_info(bond->dev, "link status
down for %sinterface %s, disabling it in %d ms\n",
(BOND_MODE(bond) ==
BOND_MODE_ACTIVEBACKUP) ?
@@ -2126,7 +2126,7 @@ static int bond_miimon_inspect(struct bonding *bond)
commit++;
slave->delay = bond->params.updelay;
- if (slave->delay) {
+ if (slave->delay && !bond->rtnl_needed) {
netdev_info(bond->dev, "link status up
for interface %s, enabling it in %d ms\n",
slave->dev->name,
ignore_updelay ? 0 :
@@ -2300,9 +2300,11 @@ static void bond_mii_monitor(struct work_struct
*work)
if (!rtnl_trylock()) {
delay = 1;
should_notify_peers = false;
+ bond->rtnl_needed = true;
goto re_arm;
}
+ bond->rtnl_needed = false;
bond_for_each_slave(bond, slave, iter) {
bond_commit_link_state(slave,
BOND_SLAVE_NOTIFY_LATER);
}
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 808f1d1..4e76e5d 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -234,6 +234,7 @@ struct bonding {
struct dentry *debug_dir;
#endif /* CONFIG_DEBUG_FS */
struct rtnl_link_stats64 bond_stats;
+ u8 rtnl_needed;
};
#define bond_slave_get_rcu(dev) \
--
1.7.1
next reply other threads:[~2018-08-09 23:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 21:12 rama nichanamatlu [this message]
2018-08-11 16:41 ` [PATCH] bonding: avoid repeated display of same link status change David Miller
[not found] <1534191017-25630-1-git-send-email-rama.nichanamatlu@oracle.com>
2018-08-20 19:02 ` rama nichanamatlu
-- strict thread matches above, loose matches on Subject: below --
2018-09-17 7:20 mk.singh
2018-09-17 14:38 ` Eric Dumazet
2018-09-18 5:05 ` Manish Kumar Singh
2018-09-18 14:00 ` Eric Dumazet
2018-09-24 7:05 ` Manish Kumar Singh
2018-10-22 7:29 ` Manish Kumar Singh
2018-10-23 15:29 [PATCH] bonding:avoid " mk.singh
2018-10-23 15:54 ` Mahesh Bandewar (महेश बंडेवार)
2018-10-23 16:10 ` Eric Dumazet
2018-10-23 16:26 ` Michal Kubecek
2018-10-23 16:38 ` Michal Kubecek
2018-10-25 9:21 ` Manish Kumar Singh
2018-10-25 9:29 ` Michal Kubecek
2018-10-26 6:49 ` Manish Kumar Singh
2018-10-23 18:08 ` David Miller
2018-10-31 10:57 mk.singh
2018-11-03 6:31 ` David Miller
2018-11-04 19:41 ` Michal Kubecek
2018-11-20 10:41 ` Manish Kumar Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d0ff757-ea60-2dae-cc66-45d3fe2dcca0@oracle.com \
--to=rama.nichanamatlu@oracle.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).