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 955201FF0E1 for ; Mon, 27 Jul 2026 18:13:44 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 26E4F214B5; Mon, 27 Jul 2026 18:13:44 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 27 Jul 2026 18:13:38 +0200 Message-Id: Subject: Re: [PATCH pve-common 1/3] iproute2: restructure get_physical_bridge_ports From: "Lukas Sichert" To: "Stefan Hanreich" , References: <20260709132857.239615-1-s.hanreich@proxmox.com> <20260709132857.239615-2-s.hanreich@proxmox.com> In-Reply-To: <20260709132857.239615-2-s.hanreich@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785168783555 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.072 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_LOW -0.7 Sender listed at https://www.dnswl.org/, low 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: QGTH55Q43MLUTF2LDW7YVKXLWMQOS42F X-Message-ID-Hash: QGTH55Q43MLUTF2LDW7YVKXLWMQOS42F X-MailFrom: l.sichert@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2026-07-09 15:28, Stefan Hanreich wrote: > By checking first if the interface is a member of the bridge, instead > of determining its type, a lot of unnecessary checks are not performed > since checking for membership first is a lot more discriminatory. When > applying a SDN configuration with 100 VLAN VNets on a non-VLAN-aware > bridge, this saves a significant amount of statements executed: > > without this optimization: > Executed 438813 statements in 110ms > > with this optimization: > Executed 3693 statements in 10.2ms > > Signed-off-by: Stefan Hanreich > --- I tested this on a Machine with 1k QinQ and 1k VLAN VNets. I could verify a substantial speed increase. In my case it was ~5.5x. Switching the order to check for the most discriminatory check first makes sense to me. Therefore, consider this: Reviewed-by: Lukas Sichert Tested-by: Lukas Sichert