public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-ve-rs v7 08/21] frr: add bgp support with templates and serialization
Date: Fri, 27 Mar 2026 11:05:51 +0100	[thread overview]
Message-ID: <mnr4l6vfcaectg7c6uucpdl5lr4co7oq6iiixctpd5qwc3ey5b@hqjwm5ra25vj> (raw)
In-Reply-To: <06cc8c1f-03e3-4e6f-8bbc-69874ea6c953@proxmox.com>

On 27.03.2026 01:50, Thomas Lamprecht wrote:
> Am 23.03.26 um 14:50 schrieb Gabriel Goller:
> > +++ b/proxmox-frr-templates/templates/bgpd.jinja
> > +{% for ip_route in vrf.ip_routes %}
> > +{% if ip_route.vrf %}
> > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route ...
> > +{% else %}
> > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route ...
> > +{% endfor %}
> > +{% endif %}
> 
> the endfor and endif statements are swapped here - the for-loop is closed
> while the if-block is still open. This is a Jinja nesting error that should
> fail at template parse time, at least that's what I'd expect.
> 
> Ah, it's fixed in 09/21 but should be squashed into this patch.

Ah, I blame `jj absorb` :)

> > +++ b/proxmox-frr/src/ser/bgp.rs
> > +pub struct NeighborGroup {
> > +    pub ebgp_multihop: Option<i32>,
> 
> eBGP multihop can't be negative (FRR accepts 1-255), so probably should be
> an Option<u8>?

Agree, fixed.

> > +pub struct L2vpnEvpnAF {
> > +    pub autort_as: Option<i32>,
> 
> Similar here, ASNs are unsigned, so Option<u32>.

Fixed as well.

> > +pub struct NeighborGroup {
> > +    pub local_as: Option<u32>,
> 
> This field exists but bgp_router.jinja never renders `neighbor X local-as
> Y`. If intentionally unsupported for now, either just drop it or add some
> (TODO) comment providing rationale.

Yep, this will (most likely) be added with the bgp fabrics. Removed it for now
though.

> > +++ b/proxmox-frr-templates/templates/frr.conf.jinja
> > +{% include "bgpd.jinja" %}
> >  {% include "isisd.jinja" %}
> > +{% include "prefix_lists.jinja" %}
> >  {% for line in custom_frr_config %}
> >  {{ line }}
> >  {% endfor %}
> >  {% include "fabricd.jinja" %}
> >  {% include "ospfd.jinja" %}
> >  {% include "access_lists.jinja" %}
> >  {% include "route_maps.jinja" %}
> > +{% include "ip_routes.jinja" %}
> >  {% include "protocol_routemaps.jinja" %}
> 
> Nit: prefix_lists ends up "separated" from the includes of access_lists and
> route_maps by custom_frr_config + fabricd + ospfd. Since route-maps
> reference prefix/access lists, grouping all filter objects together would be
> more conventional and might be maybe slightly friendlier to frr-reload.py's
> incremental processing.

This would be nice, but we can't do this since this would break
backwards-compat. This is the order (circa) in which the perl-code currently
generates and we need to preserve this because otherwise stuff becomes
overrideable by the frr.conf.local suddenly.




  reply	other threads:[~2026-03-27 10:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 13:48 [PATCH manager/network/proxmox{-ve-rs,-perl-rs} v7 00/21] Generate frr config using jinja templates and rust types Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 01/21] ve-config: firewall: cargo fmt Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 02/21] frr: add proxmox-frr-templates package that contains templates Gabriel Goller
2026-03-26 15:15   ` Shannon Sterz
2026-03-27  9:07     ` Gabriel Goller
2026-03-27  9:12       ` Gabriel Goller
2026-03-27 10:10         ` Thomas Lamprecht
2026-03-27 10:17           ` Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 03/21] ve-config: remove FrrConfigBuilder struct Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 04/21] sdn-types: support variable-length NET identifier Gabriel Goller
2026-03-26 15:15   ` Shannon Sterz
2026-03-27  9:25     ` Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 05/21] frr: add template serializer and serialize fabrics using templates Gabriel Goller
2026-03-27  0:37   ` Thomas Lamprecht
2026-03-27  9:45     ` Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 06/21] frr: add isis configuration and templates Gabriel Goller
2026-03-27  0:41   ` Thomas Lamprecht
2026-03-27  9:53     ` Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 07/21] frr: support custom frr configuration lines Gabriel Goller
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 08/21] frr: add bgp support with templates and serialization Gabriel Goller
2026-03-27  0:50   ` Thomas Lamprecht
2026-03-27 10:05     ` Gabriel Goller [this message]
2026-03-23 13:48 ` [PATCH proxmox-ve-rs v7 09/21] frr: enable minijinja strict undefined behavior mode Gabriel Goller
2026-03-23 13:49 ` [PATCH proxmox-ve-rs v7 10/21] frr: add vtysh integration tests for proxmox-frr Gabriel Goller
2026-03-24  9:03   ` Gabriel Goller
2026-03-23 13:49 ` [PATCH proxmox-perl-rs v7 11/21] sdn: add function to generate the frr config for all daemons Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 12/21] tests: use Test::Differences to make test assertions Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 13/21] test: add tests for frr.conf.local merging Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 14/21] test: bgp: add some various integration tests Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 15/21] sdn: write structured frr config that can be rendered using templates Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 16/21] sdn: remove duplicate comment line '!' in frr config Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 17/21] tests: rearrange some statements in the " Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 18/21] sdn: adjust frr.conf.local merging to rust template types Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 19/21] test: adjust frr_local_merge test for new template generation Gabriel Goller
2026-03-23 13:49 ` [PATCH pve-network v7 20/21] api: add dry-run endpoint for sdn apply to preview changes Gabriel Goller
2026-03-27  1:07   ` Thomas Lamprecht
2026-03-23 13:49 ` [PATCH pve-manager v7 21/21] sdn: add dry-run diff view for sdn apply Gabriel Goller
2026-03-26 13:40 ` [PATCH manager/network/proxmox{-ve-rs,-perl-rs} v7 00/21] Generate frr config using jinja templates and rust types Wolfgang Bumiller
2026-03-27  1:11 ` Thomas Lamprecht
2026-03-27 10:06   ` Gabriel Goller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mnr4l6vfcaectg7c6uucpdl5lr4co7oq6iiixctpd5qwc3ey5b@hqjwm5ra25vj \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal