patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: dapengx.yu@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/iavf: enable port reset
Date: Thu, 17 Dec 2020 15:57:36 +0000	[thread overview]
Message-ID: <9da466c5a8155ce123e983ab07a25fa866873f15.camel@debian.org> (raw)
In-Reply-To: <20201217103608.234579-1-dapengx.yu@intel.com>

On Thu, 2020-12-17 at 18:36 +0800, dapengx.yu@intel.com wrote:
> From: YU DAPENG <dapengx.yu@intel.com>
> 
> This patch is intended to add iavf_dev_reset ops, enable iavf to
> support "port reset". And also make iavf_dev_close be called to
> clean port resources.
> 
> Signed-off-by: YU DAPENG <dapengx.yu@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 3291d18a2d..042dd93641 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -37,6 +37,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev);
>  static int iavf_dev_start(struct rte_eth_dev *dev);
>  static void iavf_dev_stop(struct rte_eth_dev *dev);
>  static void iavf_dev_close(struct rte_eth_dev *dev);
> +static int iavf_dev_reset(struct rte_eth_dev *dev);
>  static int iavf_dev_info_get(struct rte_eth_dev *dev,
>  			     struct rte_eth_dev_info *dev_info);
>  static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev);
> @@ -99,6 +100,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {
>  	.dev_start                  = iavf_dev_start,
>  	.dev_stop                   = iavf_dev_stop,
>  	.dev_close                  = iavf_dev_close,
> +	.dev_reset                  = iavf_dev_reset,
>  	.dev_infos_get              = iavf_dev_info_get,
>  	.dev_supported_ptypes_get   = iavf_dev_supported_ptypes_get,
>  	.link_update                = iavf_dev_link_update,
> @@ -1438,7 +1440,6 @@ static int
>  iavf_dev_uninit(struct rte_eth_dev *dev)
>  {
>  	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> -	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  
>  	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>  		return -EPERM;
> @@ -1446,8 +1447,7 @@ iavf_dev_uninit(struct rte_eth_dev *dev)
>  	dev->dev_ops = NULL;
>  	dev->rx_pkt_burst = NULL;
>  	dev->tx_pkt_burst = NULL;
> -	if (hw->adapter_stopped == 0)
> -		iavf_dev_close(dev);
> +	iavf_dev_close(dev);
>  
>  	rte_free(vf->vf_res);
>  	vf->vsi_res = NULL;
> @@ -1470,6 +1470,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev)
>  	return 0;
>  }
>  
> +/*
> + * Reset VF device only to re-initialize resources in PMD layer
> + */
> +static int
> +iavf_dev_reset(struct rte_eth_dev *dev)
> +{
> +	int ret;
> +
> +	ret = iavf_dev_uninit(dev);
> +	if (ret)
> +		return ret;
> +
> +	return iavf_dev_init(dev);
> +}
> +
>  static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  			     struct rte_pci_device *pci_dev)
>  {

Thank you, applied.

Has this been validated by the QA team, and confirmed the test case now
passes?

-- 
Kind regards,
Luca Boccassi

  reply	other threads:[~2020-12-17 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 10:36 dapengx.yu
2020-12-17 15:57 ` Luca Boccassi [this message]
     [not found]   ` <5f219a97191f4064aa22f57160795737@intel.com>
2020-12-18  2:30     ` Xie, WeiX
2020-12-18  2:37     ` Xie, WeiX

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=9da466c5a8155ce123e983ab07a25fa866873f15.camel@debian.org \
    --to=bluca@debian.org \
    --cc=dapengx.yu@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@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
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).