Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bonding: add tlb_dynamic_lb netlink support

tlb_dynamic_lb could be set only via sysfs, this patch allows it to be
set via netlink.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nikolay Aleksandrov and committed by
David S. Miller
0f7bffd9 b7a0925e

+16 -2
+15 -2
drivers/net/bonding/bond_netlink.c
··· 111 111 [IFLA_BOND_AD_USER_PORT_KEY] = { .type = NLA_U16 }, 112 112 [IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NLA_BINARY, 113 113 .len = ETH_ALEN }, 114 + [IFLA_BOND_TLB_DYNAMIC_LB] = { .type = NLA_U8 }, 114 115 }; 115 116 116 117 static const struct nla_policy bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = { ··· 406 405 if (err) 407 406 return err; 408 407 } 409 - 410 408 if (data[IFLA_BOND_AD_USER_PORT_KEY]) { 411 409 int port_key = 412 410 nla_get_u16(data[IFLA_BOND_AD_USER_PORT_KEY]); ··· 415 415 if (err) 416 416 return err; 417 417 } 418 - 419 418 if (data[IFLA_BOND_AD_ACTOR_SYSTEM]) { 420 419 if (nla_len(data[IFLA_BOND_AD_ACTOR_SYSTEM]) != ETH_ALEN) 421 420 return -EINVAL; ··· 425 426 if (err) 426 427 return err; 427 428 } 429 + if (data[IFLA_BOND_TLB_DYNAMIC_LB]) { 430 + int dynamic_lb = nla_get_u8(data[IFLA_BOND_TLB_DYNAMIC_LB]); 431 + 432 + bond_opt_initval(&newval, dynamic_lb); 433 + err = __bond_opt_set(bond, BOND_OPT_TLB_DYNAMIC_LB, &newval); 434 + if (err) 435 + return err; 436 + } 437 + 428 438 return 0; 429 439 } 430 440 ··· 484 476 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_ACTOR_SYS_PRIO */ 485 477 nla_total_size(sizeof(u16)) + /* IFLA_BOND_AD_USER_PORT_KEY */ 486 478 nla_total_size(ETH_ALEN) + /* IFLA_BOND_AD_ACTOR_SYSTEM */ 479 + nla_total_size(sizeof(u8)) + /* IFLA_BOND_TLB_DYNAMIC_LB */ 487 480 0; 488 481 } 489 482 ··· 605 596 606 597 if (nla_put_u8(skb, IFLA_BOND_AD_SELECT, 607 598 bond->params.ad_select)) 599 + goto nla_put_failure; 600 + 601 + if (nla_put_u8(skb, IFLA_BOND_TLB_DYNAMIC_LB, 602 + bond->params.tlb_dynamic_lb)) 608 603 goto nla_put_failure; 609 604 610 605 if (BOND_MODE(bond) == BOND_MODE_8023AD) {
+1
include/uapi/linux/if_link.h
··· 434 434 IFLA_BOND_AD_ACTOR_SYS_PRIO, 435 435 IFLA_BOND_AD_USER_PORT_KEY, 436 436 IFLA_BOND_AD_ACTOR_SYSTEM, 437 + IFLA_BOND_TLB_DYNAMIC_LB, 437 438 __IFLA_BOND_MAX, 438 439 }; 439 440