lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 11 Mar 2015 22:54:38 -0700
From:	Mahesh Bandewar <maheshb@...gle.com>
To:	Jay Vosburgh <j.vosburgh@...il.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	Veaceslav Falico <vfalico@...il.com>,
	Nikolay Aleksandrov <nikolay@...hat.com>,
	David Miller <davem@...emloft.net>
Cc:	Mahesh Bandewar <maheshb@...gle.com>,
	Maciej Zenczykowski <maze@...gle.com>,
	netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH net-next 3/4] bonding: Do not ignore notifications for AD-work-queue

This patch adds code to reschedule the AD-work (aggressively)
just to handle the notification before resuming the regular
cycle.

Signed-off-by: Mahesh Bandewar <maheshb@...gle.com>
---
 drivers/net/bonding/bond_3ad.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index d5dc7c659773..8e647bffa335 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2178,6 +2178,12 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
 	struct port *port;
 	bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
 	bool update_slave_arr = false;
+	unsigned long delay;
+
+	if (bond_get_notif_pending(bond, BOND_AD_NOTIF)) {
+		should_notify_rtnl = true;
+		goto re_arm_notify;
+	}
 
 	/* Lock to protect data accessed by all (e.g., port->sm_vars) and
 	 * against running with bond_3ad_unbind_slave. ad_rx_machine may run
@@ -2244,11 +2250,19 @@ re_arm:
 	if (update_slave_arr)
 		bond_slave_arr_work_rearm(bond, 0);
 
-	if (should_notify_rtnl && rtnl_trylock()) {
-		bond_slave_state_notify(bond);
-		rtnl_unlock();
+re_arm_notify:
+	delay = ad_delta_in_ticks;
+	if (should_notify_rtnl) {
+		if (rtnl_trylock()) {
+			bond_slave_state_notify(bond);
+			rtnl_unlock();
+			bond_set_notif_pending(bond, BOND_AD_NOTIF, 0);
+		} else {
+			delay = 1;
+			bond_set_notif_pending(bond, BOND_AD_NOTIF, 1);
+		}
 	}
-	queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
+	queue_delayed_work(bond->wq, &bond->ad_work, delay);
 }
 
 /**
-- 
2.2.0.rc0.207.ga3a616c

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ