[PATCH v5 1/2] dts: add OS abstractions for creating virtual functions
Patrick Robb
probb at iol.unh.edu
Thu Mar 13 13:53:56 CET 2025
On Wed, Mar 12, 2025 at 11:40 PM Patrick Robb <probb at iol.unh.edu> wrote:
>
> + def create_vfs(self, pf_port: Port) -> None:
> + """Overrides :meth:`~.os_session.OSSession.create_vfs`.
> +
> + Raises:
> + InternalError: If the number of VFs is greater than 0 but
> less than the
> + maximum for `pf_port`.
> + """
> + sys_bus_path = f"/sys/bus/pci/devices/{pf_port.pci}".replace(":",
> "\\:")
> + curr_num_vfs = int(self.send_command(f"cat
> {sys_bus_path}/sriov_numvfs").stdout)
> + max_num_vfs = int(
> + self.send_command(f"cat {sys_bus_path}/sriov_totalvfs",
> privileged=True).stdout
> + )
> + if 0 < curr_num_vfs < max_num_vfs:
> + raise InternalError("There are existing VFs on the port which
> must be deleted.")
>
Maybe in this situation we should just delete all VFs, and then create the
new set of VFs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250313/f874cae3/attachment.htm>
More information about the dev
mailing list