DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Long Li <longli@microsoft.com>
Cc: Ferruh Yigit <ferruh.yigit@amd.com>,
	dev@dpdk.org, Ajay Sharma <sharmaajay@microsoft.com>,
	longli@linuxonhyperv.com
Subject: Re: [PATCH] bus/vmbus: add cleanup support
Date: Tue, 06 Jun 2023 16:27:01 +0200	[thread overview]
Message-ID: <3429539.WBkqHH8m98@thomas> (raw)
In-Reply-To: <1679427105-31644-1-git-send-email-longli@linuxonhyperv.com>

21/03/2023 20:31, longli@linuxonhyperv.com:
> From: Long Li <longli@microsoft.com>
> 
> Implement VMBUS cleanup callback from eal_cleanup().
> 
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>  drivers/bus/vmbus/vmbus_common.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
> index 8d32d66504..a6277bfc06 100644
> --- a/drivers/bus/vmbus/vmbus_common.c
> +++ b/drivers/bus/vmbus/vmbus_common.c
> @@ -188,6 +188,34 @@ rte_vmbus_probe(void)
>  	return (probed && probed == failed) ? -1 : 0;
>  }
>  
> +static int
> +rte_vmbus_cleanup(void)
> +{
> +	struct rte_vmbus_device *dev, *tmp_dev;
> +	int error = 0;
> +
> +	RTE_TAILQ_FOREACH_SAFE(dev, &rte_vmbus_bus.device_list, next, tmp_dev) {
> +
> +		const struct rte_vmbus_driver *drv = dev->driver;
> +		int ret;
> +
> +		if (!drv || !drv->remove)

Changed to "== NULL" comparisons for the style :)

> +			continue;
> +
> +		ret = drv->remove(dev);
> +		if (ret < 0)
> +			error = -1;
> +
> +		rte_vmbus_unmap_device(dev);
> +
> +		dev->driver = NULL;
> +		dev->device.driver = NULL;
> +		free(dev);
> +	}
> +
> +	return error;
> +}

Applied, thanks.



      reply	other threads:[~2023-06-06 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 19:31 longli
2023-06-06 14:27 ` Thomas Monjalon [this message]

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=3429539.WBkqHH8m98@thomas \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=longli@linuxonhyperv.com \
    --cc=longli@microsoft.com \
    --cc=sharmaajay@microsoft.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).