First part of a BVI refactor

The handling of BVI is awkward, with the autoderived interface name
"bviXX" based on the bridgedomain bd_id. Lots of special casing happens
on account of this decision, and to make matters worse there is poor
interaction (leading to VPP crashes) when BVIs and Loopbacks are used
at the same time: https://lists.fd.io/g/vpp-dev/message/21116

This is step one of a refactor of the logic. In this commit, I'm
removing all of the BVI logic from the codebase, rendering bridgedomains
unable to have IP interfaces. In the next commit, I will introduce new
behavior in the schema, allowing for 'bvi' to be a loopback
interfacename which will be used as BVI for a bridgedomain, restoring
the ability to use bridgedomains with IP interfaces (using a loop).
This commit is contained in:
Pim van Pelt
2022-03-27 20:04:22 +00:00
parent 90c23cf987
commit 850b982f2a
15 changed files with 25 additions and 248 deletions

View File

@ -29,6 +29,4 @@ bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 2000
lcp: "bvi10"
addresses: [ 10.0.0.2/32, 2001:db8::2/128 ]
interfaces: [ GigabitEthernet3/0/0 ]

View File

@ -46,15 +46,8 @@ bridgedomains:
mtu: 3000
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1, BondEthernet0 ]
bd11:
description: "Bridge Domain 11, both LCP and address"
description: "Bridge Domain 11"
mtu: 2000
interfaces: [ GigabitEthernet2/0/0.100, GigabitEthernet2/0/1.100, BondEthernet0.100 ]
lcp: "bvi123456789012"
addresses: [ 192.0.2.1/29, 2001:db8::1/64 ]
interfaces: [ GigabitEthernet2/0/0.100, GigabitEthernet2/0/1.100 ]
bd12:
description: "Bridge Domain 12, LCP but no address"
mtu: 9000
interfaces: [ GigabitEthernet4/0/0, GigabitEthernet4/0/1 ]
lcp: "bvi12"
bd13:
description: "Bridge Domain 13, it is OK to have no member interfaces"
description: "Bridge Domain 12, it is OK to have no member interfaces"

View File

@ -71,6 +71,4 @@ bridgedomains:
bd10:
description: "Bridge Domain 10"
mtu: 1500
lcp: "bvi10"
addresses: [ 192.0.2.9/29, 2001:db8:2::1/64 ]
interfaces: [ BondEthernet0.203, GigabitEthernet3/0/0 ]

View File

@ -5,8 +5,7 @@ test:
- "interface .* IP address .* conflicts with another"
- "sub-interface .* IP address .* conflicts with another"
- "loopback .* IP address .* conflicts with another"
- "bridgedomain .* IP address .* conflicts with another"
count: 18
count: 14
---
interfaces:
GigabitEthernet1/0/0:
@ -27,8 +26,6 @@ interfaces:
GigabitEthernet1/0/2:
lcp: e0-2
description: "These addresses overlap with bd1"
addresses: [ 192.0.2.18/29, 2001:db8:3::2/64 ]
GigabitEthernet1/0/3:
lcp: e0-3
@ -54,11 +51,3 @@ loopbacks:
description: "These addresses overlap with Gi1/0/1.101"
lcp: "loop0"
addresses: [ 192.0.2.9/29, 2001:db8:2::1/64 ]
bridgedomains:
bd1:
description: "These addresses overlap with Gi1/0/2"
mtu: 2000
lcp: "bvi1"
addresses: [ 192.0.2.17/29, 2001:db8:3::1/64 ]
interfaces: [ GigabitEthernet3/0/0 ]

View File

@ -1,19 +0,0 @@
test:
description: "A bridgedomain with a BVI address must have an LCP"
errors:
expected:
- "bridgedomain .* has an address but no LCP"
count: 1
---
interfaces:
GigabitEthernet1/0/0:
mtu: 3000
GigabitEthernet1/0/1:
mtu: 3000
bridgedomains:
bd13:
description: "Bridge Domain 13, address but no LCP"
mtu: 3000
interfaces: [ GigabitEthernet1/0/0, GigabitEthernet1/0/1 ]
addresses: [ 192.0.2.9/29, 2001:db8:1::1/64 ]

View File

@ -4,9 +4,8 @@ test:
expected:
- "interface .* does not have a unique LCP name"
- "loopback .* does not have a unique LCP name"
- "bridgedomain .* does not have a unique LCP name"
- "bridgedomain bd0 is reserved"
count: 4
count: 3
---
interfaces:
GigabitEthernet1/0/0:
@ -24,5 +23,4 @@ loopbacks:
bridgedomains:
bd0:
description: "bd_id 0 in VPP is reserved"
lcp: "e1"
interfaces: [ GigabitEthernet2/0/0, GigabitEthernet2/0/1 ]