Pim van Pelt
593ffed772
Clarify the encap is optional
2022-04-03 15:03:10 +00:00
Pim van Pelt
196e09b2d2
Add interface/sub-interface config documentation
2022-04-03 15:01:28 +00:00
Pim van Pelt
dc3fb57274
Add config documentation for VXLAN tunnels
2022-04-03 14:46:59 +00:00
Pim van Pelt
720f581e47
Do bounds checking on the BondEthernet and VXLAN Tunnel instances
2022-04-03 14:40:44 +00:00
Pim van Pelt
79f41d447d
Add caveat on bridgedomain configurability
2022-04-03 14:29:35 +00:00
Pim van Pelt
dc0d785818
Add example.yaml reference
2022-04-03 14:22:31 +00:00
Pim van Pelt
e25f73db9c
Add BondEthernet documentation, with a caveat on its restrictive types
2022-04-03 14:20:30 +00:00
Pim van Pelt
00731e38f1
Make code match documentation :-)
...
Bridge Domains must be [1,16M), Loopbacks must be [0,4096).
Loopbacks should be allowed to have an address without an LCP.
=> Reuse the unittest file for the bounds check for loopbacks.
=> Add a new unittest file for the bounds check for bridgedomains.
2022-04-03 14:07:56 +00:00
Pim van Pelt
15daa65c0b
Add bridgedomain config structure
2022-04-03 13:58:45 +00:00
Pim van Pelt
1b13ab7c0c
Add a first piece of explanation on the YAML config structure
2022-04-03 13:41:56 +00:00
Pim van Pelt
ce15b5a6fd
Document 'vppcfg plan' including an example
2022-04-03 13:18:32 +00:00
Pim van Pelt
35e878a42e
Add example output to illustrate the 'vppcfg dump' command
2022-04-03 13:05:48 +00:00
Pim van Pelt
dfd8c8b8a9
Add user guide for 'vppcfg dump' command
2022-04-03 13:01:31 +00:00
Pim van Pelt
eee47c02b1
Explain that 'check' does not use VPP interaction at all
2022-04-03 12:53:14 +00:00
Pim van Pelt
82d78c721c
Clarification on return value
2022-04-03 12:51:15 +00:00
Pim van Pelt
3a4416e8d7
Add a user guide for 'vppcfg check'
2022-04-03 12:48:40 +00:00
Pim van Pelt
2642e94dea
Assert that sub-ints with addresses must have exact-match set
2022-04-03 12:48:09 +00:00
Pim van Pelt
a8ed54308b
Merge from github
2022-04-03 12:04:37 +00:00
Pim van Pelt
ef475a200a
Move docs into their own directory
2022-04-03 12:03:55 +00:00
Pim van Pelt
c3f8a97de9
Move docs into their own directory
2022-04-03 12:02:41 +00:00
Pim van Pelt
2b98d57fd2
Move VPPAPIDumper into its own class.
...
Create a 'dump' command that calls it and exits vppcfg.
Add help strings to each of the commands.
2022-04-03 11:53:51 +00:00
Pim van Pelt
50581f7171
Rename 'config' to 'cache' in the VPPApi.
...
This makes it clearer what its purpose is, in preparation of actual VPP
dataplane configuration changes. For example remove_lcp() refers
currently to the removal of the LCP from the cache, not the VPP
dataplane itself, so rename it and its siblings cache_remove_*()
instead.
In a future commit, the call remove_*() will refer to the removal of an
object _in VPP_.
2022-04-03 11:21:29 +00:00
Pim van Pelt
1a0daa48d1
Move to explicit 'plan -o XXX' commandline
2022-04-03 11:20:47 +00:00
Pim van Pelt
b67493003f
Only write output if in planning mode
2022-04-03 11:05:50 +00:00
Pim van Pelt
566efe3596
Add a CLI output emitter (either to stdout or to filename), based on plan --output/-o flag
2022-04-03 09:49:27 +00:00
Pim van Pelt
8499f2104e
Clean up some debugging statements post-prune
2022-04-03 09:19:51 +00:00
Pim van Pelt
342ccf3765
Add a real life example (hippo12.yaml) which shows all supported config so far
2022-04-03 09:19:25 +00:00
Pim van Pelt
27b4500d3e
Add integration tests in intest/
2022-04-03 09:18:52 +00:00
Pim van Pelt
75e5a23538
Merge branch 'main' of github.com:pimvanpelt/vppcfg into main
2022-04-03 09:04:19 +00:00
Pim van Pelt
d30f2d8965
Relax the LCP requirements - it is OK to have an address without an LCP
2022-04-03 09:04:11 +00:00
Pim van Pelt
5e7f1bdba4
Update LICENSE
...
file was copied from another project (github.com/pimvanpelt/vpp-snmp-agent) which contains code from another author. That author is not affiliated with this repository, so remove them from the LICENSE file.
2022-04-02 23:31:40 +02:00
Pim van Pelt
682d157d5b
Add note on 'Applying' verb which will come next.
2022-04-02 22:37:45 +02:00
Pim van Pelt
6a6caa113e
Update usage output
2022-04-02 22:34:13 +02:00
Pim van Pelt
f786a00e9a
Check for the existence of LCP config statements, and if so, require linux-cp or lcpng plugins are enabled in VPP
2022-04-02 20:16:51 +00:00
Pim van Pelt
240fcebbcf
Remove integration-test.sh
2022-03-29 17:13:55 +00:00
Pim van Pelt
f70bff400f
Introduce a CLI object
...
Instead of writing the CLI calls to stderr as INFO loglines, now add
them to a list of messages by prune/create/sync.
Always close the VPP connection after finishing, by adding a destructor
to the VPPApi class.
At the end of each phase, print out what was gathered to stdout. Later,
I will make this more advanced (output to file, output directly to a
pipe of a running vppctl binary, etc).
2022-03-29 14:04:53 +00:00
Pim van Pelt
7c8f36d1fe
Merge from upstream
2022-03-28 16:44:17 +00:00
Pim van Pelt
2003a21068
Refactor prune_lcps()
...
Fold in the qinx, 1-tag sub, and phy/lookback into one loop, reducing
total LOC by 3x.
Tested by running a hippo integration test (ie 169 config-to-config
transitions), with no material diffs between the old and the new code:
@@ -182,9 +182,9 @@
/tmp/vppcfg-exec_hippo1.yaml: lcp create HundredGigabitEthernet12/0/0.1235 host-if ice0.1234.1000
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
-/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop1
-/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0
+/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop0
+/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop1
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete loop1
@@ -202,8 +202,8 @@
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop1
-/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete BondEthernet0
+/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0
/tmp/vppcfg-exec_hippo1.yaml_hippo3.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo3.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
2022-03-28 16:43:55 +00:00
Pim van Pelt
271b502299
Refactor prune_lcps()
...
Fold in the qinx, 1-tag sub, and phy/lookback into one loop, reducing
total LOC by 3x.
Tested by running a hippo integration test (ie 169 config-to-config
transitions), with no material diffs between the old and the new code:
@@ -182,9 +182,9 @@
/tmp/vppcfg-exec_hippo1.yaml: lcp create HundredGigabitEthernet12/0/0.1235 host-if ice0.1234.1000
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
-/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop1
-/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete HundredGigabitEthernet12/0/0
+/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop0
+/tmp/vppcfg-exec_hippo1.yaml_hippo10.yaml: lcp delete loop1
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
/tmp/vppcfg-exec_hippo1.yaml_hippo11.yaml: lcp delete loop1
@@ -202,8 +202,8 @@
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop1
-/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete BondEthernet0
+/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete loop0
/tmp/vppcfg-exec_hippo1.yaml_hippo2.yaml: lcp delete HundredGigabitEthernet12/0/0
/tmp/vppcfg-exec_hippo1.yaml_hippo3.yaml: lcp delete HundredGigabitEthernet12/0/0.1235
/tmp/vppcfg-exec_hippo1.yaml_hippo3.yaml: lcp delete HundredGigabitEthernet12/0/0.1234
2022-03-28 16:38:35 +00:00
Pim van Pelt
4704780362
Typofix in variable name
2022-03-27 22:09:35 +00:00
Pim van Pelt
020c5f72e1
Also create loopback LCPs
2022-03-27 21:37:56 +00:00
Pim van Pelt
fe49b89492
Bugfix - ensure BVI exists in VPP before trying to remove it
2022-03-27 21:32:02 +00:00
Pim van Pelt
24547869c9
Avoid issuing 'pop 0' for untagged l2xc changes; just emit the exact CLI statement
2022-03-27 21:26:25 +00:00
Pim van Pelt
2415d30c0a
Second 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
In this commit, I reintroduce the ability to set bridgedomain virtual
interfaces by means of the 'bvi' keyword. The 'bvi' must:
- be a Loopback interface
- must be used at most once (bvi_unique())
When pruning, I now need to prune bridgedomains before pruning
loopbacks, because any given loopback might be a BVI for a bridge. So,
I'll remove the loop/BVI from the bridge (by setting it to L3) and only
then removing the loopback from VPP.
In the reconciler, remove BVIs that have changed in prune_bridgedomains()
and set it in sync_bridgedomains().
2022-03-27 20:50:39 +00:00
Pim van Pelt
850b982f2a
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).
2022-03-27 20:09:22 +00:00
Pim van Pelt
90c23cf987
Prune sub-ints that have a different encap than their config counterpart
2022-03-27 16:14:37 +00:00
Pim van Pelt
b97a0f46b8
Allow LCP to consume the full 15 char length
2022-03-27 14:50:56 +00:00
Pim van Pelt
9d6d99547f
Do not append interfaces to bridge_members if their sw_if_index has been removed - this forces the interface to be re-added
2022-03-27 12:52:28 +00:00
Pim van Pelt
78bd0c4f5a
Assert BondEthernet devices also exist as interfaces. Assert MTU of members is equal to that of the BondEthernet interface
2022-03-27 12:29:57 +00:00
Pim van Pelt
176fd297aa
Refactor phys_exist() into phys_exist_in_{config,vpp}(); Correct vppapi.get_phys()
2022-03-26 23:07:49 +00:00