Add TAP support

- based on previously submitted schema and validation, can add a TAP
  with host netns, bridge and MTU.
- detect diffs in __tap_has_diff(), used to prune TAPs that must change
- add prune_taps() and create_taps() in the reconciler
- add Dumper() logic to emit YAML config for TAPs
- Move tap_is_lcp() into the VPPApi() class, so it can be reused

Add lots of test cases in intest/*.yaml and example.yaml - full
regression and integration and unit/YAML tests pass on this change.
This commit is contained in:
Pim van Pelt
2022-04-12 08:57:05 +00:00
parent 95f56bc865
commit 6637820021
6 changed files with 213 additions and 26 deletions

View File

@ -11,7 +11,8 @@ interfaces:
description: "LAG #2"
HundredGigabitEthernet12/0/0:
description: Not Used
mtu: 1500
description: "bridged with tap"
HundredGigabitEthernet12/0/1:
description: Not Used
@ -42,3 +43,23 @@ interfaces:
encapsulation:
dot1ad: 501
exact-match: False
tap100:
mtu: 1500
loopbacks:
loop100:
lcp: "bvi100"
addresses: [ 10.1.2.1/24 ]
bridgedomains:
bd100:
description: "Bridge Domain 100"
mtu: 1500
bvi: loop100
interfaces: [ HundredGigabitEthernet12/0/0, tap100 ]
taps:
tap100:
host:
name: vpp-tap100
mtu: 1500

View File

@ -66,6 +66,8 @@ interfaces:
exact-match: False
vxlan_tunnel1:
mtu: 2000
tap100:
mtu: 9000
loopbacks:
loop0:
@ -90,3 +92,9 @@ vxlan_tunnels:
local: 192.0.2.1
remote: 192.0.2.2
vni: 101
taps:
tap100:
host:
name: vpp-tap
mtu: 9000

34
intest/hippo14.yaml Normal file
View File

@ -0,0 +1,34 @@
interfaces:
GigabitEthernet3/0/0:
mtu: 9000
state: up
sub-interfaces:
100:
mtu: 9000
l2xc: tap100
GigabitEthernet3/0/1:
mtu: 1500
mac: 00:25:90:0c:05:01
state: down
description: Not Used
HundredGigabitEthernet12/0/0:
mtu: 1500
mac: b4:96:91:b3:b1:10
state: down
description: Not Used
HundredGigabitEthernet12/0/1:
mtu: 1500
mac: b4:96:91:b3:b1:11
state: down
description: Not Used
tap100:
mtu: 9000
l2xc: GigabitEthernet3/0/0.100
taps:
tap100:
host:
name: vpp-tap100
mac: 02:01:be:ef:ca:fe
mtu: 9000