netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 net-next] iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB
@ 2015-08-03 10:19 Nikolay Aleksandrov
  2015-08-10 18:22 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Aleksandrov @ 2015-08-03 10:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, stephen, Nikolay Aleksandrov

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Add support to be able to set and show the value of tlb_dynamic_lb
(IFLA_BOND_TLB_DYNAMIC_LB).
Example:
$ ip -d link show dev bond0 type bond
7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
arp_interval 0 arp_validate none arp_all_targets any primary_reselect
always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1
addrgenmode eui64

$ ip -d l set dev bond0 type bond tlb_dynamic_lb 0
$ ip -d link show dev bond0 type bond
7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
arp_interval 0 arp_validate none arp_all_targets any primary_reselect
always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 0
addrgenmode eui64

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 ip/iplink_bond.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c
index 2a9783e4f114..1b50de909356 100644
--- a/ip/iplink_bond.c
+++ b/ip/iplink_bond.c
@@ -133,6 +133,7 @@ static void print_explain(FILE *f)
 		"                [ min_links MIN_LINKS ]\n"
 		"                [ lp_interval LP_INTERVAL ]\n"
 		"                [ packets_per_slave PACKETS_PER_SLAVE ]\n"
+		"		 [ tlb_dynamic_lb TLB_DYNAMIC_LB ]\n"
 		"                [ lacp_rate LACP_RATE ]\n"
 		"                [ ad_select AD_SELECT ]\n"
 		"                [ ad_user_port_key PORTKEY ]\n"
@@ -160,7 +161,7 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
 {
 	__u8 mode, use_carrier, primary_reselect, fail_over_mac;
 	__u8 xmit_hash_policy, num_peer_notif, all_slaves_active;
-	__u8 lacp_rate, ad_select;
+	__u8 lacp_rate, ad_select, tlb_dynamic_lb;
 	__u16 ad_user_port_key, ad_actor_sys_prio;
 	__u32 miimon, updelay, downdelay, arp_interval, arp_validate;
 	__u32 arp_all_targets, resend_igmp, min_links, lp_interval;
@@ -374,6 +375,14 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
 				return -1;
 			addattr_l(n, 1024, IFLA_BOND_AD_ACTOR_SYSTEM,
 				  abuf, len);
+		} else if (matches(*argv, "tlb_dynamic_lb") == 0) {
+			NEXT_ARG();
+			if (get_u8(&tlb_dynamic_lb, *argv, 0)) {
+				invarg("invalid tlb_dynamic_lb", *argv);
+				return -1;
+			}
+			addattr8(n, 1024, IFLA_BOND_TLB_DYNAMIC_LB,
+				 tlb_dynamic_lb);
 		} else if (matches(*argv, "help") == 0) {
 			explain();
 			return -1;
@@ -583,6 +592,11 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 				    RTA_PAYLOAD(tb[IFLA_BOND_AD_ACTOR_SYSTEM]),
 				    1 /*ARPHDR_ETHER*/, b1, sizeof(b1)));
 	}
+
+	if (tb[IFLA_BOND_TLB_DYNAMIC_LB]) {
+		fprintf(f, "tlb_dynamic_lb %u ",
+			rta_getattr_u8(tb[IFLA_BOND_TLB_DYNAMIC_LB]));
+	}
 }
 
 static void bond_print_help(struct link_util *lu, int argc, char **argv,
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2 net-next] iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB
  2015-08-03 10:19 [PATCH iproute2 net-next] iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB Nikolay Aleksandrov
@ 2015-08-10 18:22 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2015-08-10 18:22 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, davem, Nikolay Aleksandrov

On Mon,  3 Aug 2015 12:19:55 +0200
Nikolay Aleksandrov <razor@blackwall.org> wrote:

> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> Add support to be able to set and show the value of tlb_dynamic_lb
> (IFLA_BOND_TLB_DYNAMIC_LB).
> Example:
> $ ip -d link show dev bond0 type bond
> 7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
> mode DEFAULT group default
>     link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
>     bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
> arp_interval 0 arp_validate none arp_all_targets any primary_reselect
> always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
> num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
> packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1
> addrgenmode eui64
> 
> $ ip -d l set dev bond0 type bond tlb_dynamic_lb 0
> $ ip -d link show dev bond0 type bond
> 7: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
> mode DEFAULT group default
>     link/ether ce:2f:e1:6e:d7:e0 brd ff:ff:ff:ff:ff:ff promiscuity 0
>     bond mode balance-tlb miimon 100 updelay 0 downdelay 0 use_carrier 1
> arp_interval 0 arp_validate none arp_all_targets any primary_reselect
> always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1
> num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1
> packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 0
> addrgenmode eui64
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Applied to net-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-10 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 10:19 [PATCH iproute2 net-next] iplink: bonding: add support for IFLA_BOND_TLB_DYNAMIC_LB Nikolay Aleksandrov
2015-08-10 18:22 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).