mirror of
https://github.com/systemd/systemd
synced 2024-07-21 18:24:38 +00:00
Merge pull request #31338 from ssahani/network-bond-missed
network: netdev - bond add support for ARP missed max
This commit is contained in:
commit
e21dd22040
|
@ -2420,6 +2420,18 @@
|
|||
<xi:include href="version-info.xml" xpointer="v220"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>ARPMissedMax=</varname></term>
|
||||
<listitem>
|
||||
<para>Specify the maximum number of arp interval monitor cycle
|
||||
for missed ARP replies. If this number is exceeded, link is reported as
|
||||
down. Defaults to unset.
|
||||
</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v256"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>For more detail information see
|
||||
|
|
|
@ -124,6 +124,7 @@ static const NLAPolicy rtnl_link_info_data_bond_policies[] = {
|
|||
[IFLA_BOND_AD_ACTOR_SYSTEM] = BUILD_POLICY_WITH_SIZE(ETHER_ADDR, ETH_ALEN),
|
||||
[IFLA_BOND_TLB_DYNAMIC_LB] = BUILD_POLICY(U8),
|
||||
[IFLA_BOND_PEER_NOTIF_DELAY] = BUILD_POLICY(U32),
|
||||
[IFLA_BOND_MISSED_MAX] = BUILD_POLICY(U8),
|
||||
};
|
||||
|
||||
static const NLAPolicy rtnl_link_info_data_bridge_policies[] = {
|
||||
|
|
|
@ -198,6 +198,12 @@ static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_netlin
|
|||
return r;
|
||||
}
|
||||
|
||||
if (b->arp_missed_max > 0) {
|
||||
r = sd_netlink_message_append_u8(m, IFLA_BOND_MISSED_MAX, b->arp_missed_max);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (b->arp_interval > 0 && !ordered_set_isempty(b->arp_ip_targets)) {
|
||||
void *val;
|
||||
int n = 0;
|
||||
|
|
|
@ -34,6 +34,8 @@ typedef struct Bond {
|
|||
uint16_t ad_user_port_key;
|
||||
struct ether_addr ad_actor_system;
|
||||
|
||||
uint8_t arp_missed_max;
|
||||
|
||||
usec_t miimon;
|
||||
usec_t updelay;
|
||||
usec_t downdelay;
|
||||
|
|
|
@ -218,6 +218,7 @@ Bond.LearnPacketIntervalSec, config_parse_sec,
|
|||
Bond.AdActorSystemPriority, config_parse_ad_actor_sys_prio, 0, offsetof(Bond, ad_actor_sys_prio)
|
||||
Bond.AdUserPortKey, config_parse_ad_user_port_key, 0, offsetof(Bond, ad_user_port_key)
|
||||
Bond.AdActorSystem, config_parse_ad_actor_system, 0, offsetof(Bond, ad_actor_system)
|
||||
Bond.ARPMissedMax, config_parse_uint8, 0, offsetof(Bond, arp_missed_max)
|
||||
Bridge.HelloTimeSec, config_parse_sec, 0, offsetof(Bridge, hello_time)
|
||||
Bridge.MaxAgeSec, config_parse_sec, 0, offsetof(Bridge, max_age)
|
||||
Bridge.AgeingTimeSec, config_parse_sec, 0, offsetof(Bridge, ageing_time)
|
||||
|
|
|
@ -14,5 +14,6 @@ MinLinks=1
|
|||
AdActorSystemPriority=1218
|
||||
AdUserPortKey=811
|
||||
AdActorSystem=00:11:22:33:44:55
|
||||
ARPMissedMax=10
|
||||
# feed the sanitizer
|
||||
AdActorSystem=00:11:22:33:44:55
|
||||
|
|
9
test/test-network/conf/25-bond-property.netdev
Normal file
9
test/test-network/conf/25-bond-property.netdev
Normal file
|
@ -0,0 +1,9 @@
|
|||
[NetDev]
|
||||
Name=bond97
|
||||
Kind=bond
|
||||
|
||||
[Bond]
|
||||
Mode=active-backup
|
||||
PrimaryReselectPolicy=always
|
||||
MIIMonitorSec=1s
|
||||
ARPMissedMax=10
|
|
@ -1482,10 +1482,10 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
self.assertIn('vlan_default_pvid 9 ', output)
|
||||
|
||||
def test_bond(self):
|
||||
copy_network_unit('25-bond.netdev', '25-bond-balanced-tlb.netdev')
|
||||
copy_network_unit('25-bond.netdev', '25-bond-balanced-tlb.netdev', '25-bond-property.netdev')
|
||||
start_networkd()
|
||||
|
||||
self.wait_online('bond99:off', 'bond98:off', setup_state='unmanaged')
|
||||
self.wait_online('bond99:off', 'bond98:off', 'bond97:off', setup_state='unmanaged')
|
||||
|
||||
self.check_link_attr('bond99', 'bonding', 'mode', '802.3ad 4')
|
||||
self.check_link_attr('bond99', 'bonding', 'xmit_hash_policy', 'layer3+4 1')
|
||||
|
@ -1513,6 +1513,11 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
|||
print(output)
|
||||
self.assertIn('Mode: balance-tlb', output)
|
||||
|
||||
output = networkctl_status('bond97')
|
||||
print(output)
|
||||
|
||||
self.check_link_attr('bond97', 'bonding', 'arp_missed_max', '10')
|
||||
|
||||
def test_vlan(self):
|
||||
copy_network_unit('21-vlan.netdev', '11-dummy.netdev',
|
||||
'21-vlan.network', '21-vlan-test1.network')
|
||||
|
|
Loading…
Reference in a new issue