From 00386d5b3f09dd1be8965c5b694ec5be8059ef7d Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Mon, 26 Feb 2024 18:56:57 +0530 Subject: [PATCH] netdev: bond - add support for peer_notif_delay Specify the delay, in milliseconds, between each peer notification (gratuitous ARP and unsolicited IPv6 Neighbor Advertisement) when they are issued after a failover event. This delay should be a multiple of the MII link monitor interval (miimon). The valid range is 0 - 300s. The default value is 0, which means to match the value of the MII link monitor interval. --- man/systemd.netdev.xml | 13 +++++++++++++ src/network/netdev/bond.c | 6 ++++++ src/network/netdev/bond.h | 1 + src/network/netdev/netdev-gperf.gperf | 1 + 4 files changed, 21 insertions(+) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index e941a39eb8..4e9afc3674 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -2182,6 +2182,19 @@ + + PeerNotifyDelaySec= + + Specifies the number of seconds the delay between each peer notification + (gratuitous ARP and unsolicited IPv6 Neighbor Advertisement) when they are issued + after a failover event. This delay should be a multiple of the MII link monitor + interval (miimon). The valid range is 0...300s. The default value is 0, + which means to match the value of the MIIMonitorSec=. + + + + + UpDelaySec= diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c index ecf091356b..52a7f126b6 100644 --- a/src/network/netdev/bond.c +++ b/src/network/netdev/bond.c @@ -88,6 +88,12 @@ static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_netlin return r; } + if (b->peer_notify_delay != 0) { + r = sd_netlink_message_append_u32(m, IFLA_BOND_PEER_NOTIF_DELAY, b->peer_notify_delay / USEC_PER_MSEC); + if (r < 0) + return r; + } + if (b->downdelay != 0) { r = sd_netlink_message_append_u32(m, IFLA_BOND_DOWNDELAY, b->downdelay / USEC_PER_MSEC); if (r < 0) diff --git a/src/network/netdev/bond.h b/src/network/netdev/bond.h index b301fa67f0..ea94001e6e 100644 --- a/src/network/netdev/bond.h +++ b/src/network/netdev/bond.h @@ -41,6 +41,7 @@ typedef struct Bond { usec_t downdelay; usec_t arp_interval; usec_t lp_interval; + usec_t peer_notify_delay; OrderedSet *arp_ip_targets; } Bond; diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 1bac0c227d..4883a2652d 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -216,6 +216,7 @@ Bond.UpDelaySec, config_parse_sec, Bond.DownDelaySec, config_parse_sec, 0, offsetof(Bond, downdelay) Bond.ARPIntervalSec, config_parse_sec, 0, offsetof(Bond, arp_interval) Bond.LearnPacketIntervalSec, config_parse_sec, 0, offsetof(Bond, lp_interval) +Bond.PeerNotifyDelaySec, config_parse_sec, 0, offsetof(Bond, peer_notify_delay) 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) -- 2.25.1