Skip to content

Commit

Permalink
Merge pull request #115 from Ali-aqrabawi/bond_validations
Browse files Browse the repository at this point in the history
yang: bond: add validation to mode options
  • Loading branch information
Ali-aqrabawi authored May 10, 2024
2 parents fc08082 + 73a3937 commit 5b49f0e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions yang/iproute2-ip-link.yang
Original file line number Diff line number Diff line change
Expand Up @@ -1509,22 +1509,27 @@ module iproute2-ip-link {
}
leaf miimon {
type uint32;
default 100;
description
"Specifies (in milliseconds) how often MII link monitoring occurs.
This is useful if high availability is required because MII is used to verify that the NIC is active.";

}
leaf updelay {
must "(../mode = '802.3ad') or (../mode = 'balance-tlb') or (../mode = 'balance-alb')" {
error-message "updelay support on 802.3ad, balance-tlb or balance-alb bond modes only.";
}
type uint32;
default 0;
description
"Specifies (in milliseconds) how long to wait before enabling a link.
The value must be a multiple of the value specified in the miimon parameter.
The value is set to 0 by default, which disables it.";
}
leaf downdelay {
must "(../mode = '802.3ad') or (../mode = 'balance-tlb') or (../mode = 'balance-alb')" {
error-message "'downdelay' is only supported on 802.3ad, balance-tlb or balance-alb bond modes.";
}
type uint32;
default 0;
description
"Specifies (in milliseconds) how long to wait after link failure before disabling the link.
The value must be a multiple of the value specified in the miimon parameter.
Expand All @@ -1541,11 +1546,19 @@ module iproute2-ip-link {
to maintains its state with netif_carrier_on/off; most device drivers support this function.";
}
leaf arp_interval {
must "(../mode = 'balance-rr') or (../mode = 'active-backup') or (../mode = 'balance-xor')
or (../mode = broadcast)" {
error-message "'arp_interval' is only supported on balance-rr, active-backup, balance-xor or broadcast bond modes.";
}
type uint32;
description
"how often ARP monitoring occurs.";
}
leaf arp_validate {
must "(../mode = 'balance-rr') or (../mode = 'active-backup') or (../mode = 'balance-xor')
or (../mode = broadcast)" {
error-message "'arp_validate' is only supported on balance-rr, active-backup, balance-xor or broadcast bond modes.";
}
type enumeration {
enum "none";
enum "active";
Expand Down Expand Up @@ -1597,6 +1610,9 @@ module iproute2-ip-link {
"Selects the transmit hash policy used for port selection in balance-xor and 802.3ad modes.";
}
leaf lacp_active {
must "../mode = '802.3ad'" {
error-message "lacp_active is only supported on 802.3ad mode.";
}
ipr2cgen:oper-arg-name "ad_lacp_active";
type enumeration {
enum "on";
Expand All @@ -1606,6 +1622,9 @@ module iproute2-ip-link {
"set the LACP active mode";
}
leaf lacp_rate {
must "../mode = '802.3ad'" {
error-message "lacp_rate is only supported on 802.3ad mode.";
}
ipr2cgen:oper-arg-name "ad_lacp_rate";
type enumeration {
enum "slow";
Expand Down

0 comments on commit 5b49f0e

Please sign in to comment.