From cf5f1f094441d48e0abd7a8186d41360651b38c5 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Thu, 25 May 2023 16:54:01 +0200 Subject: [PATCH] Add device-type, to ensure that plan --novpp generates MTU statements --- docs/config-guide.md | 3 +++ docs/user-guide.md | 3 +++ vppcfg/config/__init__.py | 3 ++- vppcfg/example.yaml | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/config-guide.md b/docs/config-guide.md index f94667a..b7fd14f 100644 --- a/docs/config-guide.md +++ b/docs/config-guide.md @@ -304,6 +304,8 @@ exist as a PHY in VPP (ie. `HundredGigabitEthernet12/0/0`) or as a specified `Bo target interface. * ***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'. +* ***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 to have any number of sub-interfaces specified by `subid`, an integer between [0,2G), which further @@ -324,6 +326,7 @@ Examples: ``` interfaces: HundredGigabitEthernet12/0/0: + device-type: dpdk lcp: "ice0" mtu: 9000 addresses: [ 192.0.2.1/30, 2001:db8:1::1/64 ] diff --git a/docs/user-guide.md b/docs/user-guide.md index c40c894..51612b6 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -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 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 Applying state is not (yet) implemented. Don't worry, it's not much work, but this is punted until diff --git a/vppcfg/config/__init__.py b/vppcfg/config/__init__.py index e8221e8..d7b469e 100644 --- a/vppcfg/config/__init__.py +++ b/vppcfg/config/__init__.py @@ -77,7 +77,8 @@ class Validator: 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 - 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): self.logger = logging.getLogger("vppcfg.config") diff --git a/vppcfg/example.yaml b/vppcfg/example.yaml index c11813d..6df2d61 100644 --- a/vppcfg/example.yaml +++ b/vppcfg/example.yaml @@ -7,13 +7,16 @@ bondethernets: interfaces: GigabitEthernet3/0/0: + device-type: dpdk mtu: 9000 description: "LAG #1" GigabitEthernet3/0/1: + device-type: dpdk mtu: 9000 description: "LAG #2" HundredGigabitEthernet12/0/0: + device-type: dpdk lcp: "ice12-0-0" mac: f2:01:00:12:00:00 mtu: 9000 @@ -34,6 +37,7 @@ interfaces: exact-match: True HundredGigabitEthernet12/0/1: + device-type: dpdk mtu: 2000 description: "Bridged"