DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Wang, Liang-min" <liang-min.wang@intel.com>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v7 3/3] net/i40e: enable PCI bus master after reset
Date: Fri, 4 Jun 2021 01:58:02 +0000
Message-ID: <MN2PR11MB3807FA816C019A3504D341D3F73B9@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210524012346.496560-4-haiyue.wang@intel.com>



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Monday, May 24, 2021 9:24 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Liang-min <liang-
> min.wang@intel.com>; david.marchand@redhat.com; Wang, Haiyue
> <haiyue.wang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH v7 3/3] net/i40e: enable PCI bus master after reset
> 
> The VF reset can be triggered by the PF reset event, then the PCI bus master
> will be cleared, the VF will be not allowed to issue any Memory or I/O
> Requests.
> 
> So after the reset event is detected, always enable the PCI bus master.
> And if failed, the device or system may be in an invalid state, so keep the VF
> reset state to mark it as I/O error.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index cb898bdb68..385ebedcd3 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1213,7 +1213,6 @@ i40evf_check_vf_reset_done(struct rte_eth_dev
> *dev)
>  	if (i >= MAX_RESET_WAIT_CNT)
>  		return -1;
> 
> -	vf->vf_reset = false;
>  	vf->pend_msg &= ~PFMSG_RESET_IMPENDING;
> 
>  	return 0;
> @@ -1392,6 +1391,7 @@ i40evf_handle_pf_event(struct rte_eth_dev *dev,
> uint8_t *msg,
>  	switch (pf_msg->event) {
>  	case VIRTCHNL_EVENT_RESET_IMPENDING:
>  		PMD_DRV_LOG(DEBUG,
> "VIRTCHNL_EVENT_RESET_IMPENDING event");
> +		vf->vf_reset = true;
>  		rte_eth_dev_callback_process(dev,
>  				RTE_ETH_EVENT_INTR_RESET, NULL);
>  		break;
> @@ -2468,6 +2468,7 @@ i40evf_dev_close(struct rte_eth_dev *dev)  {
>  	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data-
> >dev_private);
> +	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
>  	int ret;
> 
>  	if (rte_eal_process_type() != RTE_PROC_PRIMARY) @@ -2490,6
> +2491,16 @@ i40evf_dev_close(struct rte_eth_dev *dev)
>  	i40e_shutdown_adminq(hw);
>  	i40evf_disable_irq0(hw);
> 
> +	/*
> +	 * If the VF is reset via VFLR, the device will be knocked out of bus
> +	 * master mode, and the driver will fail to recover from the reset. Fix
> +	 * this by enabling bus mastering after every reset. In a non-VFLR
> case,
> +	 * the bus master bit will not be disabled, and this call will have no
> +	 * effect.
> +	 */
> +	if (vf->vf_reset && !rte_pci_set_bus_master(pci_dev, true))
> +		vf->vf_reset = false;
> +
>  	rte_free(vf->vf_res);
>  	vf->vf_res = NULL;
>  	rte_free(vf->aq_resp);
> --
> 2.31.1

Acked-by: Beilei Xing <beilei.xing@intel.com>

  reply	other threads:[~2021-06-04  1:58 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  5:02 [dpdk-dev] [PATCH v1 0/3] Fix PF reset causes VF memory request failure Haiyue Wang
2021-04-21  5:02 ` [dpdk-dev] [PATCH v1 1/3] bus/pci: enable PCI master in command register Haiyue Wang
2021-04-21  5:02 ` [dpdk-dev] [PATCH v1 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-04-21  5:02 ` [dpdk-dev] [PATCH v1 3/3] net/i40e: " Haiyue Wang
2021-04-21 11:59 ` [dpdk-dev] [PATCH v1 0/3] Fix PF reset causes VF memory request failure Zhang, Qi Z
2021-04-22  1:18 ` [dpdk-dev] [PATCH v2 0/3] fix " Haiyue Wang
2021-04-22  1:18   ` [dpdk-dev] [PATCH v2 1/3] bus/pci: enable PCI master in command register Haiyue Wang
2021-04-23 10:43     ` Kinsella, Ray
2021-04-23 12:07       ` Wang, Haiyue
2021-04-22  1:18   ` [dpdk-dev] [PATCH v2 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-04-22  1:18   ` [dpdk-dev] [PATCH v2 3/3] net/i40e: " Haiyue Wang
2021-04-23 11:39 ` [dpdk-dev] [PATCH v3 0/3] fix PF reset causes VF memory request failure Haiyue Wang
2021-04-23 11:39   ` [dpdk-dev] [PATCH v3 1/3] bus/pci: enable PCI master in command register Haiyue Wang
2021-04-23 12:32     ` Kinsella, Ray
2021-04-27  9:28     ` David Marchand
2021-04-27 13:34       ` Wang, Haiyue
2021-04-27 13:40         ` David Marchand
2021-04-23 11:40   ` [dpdk-dev] [PATCH v3 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-04-23 11:40   ` [dpdk-dev] [PATCH v3 3/3] net/i40e: " Haiyue Wang
2021-04-27 13:39 ` [dpdk-dev] [PATCH v4 0/3] fix PF reset causes VF memory request failure Haiyue Wang
2021-04-27 13:39   ` [dpdk-dev] [PATCH v4 1/3] bus/pci: set PCI master in command register Haiyue Wang
2021-04-27 15:07     ` Kinsella, Ray
2021-04-27 13:39   ` [dpdk-dev] [PATCH v4 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-04-28  3:34     ` Zhang, Qi Z
2021-05-04 11:32     ` David Marchand
2021-05-04 15:07       ` Wang, Haiyue
2021-05-05  2:56       ` Wang, Haiyue
2021-05-05  8:39         ` David Marchand
2021-05-06  3:02           ` Wang, Haiyue
2021-04-27 13:39   ` [dpdk-dev] [PATCH v4 3/3] net/i40e: " Haiyue Wang
2021-04-28  3:35     ` Zhang, Qi Z
2021-05-06  3:49 ` [dpdk-dev] [PATCH v5 0/3] fix PF reset causes VF memory request failure Haiyue Wang
2021-05-06  3:49   ` [dpdk-dev] [PATCH v5 1/3] bus/pci: set PCI master in command register Haiyue Wang
2021-05-06  3:49   ` [dpdk-dev] [PATCH v5 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-05-06  3:49   ` [dpdk-dev] [PATCH v5 3/3] net/i40e: " Haiyue Wang
2021-05-23 11:46 ` [dpdk-dev] [PATCH v6 0/3] fix PF reset causes VF memory request failure Haiyue Wang
2021-05-23 11:46   ` [dpdk-dev] [PATCH v6 1/3] bus/pci: set PCI master in command register Haiyue Wang
2021-05-23 11:46   ` [dpdk-dev] [PATCH v6 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-05-23 11:46   ` [dpdk-dev] [PATCH v6 3/3] net/i40e: " Haiyue Wang
2021-05-24  1:23 ` [dpdk-dev] [PATCH v7 0/3] fix PF reset causes VF memory request failure Haiyue Wang
2021-05-24  1:23   ` [dpdk-dev] [PATCH v7 1/3] bus/pci: set PCI master in command register Haiyue Wang
2021-05-24  1:23   ` [dpdk-dev] [PATCH v7 2/3] net/iavf: enable PCI bus master after reset Haiyue Wang
2021-06-04  2:07     ` Xing, Beilei
2021-05-24  1:23   ` [dpdk-dev] [PATCH v7 3/3] net/i40e: " Haiyue Wang
2021-06-04  1:58     ` Xing, Beilei [this message]
2021-06-08  8:31   ` [dpdk-dev] [PATCH v7 0/3] fix PF reset causes VF memory request failure David Marchand

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=MN2PR11MB3807FA816C019A3504D341D3F73B9@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=liang-min.wang@intel.com \
    --cc=qi.z.zhang@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