Skip to contentSkip to conversation

bonding: allow xmit hash policy change while bond dev is up

PATCH In review [email protected] 2 participants 2 messages May 24, 2013 – May 28, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: allow xmit hash policy change while bond dev is up

From: Nikolay Aleksandrov <[email protected]>

Since the xmit_hash_policy pointer is always valid and not dependent on anything, we can change it while the bond device is up and running. The only downside would be the out of order packets but that is a small price to pay.

---
 drivers/net/bonding/bond_sysfs.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/bonding/bond_sysfs.c +1 -9
index ea7a388..362a04b 100644
@@ -379,20 +379,12 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
 	int new_value, ret = count;
 	struct bonding *bond = to_bond(d);
 
-	if (bond->dev->flags & IFF_UP) {
-		pr_err("%s: Interface is up. Unable to update xmit policy.\n",
-		       bond->dev->name);
-		ret = -EPERM;
-		goto out;
-	}
-
 	new_value = bond_parse_parm(buf, xmit_hashtype_tbl);
 	if (new_value < 0)  {
 		pr_err("%s: Ignoring invalid xmit hash policy value %.*s.\n",
 		       bond->dev->name,
 		       (int)strlen(buf) - 1, buf);
 		ret = -EINVAL;
-		goto out;
 	} else {
 		bond->params.xmit_policy = new_value;
 		bond_set_mode_ops(bond, bond->params.mode);
@@ -400,7 +392,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
 			bond->dev->name,
 			xmit_hashtype_tbl[new_value].modename, new_value);
 	}
-out:
+
 	return ret;
 }
 static DEVICE_ATTR(xmit_hash_policy, S_IRUGO | S_IWUSR,
Signature · 1 line
1.8.1.4
maintainer
#1 lore raw

From: [email protected]
Date: Fri, 24 May 2013 12:59:47 +0200

Quoted 8 lines

From: Nikolay Aleksandrov <[email protected]>

Since the xmit_hash_policy pointer is always valid and not dependent on anything, we can change it while the bond device is up and running. The only downside would be the out of order packets but that is a small price to pay.

Looks reasonable, applied, thanks!