* [PATCH net-next v2 2/4] bonding: Do not ignore notifications for miimon-work-queue
@ 2015-03-21 5:39 Mahesh Bandewar
0 siblings, 0 replies; only message in thread
From: Mahesh Bandewar @ 2015-03-21 5:39 UTC (permalink / raw)
To: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
Nikolay Aleksandrov, David Miller
Cc: Mahesh Bandewar, Maciej Zenczykowski, netdev, Eric Dumazet
This patch adds code to reschedule the mii-work (aggressively)
just to handle the notification before resuming the regular
cycle.
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
drivers/net/bonding/bond_main.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 19eabea2d7d9..6da311509a2e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2143,8 +2143,11 @@ static void bond_mii_monitor(struct work_struct *work)
if (!bond_has_slaves(bond))
goto re_arm;
+ if (bond_get_notif_pending(bond, BOND_MII_NOTIF)) {
+ should_notify_peers = true;
+ goto re_arm;
+ }
rcu_read_lock();
-
should_notify_peers = bond_should_notify_peers(bond);
if (bond_miimon_inspect(bond)) {
@@ -2164,15 +2167,17 @@ static void bond_mii_monitor(struct work_struct *work)
rcu_read_unlock();
re_arm:
- if (bond->params.miimon)
- queue_delayed_work(bond->wq, &bond->mii_work, delay);
-
if (should_notify_peers) {
- if (!rtnl_trylock())
- return;
- call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
- rtnl_unlock();
+ if (!rtnl_trylock()) {
+ delay = 1;
+ bond_set_notif_pending(bond, BOND_MII_NOTIF);
+ } else {
+ call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
+ rtnl_unlock();
+ }
}
+ if (bond->params.miimon)
+ queue_delayed_work(bond->wq, &bond->mii_work, delay);
}
static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-21 5:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21 5:39 [PATCH net-next v2 2/4] bonding: Do not ignore notifications for miimon-work-queue Mahesh Bandewar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.