Skip to contentSkip to conversation

bonding: Initialize the ALB work queue for lb mode only.

PATCH Superseded Mahesh Bandewar 2 participants 2 messages Apr 2, 2014

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 3/5 bonding: Initialize the ALB work queue for lb mode only.

micro change to initialize / cancel the ALB work queue only if the mode selected is ALB or TLB.

Change-Id I27a6cf65f72819889bf15b68f6ef4fca7d617186

---
v2:
Rebase
v3:
Rebase

 drivers/net/bonding/bond_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +4 -2
index 6e96d510bc8d..676db41b98bc 100644
@@ -3046,7 +3046,8 @@ static void bond_work_init_all(struct bonding *bond)
 {
 	INIT_DELAYED_WORK(&bond->mcast_work,
 			  bond_resend_igmp_join_requests_delayed);
-	INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
+	if (bond_is_lb(bond))
+		INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
 	INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
 	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
 		INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);
@@ -3059,7 +3060,8 @@ static void bond_work_cancel_all(struct bonding *bond)
 {
 	cancel_delayed_work_sync(&bond->mii_work);
 	cancel_delayed_work_sync(&bond->arp_work);
-	cancel_delayed_work_sync(&bond->alb_work);
+	if (bond_is_lb(bond))
+		cancel_delayed_work_sync(&bond->alb_work);
 	cancel_delayed_work_sync(&bond->ad_work);
 	cancel_delayed_work_sync(&bond->mcast_work);
 }
Signature · 1 line
1.9.1.423.g4596e3a
#1 lore raw
Quoted 29 lines · Mahesh Bandewar

micro change to initialize / cancel the ALB work queue only if the mode selected is ALB or TLB.

Change-Id I27a6cf65f72819889bf15b68f6ef4fca7d617186

---
v2:
Rebase
v3:
Rebase

 drivers/net/bonding/bond_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +2 -1
index 6e96d510bc8d..676db41b98bc 100644
@@ -3046,7 +3046,8 @@ static void bond_work_init_all(struct bonding *bond)
 {
 	INIT_DELAYED_WORK(&bond->mcast_work,
 			  bond_resend_igmp_join_requests_delayed);
-	INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
+	if (bond_is_lb(bond))
+		INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
 	INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
 	if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
 		INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);

drivers/net/bonding/bond_main.c static void bond_work_cancel_all(struct bonding *bond) · line 3067

Quoted 9 lines
drivers/net/bonding/bond_main.c +2 -1
@@ -3059,7 +3060,8 @@ static void bond_work_cancel_all(struct bonding *bond)
 {
 	cancel_delayed_work_sync(&bond->mii_work);
 	cancel_delayed_work_sync(&bond->arp_work);
-	cancel_delayed_work_sync(&bond->alb_work);
+	if (bond_is_lb(bond))
+		cancel_delayed_work_sync(&bond->alb_work);
 	cancel_delayed_work_sync(&bond->ad_work);
 	cancel_delayed_work_sync(&bond->mcast_work);
 }

I would prefer you drop this patch.

As I said, there is no gain but potential troubles with this, bonding driver is heavily changed by lot of people.

Its not like we setup/dismantle thousand of bonding devices per second on a host.