aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 1bda29249d12..db760e84119f 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -111,6 +111,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
111 [IFLA_BOND_AD_USER_PORT_KEY] = { .type = NLA_U16 }, 111 [IFLA_BOND_AD_USER_PORT_KEY] = { .type = NLA_U16 },
112 [IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NLA_BINARY, 112 [IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NLA_BINARY,
113 .len = ETH_ALEN }, 113 .len = ETH_ALEN },
114 [IFLA_BOND_TLB_DYNAMIC_LB] = { .type = NLA_U8 },
114}; 115};
115 116
116static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = { 117static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
@@ -405,7 +406,6 @@ static int bond_changelink(struct net_device *bond_dev,
405 if (err) 406 if (err)
406 return err; 407 return err;
407 } 408 }
408
409 if (data[IFLA_BOND_AD_USER_PORT_KEY]) { 409 if (data[IFLA_BOND_AD_USER_PORT_KEY]) {
410 int port_key = 410 int port_key =
411 nla_get_u16(data[IFLA_BOND_AD_USER_PORT_KEY]); 411 nla_get_u16(data[IFLA_BOND_AD_USER_PORT_KEY]);
@@ -415,7 +415,6 @@ static int bond_changelink(struct net_device *bond_dev,
415 if (err) 415 if (err)
416 return err; 416 return err;
417 } 417 }
418
419 if (data[IFLA_BOND_AD_ACTOR_SYSTEM]) { 418 if (data[IFLA_BOND_AD_ACTOR_SYSTEM]) {
420 if (nla_len(data[IFLA_BOND_AD_ACTOR_SYSTEM]) != ETH_ALEN) 419 if (nla_len(data[IFLA_BOND_AD_ACTOR_SYSTEM]) != ETH_ALEN)
421 return -EINVAL; 420 return -EINVAL;
@@ -426,6 +425,15 @@ static int bond_changelink(struct net_device *bond_dev,
426 if (err) 425 if (err)
427 return err; 426 return err;
428 } 427 }
428 if (data[IFLA_BOND_TLB_DYNAMIC_LB]) {
429 int dynamic_lb = nla_get_u8(data[IFLA_BOND_TLB_DYNAMIC_LB]);
430
431 bond_opt_initval(&newval, dynamic_lb);
432 err = __bond_opt_set(bond, BOND_OPT_TLB_DYNAMIC_LB, &newval);
433 if (err)
434 return err;
435 }
436
429 return 0; 437 return 0;
430} 438}
431 439
@@ -476,6 +484,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
476 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_ACTOR_SYS_PRIO */ 484 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_ACTOR_SYS_PRIO */
477 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_USER_PORT_KEY */ 485 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_USER_PORT_KEY */
478 nla_total_size(ETH_ALEN) + /* IFLA_BOND_AD_ACTOR_SYSTEM */ 486 nla_total_size(ETH_ALEN) + /* IFLA_BOND_AD_ACTOR_SYSTEM */
487 nla_total_size(sizeof(u8)) + /* IFLA_BOND_TLB_DYNAMIC_LB */
479 0; 488 0;
480} 489}
481 490
@@ -598,6 +607,10 @@ static int bond_fill_info(struct sk_buff *skb,
598 bond->params.ad_select)) 607 bond->params.ad_select))
599 goto nla_put_failure; 608 goto nla_put_failure;
600 609
610 if (nla_put_u8(skb, IFLA_BOND_TLB_DYNAMIC_LB,
611 bond->params.tlb_dynamic_lb))
612 goto nla_put_failure;
613
601 if (BOND_MODE(bond) == BOND_MODE_8023AD) { 614 if (BOND_MODE(bond) == BOND_MODE_8023AD) {
602 struct ad_info info; 615 struct ad_info info;
603 616