DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Vizzarro <Luca.Vizzarro@arm.com>
To: jspewock@iol.unh.edu, npratte@iol.unh.edu,
	juraj.linkes@pantheon.tech, yoan.picchi@foss.arm.com,
	thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
	probb@iol.unh.edu, wathsala.vithanage@arm.com,
	paul.szczepanek@arm.com, alex.chapman@arm.com
Cc: dev@dpdk.org
Subject: Re: [PATCH v4 5/5] dts: add functions for managing VFs to Node
Date: Thu, 14 Nov 2024 17:36:00 +0000	[thread overview]
Message-ID: <f1025f39-3cde-44d4-8dd1-bf6096bfacf6@arm.com> (raw)
In-Reply-To: <20240923184235.22582-6-jspewock@iol.unh.edu>

On 23/09/2024 19:42, jspewock@iol.unh.edu wrote:
> +
> +    def get_vfs_on_port(self, pf_port: Port) -> list[VirtualFunction]:
> +        """Get all virtual functions (VFs) that DTS is aware of on `pf_port`.
> +
> +        Args:
> +            pf_port: The port to search for the VFs on.
> +
> +        Returns:
> +            A list of VFs in the framework that were created/gathered from `pf_port`.
> +        """
> +        return [p for p in self.ports if isinstance(p, VirtualFunction) and p.pf_port == pf_port]

If the change proposed by Juraj to store VFs under the PF goes through, 
this could end up being simpler.

> +
> +    def remove_virtual_functions(self, pf_port: Port) -> None:
> +        """Removes all virtual functions (VFs) created on `pf_port` by DTS.
> +
> +        Finds all the VFs that were created from `pf_port` and either removes them if they were
> +        created by the DTS framework or binds them back to their os_driver if they were preexisting
> +        on the node.
> +
> +        Args:
> +            pf_port: Port to remove the VFs from.
> +        """
> +        vf_ports = self.get_vfs_on_port(pf_port)
> +        if any(vf.created_by_framework for vf in vf_ports):
> +            self.main_session.set_num_virtual_functions(0, pf_port)
> +        else:
> +            self._logger.info("Skipping removing VFs since they were not created by DTS.")

This will cause VFs that were created by us to not be removed. We should 
ensure at least these ones are cleaned up.

  parent reply	other threads:[~2024-11-14 17:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 19:15 [RFC PATCH v1 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:15 ` [RFC PATCH v1 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 19:15 ` [RFC PATCH v1 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:15 ` [RFC PATCH v1 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:15 ` [RFC PATCH v1 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:15 ` [RFC PATCH v1 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:21 ` [RFC PATCH v2 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:21 ` [RFC PATCH v2 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 19:21 ` [RFC PATCH v2 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:21 ` [RFC PATCH v2 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:21 ` [RFC PATCH v2 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:21 ` [RFC PATCH v2 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:38 ` [RFC PATCH v2 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:38   ` [RFC PATCH v2 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 19:38   ` [RFC PATCH v2 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:38   ` [RFC PATCH v2 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:38   ` [RFC PATCH v2 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:38   ` [RFC PATCH v2 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:44   ` [RFC PATCH v2 0/5] dts: add VFs to the framework Jeremy Spewock
2024-08-21 21:30 ` [RFC PATCH v3 " jspewock
2024-08-21 21:30   ` [RFC PATCH v3 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 21:30   ` [RFC PATCH v3 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 21:30   ` [RFC PATCH v3 3/5] dts: add class for virtual functions jspewock
2024-08-21 21:30   ` [RFC PATCH v3 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 21:30   ` [RFC PATCH v3 5/5] dts: add functions for managing VFs to Node jspewock
2024-09-23 18:42 ` [PATCH v4 0/5] dts: add VFs to the framework jspewock
2024-09-23 18:42   ` [PATCH v4 1/5] dts: allow binding only a single port to a different driver jspewock
2024-09-25  8:45     ` Juraj Linkeš
2024-11-14 16:45     ` Luca Vizzarro
2024-09-23 18:42   ` [PATCH v4 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-09-25 10:58     ` Juraj Linkeš
2024-11-14 17:01     ` Luca Vizzarro
2024-09-23 18:42   ` [PATCH v4 3/5] dts: add class for virtual functions jspewock
2024-09-25 11:28     ` Juraj Linkeš
2024-11-14 17:10       ` Luca Vizzarro
2024-09-23 18:42   ` [PATCH v4 4/5] dts: add OS abstractions for creating " jspewock
2024-09-25 12:05     ` Juraj Linkeš
2024-11-14 17:29     ` Luca Vizzarro
2024-09-23 18:42   ` [PATCH v4 5/5] dts: add functions for managing VFs to Node jspewock
2024-09-25 13:29     ` Juraj Linkeš
2024-11-14 17:36     ` Luca Vizzarro [this message]
2024-09-25  8:24   ` [PATCH v4 0/5] dts: add VFs to the framework Juraj Linkeš

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1025f39-3cde-44d4-8dd1-bf6096bfacf6@arm.com \
    --to=luca.vizzarro@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).