From: Zhirun Yan <zhirun.yan@intel.com>
To: dev@dpdk.org, qi.z.zhang@intel.com
Cc: haiyue.wang@intel.com, Zhirun Yan <zhirun.yan@intel.com>
Subject: [dpdk-dev] [PATCH v1] net/i40e: fix PF port close
Date: Wed, 28 Nov 2018 16:52:31 +0000 [thread overview]
Message-ID: <20181128165231.78807-1-zhirun.yan@intel.com> (raw)
Before this patch, the function i40e_dev_close wants to call
i40e_dev_stop() to release res, but it will never call it.
Fixes: 4861cde4611601ccc9 ("i40e: new poll mode driver")
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7030eb1fa..bc5e45095 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2391,15 +2391,11 @@ static void
i40e_dev_stop(struct rte_eth_dev *dev)
{
struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
- struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_vsi *main_vsi = pf->main_vsi;
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
int i;
- if (hw->adapter_stopped == 1)
- return;
-
if (dev->data->dev_conf.intr_conf.rxq == 0) {
rte_eal_alarm_cancel(i40e_dev_alarm_handler, dev);
rte_intr_enable(intr_handle);
@@ -2442,8 +2438,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
/* reset hierarchy commit */
pf->tm_conf.committed = false;
-
- hw->adapter_stopped = 1;
}
static void
@@ -2460,7 +2454,10 @@ i40e_dev_close(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
- i40e_dev_stop(dev);
+ if (dev->data->dev_started != 0) {
+ dev->data->dev_started = 0;
+ i40e_dev_stop(dev);
+ }
/* Remove all mirror rules */
while ((p_mirror = TAILQ_FIRST(&pf->mirror_list))) {
@@ -2523,6 +2520,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
I40E_WRITE_REG(hw, I40E_PFGEN_CTRL,
(reg | I40E_PFGEN_CTRL_PFSWR_MASK));
I40E_WRITE_FLUSH(hw);
+
+ hw->adapter_stopped = 1;
}
/*
@@ -2539,8 +2538,6 @@ i40e_dev_reset(struct rte_eth_dev *dev)
* To avoid unexpected behavior in VF, currently reset of PF with
* SR-IOV activation is not supported. It might be supported later.
*/
- if (dev->data->sriov.active)
- return -ENOTSUP;
ret = eth_i40e_dev_uninit(dev);
if (ret)
--
2.17.1
reply other threads:[~2018-11-28 9:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181128165231.78807-1-zhirun.yan@intel.com \
--to=zhirun.yan@intel.com \
--cc=dev@dpdk.org \
--cc=haiyue.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
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).