summaryrefslogtreecommitdiffstats
path: root/src/network/netdev
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2018-12-13 10:23:07 +0100
committerSusant Sahani <ssahani@gmail.com>2018-12-15 13:45:16 +0100
commitfde60a424edb891026ad77776565c043985e9763 (patch)
tree70ec8ff922cbc39dd1d355418ec4c7828c241e18 /src/network/netdev
parentMerge pull request #11046 from keszybz/generator-mains (diff)
downloadsystemd-fde60a424edb891026ad77776565c043985e9763.tar.xz
systemd-fde60a424edb891026ad77776565c043985e9763.zip
netdev bond: add support to configure tlb_dynamic_lb
Closes https://github.com/systemd/systemd/issues/11135 Add test for bond : tlb_dynamic_lb
Diffstat (limited to 'src/network/netdev')
-rw-r--r--src/network/netdev/bond.c7
-rw-r--r--src/network/netdev/bond.h2
-rw-r--r--src/network/netdev/netdev-gperf.gperf1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
index 70d314bc79..550a7f8914 100644
--- a/src/network/netdev/bond.c
+++ b/src/network/netdev/bond.c
@@ -307,6 +307,12 @@ 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");
+ if (b->tlb_dynamic_lb >= 0) {
+ 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) {
@@ -534,6 +540,7 @@ static void bond_init(NetDev *netdev) {
b->primary_reselect = _NETDEV_BOND_PRIMARY_RESELECT_INVALID;
b->all_slaves_active = false;
+ b->tlb_dynamic_lb = -1;
b->resend_igmp = RESEND_IGMP_DEFAULT;
b->packets_per_slave = PACKETS_PER_SLAVE_DEFAULT;
diff --git a/src/network/netdev/bond.h b/src/network/netdev/bond.h
index 99ef25d0d3..31b922b032 100644
--- a/src/network/netdev/bond.h
+++ b/src/network/netdev/bond.h
@@ -99,6 +99,8 @@ typedef struct Bond {
BondArpAllTargets arp_all_targets;
BondPrimaryReselect primary_reselect;
+ int tlb_dynamic_lb;
+
bool all_slaves_active;
unsigned resend_igmp;
diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf
index fbc7a59e9e..39b26b842c 100644
--- a/src/network/netdev/netdev-gperf.gperf
+++ b/src/network/netdev/netdev-gperf.gperf
@@ -141,6 +141,7 @@ Bond.ResendIGMP, config_parse_unsigned, 0,
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.DynamicTransmitLoadBalancing, config_parse_tristate, 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)