ip/bond: add lacp_strict support
Subsystems (2)
PATCH v5 1/1 ip/bond: add lacp_strict support
lacp_strict defines the behavior of a LACP bonding interface when no slaves are in Collecting_Distributing state while at least 'min_links' slaves have carrier.
In the default (off) mode, the bonding master remains up and a single slave is selected for TX/RX, while traffic received on other slaves is dropped. This preserves the existing behavior.
In lacp_strict mode, the bonding master reports carrier down in this situation.
--- include/uapi/linux/if_link.h | 1 + ip/iplink_bond.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)
include/uapi/linux/if_link.h +1 -0
@@ -1601,6 +1601,7 @@ enum {IFLA_BOND_NS_IP6_TARGET ,IFLA_BOND_COUPLED_CONTROL ,IFLA_BOND_BROADCAST_NEIGH , +IFLA_BOND_LACP_STRICT , __IFLA_BOND_MAX, };
ip/iplink_bond.c +20 -0
@@ -87,6 +87,12 @@ static const char *lacp_rate_tbl[] = { NULL, }; +static const char *lacp_strict_tbl[] = { +"off" , +"on" , +NULL , +}; +static const char *ad_select_tbl[] = {"stable" ,"bandwidth" ,
@@ -155,6 +161,7 @@ static void print_explain(FILE *f)" [ ad_user_port_key PORTKEY ]\n" " [ ad_actor_sys_prio SYSPRIO ]\n" " [ ad_actor_system LLADDR ]\n" +" [ lacp_strict LACP_STRICT ]\n" " [ arp_missed_max MISSED_MAX ]\n" "\n" "BONDMODE := balance-rr|active-backup|balance-xor|broadcast|802.3ad|balance-tlb|balance-alb\n"
@@ -168,6 +175,7 @@ static void print_explain(FILE *f)"AD_SELECT := stable|bandwidth|count\n" "COUPLED_CONTROL := off|on\n" "BROADCAST_NEIGHBOR := off|on\n" +"LACP_STRICT := off|on\n" ); }
@@ -188,6 +196,7 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,__u32 packets_per_slave;__u8 missed_max;__u8 broadcast_neighbor; +__u8 lacp_strict;unsigned int ifindex;int ret;
@@ -417,6 +426,13 @@ 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,"lacp_strict" ) ==0 ) { +NEXT_ARG (); + lacp_strict =parse_on_off ("lacp_strict" , *argv, &ret); +if (ret) +return ret; + lacp_strict =get_index (lacp_strict_tbl, *argv); +addattr8 (n,1024 ,IFLA_BOND_LACP_STRICT , lacp_strict); }else if (matches (*argv,"tlb_dynamic_lb" ) ==0 ) {NEXT_ARG ();if (get_u8 (&tlb_dynamic_lb, *argv,0 )) {
@@ -642,6 +658,10 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])"all_slaves_active %u " , rta_getattr_u8(tb[IFLA_BOND_ALL_SLAVES_ACTIVE])); +if (tb[IFLA_BOND_LACP_STRICT ]) +print_on_off (PRINT_ANY ,"lacp_strict" ,"lacp_strict %s " , +rta_getattr_u8 (tb[IFLA_BOND_LACP_STRICT ])); +if (tb[IFLA_BOND_MIN_LINKS ]) print_uint(PRINT_ANY, "min_links",
Signature · 1 line
2.39.2
Hi David, Stephen,
Quoted 10 lines · Louis Scalbert
lacp_strictdefines the behavior of a LACP bonding interface when no slaves are inCollecting_Distributingstate while at least 'min_links' slaves have carrier.In the default (off) mode, the bonding master remains up and a single slave is selected for TX/RX, while traffic received on other slaves is dropped. This preserves the existing behavior.
In
lacp_strictmode, the bonding master reports carrier down in this situation.
I'm sorry to ping you about this, but I'm wondering if this patch has not been archived on Patchwork by mistake:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
I didn't see any reviews on this v5, and there is no v6: is there something to fix?
Quoted 1 line
I'm asking, because this patch is required to execute the drivers/net/bonding selftests target from 7.2 released this WE.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Hello Matthieu,
thank you for pinging.
There is no version 6, and there are no comments regarding version 5.
best regards
Quoted 32 lines · Matthieu Baerts
Hi David, Stephen,
Quoted 10 lines · Louis Scalbert
lacp_strictdefines the behavior of a LACP bonding interface when no slaves are inCollecting_Distributingstate while at least 'min_links' slaves have carrier.In the default (off) mode, the bonding master remains up and a single slave is selected for TX/RX, while traffic received on other slaves is dropped. This preserves the existing behavior.
In
lacp_strictmode, the bonding master reports carrier down in this situation.I'm sorry to ping you about this, but I'm wondering if this patch has not been archived on Patchwork by mistake:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
I didn't see any reviews on this v5, and there is no v6: is there something to fix?
Quoted 1 line
I'm asking, because this patch is required to execute the
drivers/net/bondingselftests target from 7.2 released this WE.Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
Hi Louis,
Quoted 7 lines · Louis Scalbert
Hello Matthieu,
thank you for pinging.
There is no version 6, and there are no comments regarding version 5.
best regards
I saw the patch status is archived. Would you able to re-post it? I can help review it.
Thanks
Hangbin
Quoted 4 lines · Hangbin Liu
Hi Louis,
Quoted 2 lines · Louis Scalbert
Hello Matthieu,
Quoted 8 lines
Quoted 5 lines
thank you for pinging.
There is no version 6, and there are no comments regarding version 5.
best regards
I saw the patch status is archived. Would you able to re-post it? I can help review it.
BTW, I just took a glance at your v5 patch. Since you use parse_on_off, there is no need to define lacp_strict_tbl anymore.
Thanks
Hangbin
Thank you for notifying me about this issue.
I have just posted the v6.
regards,
Quoted 20 lines · Hangbin Liu
Quoted 4 lines · Hangbin Liu
Hi Louis,
Quoted 2 lines · Louis Scalbert
Hello Matthieu,
Quoted 8 lines
Quoted 5 lines
thank you for pinging.
There is no version 6, and there are no comments regarding version 5.
best regards
I saw the patch status is archived. Would you able to re-post it? I can help review it.
BTW, I just took a glance at your v5 patch. Since you use
parse_on_off, there is no need to definelacp_strict_tblanymore.Thanks
Hangbin