Hoi, I've been playing around with the Linux CP plugin, and realized that it can only create untagged, and dot1q tagged interfaces, but not other types of interfaces (dot1ad, q-in-ad, and q-in-q). There were also some API gotchas that provoked crashes. I spent a few days extending it to support all types of interfaces, and just submitted https://gerrit.fd.io/r/c/vpp/+/33481/ which, pending unit and functional testing from jenkins, could use some review.
I documented my journey in https://ipng.ch/s/articles/2021/08/12/vpp-1.html which explains my test setup, my results with the plugin that ships with 21.06, and the patches I propose: * [[patchset 3](https://gerrit.fd.io/r/c/vpp/+/33481/2..3)] Initialize the link state of the VPP interface, not unconditionally set it to 'down'. Initialize the MTU of the VPP interface into the TAP, do not assume it is the VPP default of 9000; if the MTU is not known, assume the TAP has 9216, the largest possible on ethernet. * [[patchset 4](https://gerrit.fd.io/r/c/vpp/+/33481/3..4)] changed the behavior to explicitly reject sub-interfaces that are not exact-match, they are not routable (fixes a crash) * [[patchset 5](https://gerrit.fd.io/r/c/vpp/+/33481/4..5)] makes the plugin aware of dot1ad. Without this change, the plugin would create the interface, but it would invariably create it as .1q on the linux side. * [[patchset 6](https://gerrit.fd.io/r/c/vpp/+/33481/5..6)] allows the plugin to create QinQ and QinAD interfaces, by looking up the linux intermediary interface and creating the netlink child on that one, not the phy. * [[patchset 7](https://gerrit.fd.io/r/c/vpp/+/33481/6..7)] fixes a crash where an LCP for a sub-int is asked to be created, but the parent doesn't have an LCP yet. I fixed a few other small formatting/presentation things along the way. The blog post above shows a functional test before and after. Please take a look. There are a few additional tasks on my TODO list for Linux CP: 1) Interface plumbing (done) 2) mirroring VPP changes into Linux, things like interface state and mtu change, and addresses) 3) auto-creating sub-interfaces when they are created in VPP; what originally the 'auto-intf' keyword was meant to do, but doesn't quite do yet :) 4) mirroring Linux changes into VPP (aka complete the netlink listener) groet, Pim -- Pim van Pelt <p...@ipng.nl> PBVP1-RIPE - http://www.ipng.nl/
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#19966): https://lists.fd.io/g/vpp-dev/message/19966 Mute This Topic: https://lists.fd.io/mt/84849551/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-