^ Listen to @dubito - he got it working before I did
A muvirt build with restool has just come out of “the oven”, download it from here.
I haven’t tested the DPAA2 passthrough just yet but the creation of DPAA2 objects works.
The “default” configuration is to have all 10 ethernet ports wired up in the “root” container (dprc.1).
To play with custom DPAA2 configurations you’ll need to start with the “blank” DPL (eth-dpl-eth0-only.dtb
) as there is no “room” left in the default configuration to add anything.
Every VM (anything that crosses an IOMMU boundary) needs it’s own dprc container and objects.
Objects inside a child container can reference (be “linked” to) a parent container object which means you can do:
- VM with access to “external” Ethernet port (DPNI->DPMAC)
- VM with “back-to-back” connection either to host or another VM (DPNI->DPNI)
- VM with connection to DPDMUX (Ethernet virtual bridge)
There is a bit of a pitfall at the moment in that DPAA2 “passthrough” only works when a device tree is used by the child VM, rather than ACPI (via EDKII) which is the default for muvirt.
Two ways around it are:
- Supply your own compatible kernel image directly to QEMU so the guest kernel is booted directly, as @dubito has done above
- Use u-boot rather than EDKII as the VM’s bootloader
The DPDMUX page on the muvirt wiki and the dynamic DPDMUX tree enable this. It’s been a while since I worked on it, but having restool back removes a blocker to having this merged in.
The dpaa2.lua library I wrote for DPDMUX support might serve as a good reference on how to do certain tasks.
Some commands to get started:
$ restool dprc generate-dpl # Dump the data plane config out to a DTS which you can then compile into a .dtb and flash
# hint: the recovery firmware has restool and dtc (the compiler) so you can experiment there
$ ls-addni dpmac.3 # create an ethernet interface with GE4
# create a child DPRC, note the --options are important
restool dprc create dprc.1 --label="child VM dprc" \
--options=DPRC_CFG_OPT_IRQ_CFG_ALLOWED,DPRC_CFG_OPT_SPAWN_ALLOWED,DPRC_CFG_OPT_ALLOC_ALLOWED,DPRC_CFG_OPT_OBJ_CREATE_ALLOWED
dprc.2 is created under dprc.1
# create DPNI under child dprc
# note that this by itself isn't enough to get an Ethernet interface working, you need other objects
# such as DPBP's,DPCONs,DPIO etc.
$ restool dpni create --container=dprc.2
dpni.4 is created under dprc.2
# connect child VM DPNI to dpmac.4 (host GE5), must be done from the top container
$ restool dprc connect dprc.1 --endpoint1=dpmac.4 --endpoint2=dpni.4
# "plug in" a DPNI (otherwise it won't be activated by the OS)
restool dprc assign dprc.2 --object=dpni.4 --plugged=1
# show contents of a DPRC
$ restool dprc show dprc.2
dprc.2 contains 1 objects:
object label plugged-state
dpni.4 plugged