|
|
049c96 |
From 3e07fbb9852e7d395f5fef89ee10365802df559a Mon Sep 17 00:00:00 2001
|
|
|
049c96 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
049c96 |
Date: Tue, 23 Feb 2016 18:27:20 +0100
|
|
|
049c96 |
Subject: [PATCH] iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB
|
|
|
049c96 |
|
|
|
049c96 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1269528
|
|
|
049c96 |
Upstream Status: iproute2.git commit d02e46627f29b
|
|
|
049c96 |
|
|
|
049c96 |
commit d02e46627f29b6bc761e6b6afd9198da001b13f1
|
|
|
049c96 |
Author: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
|
|
|
049c96 |
Date: Mon Aug 3 12:19:55 2015 +0200
|
|
|
049c96 |
|
|
|
049c96 |
iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB
|
|
|
049c96 |
|
|
|
049c96 |
Add support to be able to set and show the value of tlb_dynamic_lb
|
|
|
049c96 |
(IFLA_BOND_TLB_DYNAMIC_LB).
|
|
|
049c96 |
Example:
|
|
|
049c96 |
$ ip -d link show dev bond0 type bond
|
|
|
049c96 |
7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
|
|
|
049c96 |
mode DEFAULT group default
|
|
|
049c96 |
link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
|
|
|
049c96 |
bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
|
|
|
049c96 |
arp_interval 0 arp_validate none arp_all_targets any primary_reselect
|
|
|
049c96 |
always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
|
|
|
049c96 |
num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
|
|
|
049c96 |
packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1
|
|
|
049c96 |
addrgenmode eui64
|
|
|
049c96 |
|
|
|
049c96 |
$ ip -d l set dev bond0 type bond tlb_dynamic_lb 0
|
|
|
049c96 |
$ ip -d link show dev bond0 type bond
|
|
|
049c96 |
7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
|
|
|
049c96 |
mode DEFAULT group default
|
|
|
049c96 |
link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
|
|
|
049c96 |
bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
|
|
|
049c96 |
arp_interval 0 arp_validate none arp_all_targets any primary_reselect
|
|
|
049c96 |
always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
|
|
|
049c96 |
num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
|
|
|
049c96 |
packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 0
|
|
|
049c96 |
addrgenmode eui64
|
|
|
049c96 |
|
|
|
049c96 |
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
|
|
|
049c96 |
---
|
|
|
049c96 |
ip/iplink_bond.c | 16 +++++++++++++++-
|
|
|
049c96 |
1 file changed, 15 insertions(+), 1 deletion(-)
|
|
|
049c96 |
|
|
|
049c96 |
diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c
|
|
|
049c96 |
index 2a9783e..1b50de9 100644
|
|
|
049c96 |
--- a/ip/iplink_bond.c
|
|
|
049c96 |
+++ b/ip/iplink_bond.c
|
|
|
049c96 |
@@ -133,6 +133,7 @@ static void print_explain(FILE *f)
|
|
|
049c96 |
" [ min_links MIN_LINKS ]\n"
|
|
|
049c96 |
" [ lp_interval LP_INTERVAL ]\n"
|
|
|
049c96 |
" [ packets_per_slave PACKETS_PER_SLAVE ]\n"
|
|
|
049c96 |
+ " [ tlb_dynamic_lb TLB_DYNAMIC_LB ]\n"
|
|
|
049c96 |
" [ lacp_rate LACP_RATE ]\n"
|
|
|
049c96 |
" [ ad_select AD_SELECT ]\n"
|
|
|
049c96 |
" [ ad_user_port_key PORTKEY ]\n"
|
|
|
049c96 |
@@ -160,7 +161,7 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
|
|
|
049c96 |
{
|
|
|
049c96 |
__u8 mode, use_carrier, primary_reselect, fail_over_mac;
|
|
|
049c96 |
__u8 xmit_hash_policy, num_peer_notif, all_slaves_active;
|
|
|
049c96 |
- __u8 lacp_rate, ad_select;
|
|
|
049c96 |
+ __u8 lacp_rate, ad_select, tlb_dynamic_lb;
|
|
|
049c96 |
__u16 ad_user_port_key, ad_actor_sys_prio;
|
|
|
049c96 |
__u32 miimon, updelay, downdelay, arp_interval, arp_validate;
|
|
|
049c96 |
__u32 arp_all_targets, resend_igmp, min_links, lp_interval;
|
|
|
049c96 |
@@ -374,6 +375,14 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
|
|
|
049c96 |
return -1;
|
|
|
049c96 |
addattr_l(n, 1024, IFLA_BOND_AD_ACTOR_SYSTEM,
|
|
|
049c96 |
abuf, len);
|
|
|
049c96 |
+ } else if (matches(*argv, "tlb_dynamic_lb") == 0) {
|
|
|
049c96 |
+ NEXT_ARG();
|
|
|
049c96 |
+ if (get_u8(&tlb_dynamic_lb, *argv, 0)) {
|
|
|
049c96 |
+ invarg("invalid tlb_dynamic_lb", *argv);
|
|
|
049c96 |
+ return -1;
|
|
|
049c96 |
+ }
|
|
|
049c96 |
+ addattr8(n, 1024, IFLA_BOND_TLB_DYNAMIC_LB,
|
|
|
049c96 |
+ tlb_dynamic_lb);
|
|
|
049c96 |
} else if (matches(*argv, "help") == 0) {
|
|
|
049c96 |
explain();
|
|
|
049c96 |
return -1;
|
|
|
049c96 |
@@ -583,6 +592,11 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
|
|
|
049c96 |
RTA_PAYLOAD(tb[IFLA_BOND_AD_ACTOR_SYSTEM]),
|
|
|
049c96 |
1 /*ARPHDR_ETHER*/, b1, sizeof(b1)));
|
|
|
049c96 |
}
|
|
|
049c96 |
+
|
|
|
049c96 |
+ if (tb[IFLA_BOND_TLB_DYNAMIC_LB]) {
|
|
|
049c96 |
+ fprintf(f, "tlb_dynamic_lb %u ",
|
|
|
049c96 |
+ rta_getattr_u8(tb[IFLA_BOND_TLB_DYNAMIC_LB]));
|
|
|
049c96 |
+ }
|
|
|
049c96 |
}
|
|
|
049c96 |
|
|
|
049c96 |
static void bond_print_help(struct link_util *lu, int argc, char **argv,
|
|
|
049c96 |
--
|
|
|
049c96 |
1.8.3.1
|
|
|
049c96 |
|