Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

From: Andrew Lunn
Date: Tue Apr 03 2018 - 21:06:01 EST


> Suppose you want to create and assign a network interface to a KVM
> virtual machine, you would do something like the following using
> a user space tool like restool:
> -create a new (empty) dprc object
> -create a new dpni and assign it to the dprc
> -create a new dpio and assign it to the dprc
> -create a new dpbp and assign it to the dprc
> -create a new dpmcp and assign it to the dprc
> -create a new dpmac and assign it to the dprc
> -connect the dpni to the dpmac

Hi Stuart

It this connecting to a physical port at the bottom?

If so, i would expect that when you probe the device you just create
all these for each physical port. You then just need to map one of
them into the KVM, in the same way you map one PCI device into a KVM.

If these are virtual devices, VF devices you would normally do

echo 4 > /sys/class/net/<device name>/device/sriov_numvfs

on the physical device to create virtual devices.

> The fsl-mc bus and DPAA2 is very NXP-specific, so there doesn't
> seem to be anything that can be made generic here to provide
> more common benefit.

Which is why you should try to avoid all of this. The user knows how
to use standard linux commands and concepts. They don't want to have
to learn the inside plumbing of your hardware.

Andrew