Commit Graph

14 Commits

Author SHA1 Message Date
06046cd51a Allow TAP instances to be interfaces
- Cannot have LCP, Address or Sub-Interface
- Cannot be PHY
- Cannot be Bond member
- Can be target of L2XC
- Can be member of Bridge
- interface.mtu must be the same as tap.host.mtu

Add YAML tests for common mistakes. This unblocks taps becoming members
of a bridgedomain, and allowing a very cool feature: slowpath networking!
2022-04-10 16:10:19 +00:00
a7545ac5af Add ability to manipulate MACs
Special care is taken for bondethernet, where the MAC changes when
the first member is added to it. BondEthernet requires its MAC to
be set in the bondethernets section, disallowing the MAC of individual
members to be set.

Also write a dumper for MACs of all types. Update integration test
cases to stress the MAC changes on loops, bonds, and phys.
2022-04-10 09:54:51 +00:00
a8ced1b982 Assert that BVI loopback's mtu is the same as its bridge MTU 2022-04-05 17:54:23 +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
342ccf3765 Add a real life example (hippo12.yaml) which shows all supported config so far 2022-04-03 09:19:25 +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
c18f04fa55 Refactor: stop trying to derive implicit LCP names. Make it mandatory and explicitly configured 2022-03-21 11:06:15 +00:00
bb57ed8e52 IP Address validator
Returns True if there is at most one occurence of the ip_interface (an IPv4/IPv6 prefix+len)
in the entire config. That said, we need the 'iface_addresses' because VPP is a bit fickle in
this regard.

IP addresses from the same prefix/len can be added to a given interface (ie 192.0.2.1/24 and
192.0.2.2/24), but other than that, any prefix can not occur as a more-specific or less-specific
of any other interface.

So, we will allow:
- any ip_interface that is of equal network/len of existing one(s) _on the same interface_

And, we will reject
- any ip_interface that is a more specific of any existing one
- any ip_interface that is a less specific of any existing one

Update unit tests to ensure ip_interfaces are allowed in all cases.
2022-03-13 23:50:10 +00:00
0313666f69 Force LCP names to be unique 2022-03-13 13:17:14 +00:00
29fcdaefe9 Add check to ensure combined length of sub-int LCP name is not larger than 15 chars. For the main int, this is ensured already by schema validation 2022-03-13 12:38:54 +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
8a7c2f8b7c Remove invalid config from the example 2022-03-13 10:20:38 +00:00
edb8e301ff Add loopbacks 2022-03-13 10:18:27 +00:00
9862129ab0 Initial commit 2022-03-13 09:54:50 +00:00