From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 401401FF140 for ; Fri, 27 Mar 2026 10:45:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C016D829; Fri, 27 Mar 2026 10:45:46 +0100 (CET) Date: Fri, 27 Mar 2026 10:45:12 +0100 From: Gabriel Goller To: Thomas Lamprecht Subject: Re: [PATCH proxmox-ve-rs v7 05/21] frr: add template serializer and serialize fabrics using templates Message-ID: <23io3kk4i4ssey5urmgft42yktmiqewaton72dmja3iy7wgdg4@z7z4ksrsdua5> Mail-Followup-To: Thomas Lamprecht , pve-devel@lists.proxmox.com References: <20260323134934.243110-1-g.goller@proxmox.com> <20260323134934.243110-6-g.goller@proxmox.com> <56b2e1b3-afcc-44aa-93fc-0b9afa89730e@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56b2e1b3-afcc-44aa-93fc-0b9afa89730e@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774604662699 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: UGPJYRVSLA6BVWAJR4XE6K64IFMKRS6B X-Message-ID-Hash: UGPJYRVSLA6BVWAJR4XE6K64IFMKRS6B X-MailFrom: g.goller@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 CC: pve-devel@lists.proxmox.com 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 27.03.2026 01:37, Thomas Lamprecht wrote: > > +++ b/proxmox-frr/src/ser/openfabric.rs > > +impl std::fmt::Display for OpenfabricRouterName { > > + fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { > > + self.0.fmt(f) > > This calls Debug::fmt now, since FrrWord's Display impl was removed earlier > in this patch. Result: format!("{}", name) gives FrrWord("fabric1") instead > of "fabric1". > > The old code was `write!(f, "openfabric {}", self.0)` which used FrrWord's > Display (just the inner string). Now that Display is gone, self.0.fmt(f) > resolves to Debug::fmt. > > Templates use Serialize so config generation isn't affected, but anything > using Display (logging, errors) gets garbage. Simplest fix: use > write!(f, "{}", self.0.as_ref()) or re-add a trivial Display to FrrWord. Added `write!(f, "{}", self.0.as_ref())`. > > +++ b/proxmox-frr/src/ser/route_map.rs > > +#[serde(tag = "protocol_type")] > > +pub enum RouteMapMatch { > > + #[serde(rename = "ip")] > > + V4(RouteMapMatchInner), > > + #[serde(rename = "ipv6")] > > + V6(RouteMapMatchInner), > > + #[serde(rename = "vni")] > > + Vni(u32), > > #[serde(tag = "...")] (internally tagged) on a variant wrapping a bare u32 > cannot really work as serde can't inject the tag field into a primitive. > This will panic at serialization time IIRC. > > btw. The variant also has no corresponding branch in route_maps.jinja (just > in case I forget to write it there). > > Since it's unreachable from the Perl side today, nothing is broken, but > if it's not needed then I'd suggest removing it until fully wired up, or > switching to Vni(VniMatch) (the struct already exists) (and adding a template > branch in the jinja template). Oh, you're right. This is horrible code anyway, Stefan makes this a lot better in his new route-map series, so I'll just remove the Vni case here. > > +pub enum SetIpNextHopValue { > > > +pub enum SetTagValue { > > > +pub struct VniMatch { > > These three types plus AccessList and PrefixList (the wrapper structs) seem > to be unused - FrrConfig uses BTreeMap> directly now. See above, I'll remove these three as well. Thanks for the review!