DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xu, Rosen" <rosen.xu@intel.com>
To: "Zhang, Tianfei" <tianfei.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	 "Huang, Wei" <wei.huang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/4] raw/ifpga/base: cleanup ifpga raw devices when process quit
Date: Tue, 29 Sep 2020 01:43:13 +0000
Message-ID: <BYAPR11MB29016FACE9BF5D9EE169B0BF89320@BYAPR11MB2901.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1601257218-6606-4-git-send-email-tianfei.zhang@intel.com>

Hi,

> -----Original Message-----
> From: Zhang, Tianfei <tianfei.zhang@intel.com>
> Sent: Monday, September 28, 2020 9:40
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Huang, Wei
> <wei.huang@intel.com>
> Cc: Zhang, Tianfei <tianfei.zhang@intel.com>
> Subject: [PATCH v2 3/4] raw/ifpga/base: cleanup ifpga raw devices when
> process quit
> 
> From: Wei Huang <wei.huang@intel.com>
> 
> Add function ifpga_rawdev_cleanup() to cleanup all ifpga raw devices and
> register it as RTE_FINI function to make it called after main().
> 
> Signed-off-by: Wei Huang <wei.huang@intel.com>
> Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
> ---
>  drivers/raw/ifpga/ifpga_rawdev.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index 98b02b5fa..1bc500a2a 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1609,6 +1609,26 @@
> RTE_PMD_REGISTER_PCI_TABLE(ifpga_rawdev_pci_driver,
> rte_ifpga_rawdev_pmd);
> RTE_PMD_REGISTER_KMOD_DEP(ifpga_rawdev_pci_driver, "* igb_uio |
> uio_pci_generic | vfio-pci");  RTE_LOG_REGISTER(ifpga_rawdev_logtype,
> driver.raw.init, NOTICE);
> 
> +RTE_FINI(ifpga_rawdev_cleanup)
> +{
> +	struct ifpga_rawdev *dev;
> +	struct opae_adapter *adapter;
> +	unsigned int i;
> +
> +	for (i = 0; i < IFPGA_RAWDEV_NUM; i++) {
> +		dev = &ifpga_rawdevices[i];
> +		if (dev->rawdev) {
> +			adapter = ifpga_rawdev_get_priv(dev->rawdev);
> +			if (adapter) {
> +				opae_adapter_destroy(adapter);
> +				opae_adapter_data_free(adapter->data);
> +			}
> +			rte_rawdev_pmd_release(dev->rawdev);
> +			dev->rawdev = NULL;
> +		}
> +	}
> +}
> +
>  static const char * const valid_args[] = {
>  #define IFPGA_ARG_NAME         "ifpga"
>  	IFPGA_ARG_NAME,
> --
> 2.17.1

Acked-by: Rosen Xu <rosen.xu@intel.com>

  reply	other threads:[~2020-09-29  1:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  7:30 [dpdk-dev] [PATCH v4 0/4] raw/ifpga/base: An inprovement for multi-process Tianfei zhang
2020-09-23  7:30 ` [dpdk-dev] [PATCH v4 1/4] raw/ifpga/base: fix bug in IRQ functions Tianfei zhang
2020-09-23  7:30 ` [dpdk-dev] [PATCH v4 2/4] raw/ifpga/base: free resources when destroying ifpga device Tianfei zhang
2020-09-23  7:30 ` [dpdk-dev] [PATCH v4 3/4] raw/ifpga/base: cleanup ifpga raw devices when process quit Tianfei zhang
2020-09-23  7:30 ` [dpdk-dev] [PATCH v4 4/4] raw/ifpga/base: enhance driver reliablity in multi-process Tianfei zhang
2020-09-28  1:40 ` [dpdk-dev] [PATCH v2 0/4] raw/ifpga/base: An improvement for multi-process Tianfei zhang
2020-09-28  1:40   ` [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions Tianfei zhang
2020-09-29  1:42     ` Xu, Rosen
2020-10-14  9:59       ` Zhang, Tianfei
2020-10-15 13:14       ` Zhang, Qi Z
2020-10-15 18:56     ` Ferruh Yigit
2020-10-16  5:46       ` Zhang, Tianfei
2020-09-28  1:40   ` [dpdk-dev] [PATCH v2 2/4] raw/ifpga/base: free resources when destroying ifpga device Tianfei zhang
2020-09-29  1:42     ` Xu, Rosen
2020-10-15 13:15       ` Zhang, Qi Z
2020-10-15 18:57     ` Ferruh Yigit
2020-10-16  5:51       ` Zhang, Tianfei
2020-09-28  1:40   ` [dpdk-dev] [PATCH v2 3/4] raw/ifpga/base: cleanup ifpga raw devices when process quit Tianfei zhang
2020-09-29  1:43     ` Xu, Rosen [this message]
2020-10-15 13:15       ` Zhang, Qi Z
2020-10-15 18:57     ` Ferruh Yigit
2020-10-16  5:54       ` Zhang, Tianfei
2020-09-28  1:40   ` [dpdk-dev] [PATCH v2 4/4] raw/ifpga/base: enhance driver reliability in multi-process Tianfei zhang
2020-10-15  6:08     ` Xu, Rosen
2020-10-15 13:16       ` Zhang, Qi Z
2020-10-23  8:59 ` [dpdk-dev] [PATCH v3 0/5] raw/ifpga/base: An improvement for multi-process Tianfei zhang
2020-10-23  8:59   ` [dpdk-dev] [PATCH v3 1/5] raw/ifpga/base: fix interrupt handler instance usage Tianfei zhang
2020-10-23  8:59   ` [dpdk-dev] [PATCH v3 2/5] raw/ifpga/base: handle unsupported interrupt type Tianfei zhang
2020-10-23  8:59   ` [dpdk-dev] [PATCH v3 3/5] raw/ifpga/base: fix return of IRQ unregister properly Tianfei zhang
2020-10-23  8:59   ` [dpdk-dev] [PATCH v3 4/5] raw/ifpga/base: free resources when destroying ifpga device Tianfei zhang
2020-10-23  8:59   ` [dpdk-dev] [PATCH v3 5/5] raw/ifpga/base: enhance driver reliablity in multi-process Tianfei zhang
2020-10-26  1:04   ` [dpdk-dev] [PATCH v3 0/5] raw/ifpga/base: An improvement for multi-process Zhang, Qi Z
2020-10-23  9:06 ` Tianfei zhang

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=BYAPR11MB29016FACE9BF5D9EE169B0BF89320@BYAPR11MB2901.namprd11.prod.outlook.com \
    --to=rosen.xu@intel.com \
    --cc=dev@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    --cc=wei.huang@intel.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git