Skip to content

Commit 53edee2

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
bonding: allow xmit hash policy change while bond dev is up
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. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1a9561a commit 53edee2

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎drivers/net/bonding/bond_sysfs.c‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,28 +383,20 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
383383
int new_value, ret = count;
384384
struct bonding *bond = to_bond(d);
385385

386-
if (bond->dev->flags & IFF_UP) {
387-
pr_err("%s: Interface is up. Unable to update xmit policy.\n",
388-
bond->dev->name);
389-
ret = -EPERM;
390-
goto out;
391-
}
392-
393386
new_value = bond_parse_parm(buf, xmit_hashtype_tbl);
394387
if (new_value < 0) {
395388
pr_err("%s: Ignoring invalid xmit hash policy value %.*s.\n",
396389
bond->dev->name,
397390
(int)strlen(buf) - 1, buf);
398391
ret = -EINVAL;
399-
goto out;
400392
} else {
401393
bond->params.xmit_policy = new_value;
402394
bond_set_mode_ops(bond, bond->params.mode);
403395
pr_info("%s: setting xmit hash policy to %s (%d).\n",
404396
bond->dev->name,
405397
xmit_hashtype_tbl[new_value].modename, new_value);
406398
}
407-
out:
399+
408400
return ret;
409401
}
410402
static DEVICE_ATTR(xmit_hash_policy, S_IRUGO | S_IWUSR,

0 commit comments

Comments
 (0)