Commit Graph

10 Commits

Author SHA1 Message Date
9d1d8a32d6 Add device-type, to ensure that plan --novpp generates MTU statements 2023-05-25 16:56:53 +02:00
305a30b1a1 feature: stateless planning
Add a  feature to plan a configuration without reading from the VPP Dataplane.

In this mode, the configuration file is read and validated in the same way as `check` or `plan`,
but then instead of retrieving the running state from the VPP API, a state is re-created using
the physical interfaces specified in the YAML config.

Implement this by creating vppapi:mockconfig() which reads the 'interfaces' scope from the YAML
config file, and creates a VPPMessage() of type sw_interface_details for each interface that is a
PHY (for now, only supporting device-type 'dpdk').

If the flag --novpp is specified in the planner, call mockconfig() instead of readconfig().

Some further details:
- if the MAC is not set in the YAML config, it won't be set in the output exec file.
- for bondethernets, no MAC can be generated unless it's set in the first member.
- the MTU is always set, because it's mocked to 64b and the YAML file will always be higher.

TESTED:
- the unit tests and YAML tests all pass
- the integration tests all pass, but they do not call this new codepath

- Based on an empty VPP on Hippo, I compared the output of these two, side by side:
for i in intest/*yaml; do ./vppcfg.py plan -c $i -o /tmp/$i-vpp.exec; done
for i in intest/*yaml; do ./vppcfg.py plan --novpp -c $i -o /tmp/$i-novpp.exec; done

==> The only changes here are:
* if I cannot determine the bondether MAC in the --novpp case, it is not emitted
* if the MAC address is set in the YAML file, the --novpp case will always emit it
* if VPP has mtu 9000, the --novpp case will end up still emitting interface and packet MTU,
  because it mocks the interface MTU at 64.

In all cases, --novpp emits more configuration statements, and the statements that it emits are
redundant.
2022-12-03 16:03:38 +00:00
a4a91d1f5e Replace dumper with an actual YAML emitter 2022-04-03 21:37:48 +00:00
ce15b5a6fd Document 'vppcfg plan' including an example 2022-04-03 13:18:32 +00:00
35e878a42e Add example output to illustrate the 'vppcfg dump' command 2022-04-03 13:05:48 +00:00
dfd8c8b8a9 Add user guide for 'vppcfg dump' command 2022-04-03 13:01:31 +00:00
eee47c02b1 Explain that 'check' does not use VPP interaction at all 2022-04-03 12:53:14 +00:00
82d78c721c Clarification on return value 2022-04-03 12:51:15 +00:00
3a4416e8d7 Add a user guide for 'vppcfg check' 2022-04-03 12:48:40 +00:00
ef475a200a Move docs into their own directory 2022-04-03 12:03:55 +00:00