From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B29121FF09B for ; Mon, 09 Nov 2026 15:31:35 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6B73C214ED; Mon, 09 Nov 2026 15:31:35 +0100 (CET) From: Christoph Heiss To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox v2 1/3] fix #6121: network-api: api: add `bond-miimon` option for interfaces Date: Mon, 9 Nov 2026 15:28:14 +0100 Message-ID: <20261109143117.778971-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261109143117.778971-1-c.heiss@proxmox.com> References: <20261109143117.778971-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794234690106 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.134 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DW4PJYWIM2PQD7U3D23EJYN5X5R2E2LY X-Message-ID-Hash: DW4PJYWIM2PQD7U3D23EJYN5X5R2E2LY X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Partially fixes #6121 [0]. Adds a new 'bond-miimon' option to the network interface API for specifying the link monitoring interval. Linux restricts the miimon value to 0..INT_MAX [0], which is reflected in the API. [0] https://bugzilla.proxmox.com/show_bug.cgi?id=6121 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/bonding/bond_options.c?h=v7.3#n404 Reviewed-by: Christian Ebner Tested-by: Christian Ebner Signed-off-by: Christoph Heiss --- Changes v1 -> v2: * changed underlying miimon value type from u8 to u32, restricting it to INT_MAX proxmox-network-api/src/api_impl.rs | 9 +++++++++ proxmox-network-api/src/api_types.rs | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/proxmox-network-api/src/api_impl.rs b/proxmox-network-api/src/api_impl.rs index 78f499c5..0a603017 100644 --- a/proxmox-network-api/src/api_impl.rs +++ b/proxmox-network-api/src/api_impl.rs @@ -162,6 +162,9 @@ pub fn create_interface(iface: String, config: InterfaceUpdater) -> Result<(), E interface.bond_xmit_hash_policy = config.bond_xmit_hash_policy; } } + if config.bond_miimon.is_some() { + interface.bond_miimon = config.bond_miimon; + } if let Some(slaves) = &config.slaves { interface.set_bond_slave_list(slaves)?; } @@ -295,6 +298,9 @@ pub fn update_interface( DeletableInterfaceProperty::BondXmitHashPolicy => { interface.bond_xmit_hash_policy = None } + DeletableInterfaceProperty::BondMiimon => { + interface.bond_miimon = None; + } } } } @@ -335,6 +341,9 @@ pub fn update_interface( } interface.bond_xmit_hash_policy = update.bond_xmit_hash_policy; } + if update.bond_miimon.is_some() { + interface.bond_miimon = update.bond_miimon; + } } if let Some(cidr) = update.cidr { diff --git a/proxmox-network-api/src/api_types.rs b/proxmox-network-api/src/api_types.rs index 58dd7c94..9b267458 100644 --- a/proxmox-network-api/src/api_types.rs +++ b/proxmox-network-api/src/api_types.rs @@ -166,6 +166,14 @@ pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = type: BondXmitHashPolicy, optional: true, }, + "bond-miimon": { + description: "Link monitoring interval in milliseconds for bond interfaces.", + type: Integer, + optional: true, + default: 100, + minimum: 0, + maximum: i32::MAX as i64, + }, altnames: { description: "List of altnames for this interface", type: Array, @@ -240,6 +248,8 @@ pub struct Interface { pub bond_primary: Option, #[serde(skip_serializing_if = "Option::is_none")] pub bond_xmit_hash_policy: Option, + #[serde(rename = "bond-miimon", skip_serializing_if = "Option::is_none")] + pub bond_miimon: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] pub altnames: Vec, @@ -271,6 +281,7 @@ impl Interface { bond_mode: None, bond_primary: None, bond_xmit_hash_policy: None, + bond_miimon: None, altnames: Vec::new(), } } @@ -363,6 +374,8 @@ pub enum DeletableInterfaceProperty { /// Delete bond transmit hash policy #[serde(rename = "bond_xmit_hash_policy")] BondXmitHashPolicy, + /// Delete bond miimon (set to default 100) + BondMiimon, } #[api( @@ -447,6 +460,14 @@ pub enum DeletableInterfaceProperty { type: BondXmitHashPolicy, optional: true, }, + "bond-miimon": { + description: "Link monitoring interval in milliseconds for bond interfaces.", + type: Integer, + optional: true, + default: 100, + minimum: 0, + maximum: i32::MAX as i64, + }, slaves: { schema: NETWORK_INTERFACE_LIST_SCHEMA, optional: true, @@ -480,5 +501,6 @@ pub struct InterfaceUpdater { pub bond_primary: Option, #[serde(rename = "bond_xmit_hash_policy")] pub bond_xmit_hash_policy: Option, + pub bond_miimon: Option, pub slaves: Option, } -- 2.56.0