Commit Graph

23 Commits

Author SHA1 Message Date
be36cc0ede Allow BondEthernet to set MAC, and disallow interfaces to set their MAC if they are a bond member 2022-04-09 21:18:26 +00:00
35edcff884 Allow mac to be set up loopbacks, iff not multicast 2022-04-09 20:47:23 +00:00
d6e3496809 Add TAP syntax/semantic validator 2022-04-09 19:56:48 +00:00
8971c325c0 Allow bondethernet members list to be empty, and omitted from the YAML config 2022-04-05 16:08:51 +00:00
2360d28d0a Add the ability to set any mode/lb on bonds
This requires a schema change, adding 'mode' and 'load-balance' fields,
a semantic invariant that 'load-balance' can only be set in the case of
LACP and XOR bonds, a mapper from the mode/lb strings, ie.
"round-robin" to their VPP numeric counterparts, a bunch of unit tests.

Then in the reconciler, changing bonds (__bond_has_diff()) will
invalidate any LCP or sub-interfaces built on them, so those will have
to be pruned. create_bondethernet() will now create (or re-create)
the bond with the correct flags.

Unit-tests, YAML tests and the integration test all pass.

Updated config-guide.
2022-04-05 15:05:03 +00:00
289138da94 Bundle Yamale schema
TIL! Using the existence of obscure member sys._MEIPASS, I can detect if
we're running from a bundled PyInstaller binary, versus running from Python
directly.

Add schema.yaml to the datas of the PyInstaller spec. Then, if the
-/--schema flag is given, use it, and if it's not given, default to the
built-in one if we're running from a bundled binary, or fall-through to
./schema.yaml in other cases.

This avoids the need for config/schema.py as a carbon-copy of the schema,
slick!
2022-04-05 12:40:05 +00:00
fdb732142a Add bridgedomain settings.
Bridges can be created with default settings, with specific settings,
and they can be sync'd at runtime with all of the settings in this
change.

Notably missing are two features:
- unknown unicast flooding into specific interfaces (as opposed to
  on/off on the bridge)
- learn-limit, which does not have an API getter, only a setter.
2022-04-05 12:01:13 +00:00
b461ef49bb Add 'state' field to interfaces and sub-interfaces
Assert that children cannot be 'up' of their parent is 'down'. Add tests. Update user-guide.
2022-04-05 11:06:33 +00:00
53a7935168 Copy the Yamale schema.yaml file into the source-code verbatim. This allows the tool to run without any external (file) dependencies, using the built-in yamale_schema if the -s/--schema flag is not specified 2022-04-03 15:53:00 +00:00
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
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
b97a0f46b8 Allow LCP to consume the full 15 char length 2022-03-27 14:50:56 +00:00
1e7227a52a Allow for bridgedomains without any member interfaces 2022-03-22 15:38:43 +00:00
343c1097c7 Stop trying to police interface names -- they will be validated by get_by_name() 2022-03-17 00:20:22 +00:00
f921b1721a Expand autocreated LCP namelen to all possible (dot1q, qin*) scenarios. Allow manually set LCP to be 15char in length 2022-03-17 00:15:18 +00:00
59cbc8b886 Add description len=64 to avoid runaway strings 2022-03-16 23:23:28 +00:00
686cd45158 Add first approximation of vxlan_tunnels 2022-03-15 22:21:36 +00:00
c5872880fe Add l2xc support, including extensive tests to validate correct usage of the feature 2022-03-15 20:45:27 +00:00
6b8735bb18 Add bridge-domain support.
Refactor validator main function to avoid 'interface' symbol clash.
Add get_mtu() for interfaces, returns the sub-int's MTU or its parent's MTU, defaulting to 1500.
Ensure MTU for all bridge-domain members is set to the same value.
Ensure all bridge-domain members are L2 (have no LCP, have no address)
2022-03-13 11:20:40 +00:00
edb8e301ff Add loopbacks 2022-03-13 10:18:27 +00:00
b5d8f03e66 Add MTU validation - sub cannot be higher than parent 2022-03-13 10:12:07 +00:00
be102d5b6d Add ip_interface() validator 2022-03-13 09:55:01 +00:00
9862129ab0 Initial commit 2022-03-13 09:54:50 +00:00