Add device-type, to ensure that plan --novpp generates MTU statements

This commit is contained in:
Pim van Pelt
2023-05-25 16:54:01 +02:00
parent 3249432681
commit cf5f1f0944
4 changed files with 12 additions and 1 deletions

View File

@ -304,6 +304,8 @@ exist as a PHY in VPP (ie. `HundredGigabitEthernet12/0/0`) or as a specified `Bo
target interface. target interface.
* ***state***: An optional string that configures the link admin state, either `up` or `down`. * ***state***: An optional string that configures the link admin state, either `up` or `down`.
If it is not specified, the link is considered admin 'up'. If it is not specified, the link is considered admin 'up'.
* ***device-type***: An optional interface type in VPP. Currently the only supported vlaue is
`dpdk`, and it is used to generate correct mock interfaces if the `--novpp` flag is used.
Further, top-level interfaces, that is to say those that do not have an encapsulation, are permitted Further, top-level interfaces, that is to say those that do not have an encapsulation, are permitted
to have any number of sub-interfaces specified by `subid`, an integer between [0,2G), which further to have any number of sub-interfaces specified by `subid`, an integer between [0,2G), which further
@ -324,6 +326,7 @@ Examples:
``` ```
interfaces: interfaces:
HundredGigabitEthernet12/0/0: HundredGigabitEthernet12/0/0:
device-type: dpdk
lcp: "ice0" lcp: "ice0"
mtu: 9000 mtu: 9000
addresses: [ 192.0.2.1/30, 2001:db8:1::1/64 ] addresses: [ 192.0.2.1/30, 2001:db8:1::1/64 ]

View File

@ -271,6 +271,9 @@ with `head.vpp` (think of things like custom logging, plugin defaults, DPDK affi
then letting `vppcfg` do its part, and finally leaving the ability to also program the dataplane then letting `vppcfg` do its part, and finally leaving the ability to also program the dataplane
with things that `vppcfg` does not (yet) support in `tail.vpp`. with things that `vppcfg` does not (yet) support in `tail.vpp`.
***NOTE***: For MTU values to be generated in `--novpp` mode, the interface device type must be
set (typically using `device-type: dpdk` in the PHY interface definition).
### vppcfg apply ### vppcfg apply
Applying state is not (yet) implemented. Don't worry, it's not much work, but this is punted until Applying state is not (yet) implemented. Don't worry, it's not much work, but this is punted until

View File

@ -77,7 +77,8 @@ class Validator:
The purpose is to ensure that the YAML file is both syntactically correct, The purpose is to ensure that the YAML file is both syntactically correct,
which is ensured by Yamale, and semantically correct, which is ensured by a set which is ensured by Yamale, and semantically correct, which is ensured by a set
of built-in validators, and user-added validators (see the add_validator() method).""" of built-in validators, and user-added validators (see the add_validator() method).
"""
def __init__(self, schema): def __init__(self, schema):
self.logger = logging.getLogger("vppcfg.config") self.logger = logging.getLogger("vppcfg.config")

View File

@ -7,13 +7,16 @@ bondethernets:
interfaces: interfaces:
GigabitEthernet3/0/0: GigabitEthernet3/0/0:
device-type: dpdk
mtu: 9000 mtu: 9000
description: "LAG #1" description: "LAG #1"
GigabitEthernet3/0/1: GigabitEthernet3/0/1:
device-type: dpdk
mtu: 9000 mtu: 9000
description: "LAG #2" description: "LAG #2"
HundredGigabitEthernet12/0/0: HundredGigabitEthernet12/0/0:
device-type: dpdk
lcp: "ice12-0-0" lcp: "ice12-0-0"
mac: f2:01:00:12:00:00 mac: f2:01:00:12:00:00
mtu: 9000 mtu: 9000
@ -34,6 +37,7 @@ interfaces:
exact-match: True exact-match: True
HundredGigabitEthernet12/0/1: HundredGigabitEthernet12/0/1:
device-type: dpdk
mtu: 2000 mtu: 2000
description: "Bridged" description: "Bridged"