mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Import ieee802-ethernet-interface@2025-09-10.yang, from IEEE 802.3.2-2025, and companion ieee802-ethernet-phy-type.yang, replacing the 2019 revision. Operational interface speed moves to ietf-interfaces:speed, RFC 8343, eth:speed is now obsolete. Bump infix-interfaces.yang revision to track the upgrade. The CLI 'show interface' command renders interfaces as bottom-up layered protocol rows. Ethernet interfaces a new IEEE link-mode row (1000baseT, 10GbaseLR, ...) is added with 'duplex: full|half' in the DATA column. Without link the ethernet row is the first row. Tunnels and wifi follow the same layering: gre/vxlan rows carry remote:/vni: tokens with optional ethernet sub-row for the L2-bearing variants; wifi rows carry 'station' or 'access-point' ssid:, signal:, stations: tokens. admin@bpi-76-8f-c2:/> show interface ⚑ INTERFACE PROTOCOL STATE DATA ⇅ lo loopback UP ipv4 127.0.0.1/8 (static) ipv6 ::1/128 (static) ⇅ br0 bridge DOWN │ ethernet 32:2e:3f:76:8f:c2 │ ipv4 192.168.0.1/24 (static) ⇅ ├ lan0 bridge LOWER-DOWN ⇅ ├ lan1 bridge LOWER-DOWN ⇅ ├ lan2 bridge LOWER-DOWN ⇅ └ lan3 bridge LOWER-DOWN ⇅ gre0 gre UP remote: 198.51.100.7 ipv4 10.255.0.1/30 (static) ⇅ sfp1 ethernet DOWN ca:59:f0:77:80:5b ⇅ wan 1000baseT UP duplex: full ethernet 32:2e:3f:76:8f:c2 ipv4 192.168.0.235/24 (dhcp) ipv6 fe80::302e:3fff:fe76:8fc2/64 (link-layer) ⇅ wan.10 vlan UP vid: 10 │ ipv4 10.0.10.1/24 (static) └ wan ⇅ wan.10.20 vlan UP vid: 20 │ ipv4 10.0.10.20/28 (static) └ wan.10 ⇅ wifi0 wifi UP station ssid: corp-net signal: good ethernet dc:a6:32:00:11:22 ipv4 192.168.7.42/24 (dhcp) yanger populates phy-type and pmd-type from a static ETHTOOL link-mode identity table keyed on (port, speed, duplex). Both leaves are populated for unambiguous media (copper, DAC, copper-T); for generic fiber where the (port, speed, duplex) tuple can map to multiple PMDs (SR vs LR vs ER, etc.) only the phy-type family identity is emitted — guessing the PMD would be misleading. cli_pretty prefers pmd-type (specific) and falls back to phy-type (family) for display. yanger also emits ietf-interfaces:speed and fixes a long-standing 'auto-negotation' typo (yanger had never matched ethtool's correctly- spelled JSON field, so operational auto-negotiation always read 'unknown'). Filling the WG's gap on fixed-speed config ------------------------------------------ IEEE Std 802.3.2-2025 obsoleted the eth:speed leaf without providing a config-true replacement; the standards-correct way to express what older Infix configurations called 'fixed speed' is to restrict the set of PMDs auto-negotiation may advertise. Augment auto-negotiation with two leaf-lists: auto-negotiation/advertised-pmd-types config-true, leaf-list of pmd-type ethernet/supported-pmd-types config-false, leaf-list of pmd-type Pinning a port to a single mode is now expressed as a single-entry advertised-pmd-types list. The kernel-supported set is exposed as operational state for diagnosis — SFP/SFP+ cages report the inserted module's capabilities, narrowing the list to a single PMD when the optic only supports one mode (as suggested by @wkz in PR review). When the supported list collapses to a single entry, yanger uses it to refine the operational pmd-type leaf — more accurate than the (port, speed, duplex) lookup for fiber. confd C apply path (src/confd/src/ieee802-ethernet-interface.c) translates each advertised pmd-type identity to the corresponding ETHTOOL_LINK_MODE_*_BIT_*, ORs them into a mask, and emits 'ethtool --change <if> autoneg on advertise 0x<mask>'. An empty list keeps the historical default of advertising every supported mode. The (legacy) 'auto-negotiation/enable = false' + speed/duplex branch is removed — it has no model representation any more. cli_pretty's detail view gains 'advertised' and 'supported' rows listing the PMDs in each set. A new _pr_label_list() helper unifies multi-row rendering across these new rows and the pre-existing ipv4/ipv6 address rows. The detailed interface view also gains a 'link mode' row carrying the pmd-type / phy-type-derived label. Migration of existing startup configurations -------------------------------------------- Bump confd version 1.8 → 1.9 to trigger the migration on upgrade. share/migrate/1.9/10-ethernet-advertise.sh translates old configs of the form ethernet { auto-negotiation { enable false; } speed S; duplex D; } into ethernet { auto-negotiation { advertised-pmd-types [PMD]; } duplex D; } mapping (S, D) → PMD via a static lookup covering the copper-T speeds the deprecated speed leaf historically supported (10/100/1000/2.5G/ 5G/10G). Interfaces that don't disable auto-negotiation, or that lack a speed leaf, are passed through untouched. Closes #530 Closes #805 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
4.3 KiB
4.3 KiB
⚑ INTERFACE PROTOCOL STATE DATA
lo loopback UP
ipv4 127.0.0.1/8 (static)
ipv6 ::1/128 (static)
br-0 bridge DOWN
ethernet 00:a0:85:00:03:00
br-D bridge
│ ethernet 00:a0:85:00:03:00
│ ipv4 10.0.0.1/8 (static)
│ ipv4 192.168.20.1/24 (static)
│ ipv6 2001:db8::1/64 (static)
│ ipv6 fe80::2a0:85ff:fe00:300/64 (link-layer)
└ veth0a.20 bridge FORWARDING
br-Q bridge vlan: 20u,30u,40t
│ ethernet 00:a0:85:00:03:00
├ e3 bridge FORWARDING vlan: 20t,30t,40t
└ veth0b bridge FORWARDING vlan: 20t,30t,40t
br-Q.40 vlan UP vid: 40
└ br-Q
br-X bridge
│ ethernet 00:a0:85:00:03:00
└ e2.30 bridge FORWARDING
e1 ethernet UP 00:a0:85:00:03:01
ipv6 fe80::2a0:85ff:fe00:301/64 (link-layer)
e2 ethernet UP 00:a0:85:00:03:02
ipv6 fe80::2a0:85ff:fe00:302/64 (link-layer)
e2.30 vlan UP vid: 30
└ e2
e3.10 vlan UP vid: 10
└ e3
e4 ethernet UP 00:a0:85:00:03:04
ipv6 fe80::2a0:85ff:fe00:304/64 (link-layer)
e5 ethernet UP 00:a0:85:00:03:05
ipv6 fe80::2a0:85ff:fe00:305/64 (link-layer)
e6 ethernet UP 00:a0:85:00:03:06
ipv6 fe80::2a0:85ff:fe00:306/64 (link-layer)
e7 ethernet UP 00:a0:85:00:03:07
ipv6 fe80::2a0:85ff:fe00:307/64 (link-layer)
gre-v4 gre UP remote: 192.168.20.2
gre-v6 gre UP remote: 2001:db8::2
ipv4 192.168.50.2/16 (static)
gretap-v4 gre UP remote: 192.168.20.2
ethernet f6:d4:96:d8:9f:96
gretap-v6 gre UP remote: 2001:db8::2
ethernet 7a:46:13:bd:fa:e6
veth0a veth UP 6e:d0:98:c4:e7:ef
veth0a.20 vlan UP vid: 20
└ veth0a
veth0b veth UP 36:da:80:06:7f:99
vxlan-v4 vxlan UP vni: 4 remote: 192.168.20.200
ethernet 8a:ea:59:32:df:70
ipv4 192.168.30.2/24 (static)
vxlan-v6 vxlan UP vni: 6 remote: 2001:db8::200
ethernet 3e:30:c6:a1:71:64
ipv4 192.168.40.2/24 (static)
lo loopback UP
ipv4 127.0.0.1/8 (static)
ipv6 ::1/128 (static)
br-0 bridge DOWN
ethernet 00:a0:85:00:03:00
br-D bridge
│ ethernet 00:a0:85:00:03:00
│ ipv4 10.0.0.1/8 (static)
│ ipv4 192.168.20.1/24 (static)
│ ipv6 2001:db8::1/64 (static)
│ ipv6 fe80::2a0:85ff:fe00:300/64 (link-layer)
└ veth0a.20 bridge FORWARDING
br-Q bridge vlan: 20u,30u,40t
│ ethernet 00:a0:85:00:03:00
├ e3 bridge FORWARDING vlan: 20t,30t,40t
└ veth0b bridge FORWARDING vlan: 20t,30t,40t
br-Q.40 vlan UP vid: 40
└ br-Q
br-X bridge
│ ethernet 00:a0:85:00:03:00
└ e2.30 bridge FORWARDING
e1 ethernet UP 00:a0:85:00:03:01
ipv6 fe80::2a0:85ff:fe00:301/64 (link-layer)
e2 ethernet UP 00:a0:85:00:03:02
ipv6 fe80::2a0:85ff:fe00:302/64 (link-layer)
e2.30 vlan UP vid: 30
└ e2
e3.10 vlan UP vid: 10
└ e3
e4 ethernet UP 00:a0:85:00:03:04
ipv6 fe80::2a0:85ff:fe00:304/64 (link-layer)
e5 ethernet UP 00:a0:85:00:03:05
ipv6 fe80::2a0:85ff:fe00:305/64 (link-layer)
e6 ethernet UP 00:a0:85:00:03:06
ipv6 fe80::2a0:85ff:fe00:306/64 (link-layer)
e7 ethernet UP 00:a0:85:00:03:07
ipv6 fe80::2a0:85ff:fe00:307/64 (link-layer)
gre-v4 gre UP remote: 192.168.20.2
gre-v6 gre UP remote: 2001:db8::2
ipv4 192.168.50.2/16 (static)
gretap-v4 gre UP remote: 192.168.20.2
ethernet f6:d4:96:d8:9f:96
gretap-v6 gre UP remote: 2001:db8::2
ethernet 7a:46:13:bd:fa:e6
veth0a veth UP 6e:d0:98:c4:e7:ef
veth0a.20 vlan UP vid: 20
└ veth0a
veth0b veth UP 36:da:80:06:7f:99
vxlan-v4 vxlan UP vni: 4 remote: 192.168.20.200
ethernet 8a:ea:59:32:df:70
ipv4 192.168.30.2/24 (static)
vxlan-v6 vxlan UP vni: 6 remote: 2001:db8::200
ethernet 3e:30:c6:a1:71:64
ipv4 192.168.40.2/24 (static)