Skip to content

Commit

Permalink
netdev bond: add support to configure tlb_dynamic_lb
Browse files Browse the repository at this point in the history
  • Loading branch information
ssahani committed Dec 13, 2018
1 parent d610d20 commit e939240
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions man/systemd.netdev.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,15 @@
</listitem>
</varlistentry>

<varlistentry>
<term><varname>TlbDynamicLb=</varname></term>
<listitem>
<para>Takes a boolean. Specifies if dynamic shuffling of flows is enabled. Applies only
for balance-tlb mode.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><varname>MinLinks=</varname></term>
<listitem>
Expand Down
1 change: 1 addition & 0 deletions src/libsystemd/sd-netlink/netlink-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ static const NLType rtnl_link_info_data_bond_types[] = {
[IFLA_BOND_AD_ACTOR_SYS_PRIO] = { .type = NETLINK_TYPE_U16 },
[IFLA_BOND_AD_USER_PORT_KEY] = { .type = NETLINK_TYPE_U16 },
[IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NETLINK_TYPE_ETHER_ADDR },
[IFLA_BOND_TLB_DYNAMIC_LB] = { .type = NETLINK_TYPE_U8 },
};

static const NLType rtnl_link_info_data_iptun_types[] = {
Expand Down
4 changes: 4 additions & 0 deletions src/network/netdev/bond.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_netlin
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BOND_ALL_SLAVES_ACTIVE attribute: %m");

r = sd_netlink_message_append_u8(m, IFLA_BOND_TLB_DYNAMIC_LB, b->tlb_dynamic_lb);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BOND_TLB_DYNAMIC_LB attribute: %m");

if (b->arp_interval > 0) {
if (b->n_arp_ip_targets > 0) {

Expand Down
1 change: 1 addition & 0 deletions src/network/netdev/bond.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ typedef struct Bond {
BondPrimaryReselect primary_reselect;

bool all_slaves_active;
bool tlb_dynamic_lb;

unsigned resend_igmp;
unsigned packets_per_slave;
Expand Down
3 changes: 2 additions & 1 deletion src/network/netdev/netdev-gperf.gperf
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ Bond.PrimaryReselectPolicy, config_parse_bond_primary_reselect, 0,
Bond.ResendIGMP, config_parse_unsigned, 0, offsetof(Bond, resend_igmp)
Bond.PacketsPerSlave, config_parse_unsigned, 0, offsetof(Bond, packets_per_slave)
Bond.GratuitousARP, config_parse_unsigned, 0, offsetof(Bond, num_grat_arp)
Bond.AllSlavesActive, config_parse_unsigned, 0, offsetof(Bond, all_slaves_active)
Bond.AllSlavesActive, config_parse_bool, 0, offsetof(Bond, all_slaves_active)
Bond.TlbDynamicLb, config_parse_bool, 0, offsetof(Bond, tlb_dynamic_lb)
Bond.MinLinks, config_parse_unsigned, 0, offsetof(Bond, min_links)
Bond.MIIMonitorSec, config_parse_sec, 0, offsetof(Bond, miimon)
Bond.UpDelaySec, config_parse_sec, 0, offsetof(Bond, updelay)
Expand Down

0 comments on commit e939240

Please sign in to comment.