Re: how to setup the host interfacce with sriov and mlx5en(4) driver

From: Chuck Tuffli <chuck_at_freebsd.org>
Date: Sun, 24 Sep 2023 14:03:29 UTC
On Sat, Sep 23, 2023 at 1:14 AM Benoit Chesneau
<benoitc@enki-multimedia.eu> wrote:
>
> Hi all,
>
> I am trying to understand how works sriov with the mlx5en(4) driver.
>
>  In particularly should Isetup the VF-0 as passthrough false? On intel NIC i would have to set one of the VF not passthrough for the host. It seems that sr-iov is behaving differently on mellanox: even if all VFs  are set with `passthrough=true` I can still configure the interface mce0 on the host.
>
> Is this expected? Does it mean the VF-0 is usable too?

In the past, I set up a system similarly:
/etc/rc.conf had the line iovctl_files="/etc/iovctl.d/*.conf"

The file /etc/iovctl.d/mlx.0.conf contains:
$ head -20 /etc/iovctl.d/mlx.0.conf
# Creates 8 virtual functions
# Assuming two physical functions and 16 enabled VF's,
# VF's will be X:Y.[2-9]
PF {
device : "mlx5_core0";
num_vfs : 8;
}

DEFAULT {
passthrough : true;
}

VF-0 {
node-guid : 0x706bb09cdcc711ea
port-guid : 0x706bb09cdcc711eb
}
...

The VM's bhyve conf contains
$ grep pass /vm/jbof-00/jbof-00.conf
passthru0="55/0/2"

HTH

--chuck