DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Yang, SteveX" <stevex.yang@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>
Subject: Re: [dpdk-dev] [PATCH 7/7] net/iavf: fix port close
Date: Wed, 12 Aug 2020 02:57:44 +0000
Message-ID: <BY5PR11MB4054E3977B62DE951D8BFC83E3420@BY5PR11MB4054.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200811075910.20954-8-stevex.yang@intel.com>

If RTE_ETH_DEV_CLOSE_REMOVE is set, port would be released when dev_close is called.
So it is not necessary to mark it as closed.

Another concern in my mind is the REST virtchnl message is missed to send to PF in iavf_dev_reset.

Thanks
Jingjing

> -----Original Message-----
> From: Yang, SteveX <stevex.yang@intel.com>
> Sent: Tuesday, August 11, 2020 3:59 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>
> Subject: [PATCH 7/7] net/iavf: fix port close
> 
> Port reset will call iavf_dev_uninit() to release resources. It wants to call
> iavf_dev_close() to release resources. So there will be a call conflict if calling
> iavf_dev_reset() and iavf_dev_close() at the same time.
> 
> This patch added adapter->closed flag in iavf_dev_close() to control the
> status of close.
> 
> Fixes: 83fe5e80692a ("net/iavf: move device state flag")
> 
> Signed-off-by: SteveX Yang <stevex.yang@intel.com>
> ---
>  drivers/net/iavf/iavf.h        | 1 +
>  drivers/net/iavf/iavf_ethdev.c | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> 9be8a2381..06cbe6089 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -161,6 +161,7 @@ struct iavf_adapter {
>  	bool tx_vec_allowed;
>  	const uint32_t *ptype_tbl;
>  	bool stopped;
> +	bool closed;
>  	uint16_t fdir_ref_cnt;
>  };
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index f16aff531..b58e57b07 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -1367,6 +1367,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
>  	hw->back = IAVF_DEV_PRIVATE_TO_ADAPTER(eth_dev->data-
> >dev_private);
>  	adapter->eth_dev = eth_dev;
>  	adapter->stopped = 1;
> +	adapter->closed = 0;
> 
>  	if (iavf_init_vf(eth_dev) != 0) {
>  		PMD_INIT_LOG(ERR, "Init vf failed");
> @@ -1423,6 +1424,9 @@ iavf_dev_close(struct rte_eth_dev *dev)
>  	struct iavf_adapter *adapter =
>  		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> 
> +	if (adapter->closed == 1)
> +		return;
> +
>  	iavf_dev_stop(dev);
>  	iavf_flow_flush(dev, NULL);
>  	iavf_flow_uninit(adapter);
> @@ -1434,6 +1438,8 @@ iavf_dev_close(struct rte_eth_dev *dev)
>  	rte_intr_callback_unregister(intr_handle,
>  				     iavf_dev_interrupt_handler, dev);
>  	iavf_disable_irq0(hw);
> +
> +	adapter->closed = 1;
>  }
> 
>  static int
> --
> 2.17.1


  reply	other threads:[~2020-08-12  2:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  7:59 [dpdk-dev] [PATCH 0/7] Bugs Porting from I40evf For IAVF Feature SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 1/7] net/iavf: fix scattered Rx enabling SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 2/7] net/iavf: set speed to undefined for default case SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 3/7] net/iavf: fix port start during configuration restore SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 4/7] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 5/7] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 6/7] net/iavf: downgrade error log SteveX Yang
2020-08-11  7:59 ` [dpdk-dev] [PATCH 7/7] net/iavf: fix port close SteveX Yang
2020-08-12  2:57   ` Wu, Jingjing [this message]
2020-08-27  1:01 ` [dpdk-dev] [PATCH v2 0/6] These patches are bugs porting from i40evf to SteveX Yang
2020-08-27  1:14 ` SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 1/6] net/iavf: fix scattered Rx enabling SteveX Yang
2020-08-27  2:49     ` Xing, Beilei
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 2/6] net/iavf: set speed to undefined for default case SteveX Yang
2020-08-27  6:46     ` Xing, Beilei
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 3/6] net/iavf: fix port start during configuration restore SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 4/6] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 5/6] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-08-27  1:14   ` [dpdk-dev] [PATCH v2 6/6] net/iavf: downgrade error log SteveX Yang
2020-09-04  7:29   ` [dpdk-dev] [PATCH v3 0/6] Bugs Porting from I40evf For IAVF Feature SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 1/6] net/iavf: fix scattered Rx enabling SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 2/6] net/iavf: fix incorrect link status when speed is undefined SteveX Yang
2020-09-07 14:39       ` Ferruh Yigit
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 3/6] net/iavf: fix port start during configuration restore SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 4/6] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 5/6] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-09-08  7:53       ` Xu, Ting
2020-09-11  9:04       ` Zhang, Qi Z
2020-09-11 12:07         ` Ferruh Yigit
2020-09-04  7:29     ` [dpdk-dev] [PATCH v3 6/6] net/iavf: downgrade error log SteveX Yang
2020-09-04  8:17     ` [dpdk-dev] [PATCH v3 0/6] Bugs Porting from I40evf For IAVF Feature Xing, Beilei
2020-09-07  5:58       ` Zhang, Qi Z
2020-09-07 15:23         ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2020-08-11  6:29 [dpdk-dev] [PATCH 0/7] " SteveX Yang
2020-08-11  6:29 ` [dpdk-dev] [PATCH 7/7] net/iavf: fix port close SteveX Yang

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=BY5PR11MB4054E3977B62DE951D8BFC83E3420@BY5PR11MB4054.namprd11.prod.outlook.com \
    --to=jingjing.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=stevex.yang@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