From: SteveX Yang <stevex.yang@intel.com>
To: jingjing.wu@intel.com, beilei.xing@intel.com, dev@dpdk.org
Cc: "Zhang, RobinX" <robinx.zhang@intel.com>,
SteveX Yang <stevex.yang@intel.com>
Subject: [dpdk-dev] [PATCH 7/7] net/iavf: fix port close
Date: Tue, 11 Aug 2020 06:29:17 +0000 [thread overview]
Message-ID: <20200811062917.7007-8-stevex.yang@intel.com> (raw)
In-Reply-To: <20200811062917.7007-1-stevex.yang@intel.com>
From: "Zhang, RobinX" <robinx.zhang@intel.com>
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
next prev parent reply other threads:[~2020-08-11 6:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 6:29 [dpdk-dev] [PATCH 0/7] Bugs Porting from I40evf For IAVF Feature SteveX Yang
2020-08-11 6:29 ` [dpdk-dev] [PATCH 1/7] net/iavf: fix scattered Rx enabling SteveX Yang
2020-08-12 2:07 ` Xing, Beilei
2020-08-11 6:29 ` [dpdk-dev] [PATCH 2/7] net/iavf: set speed to undefined for default case SteveX Yang
2020-08-11 6:29 ` [dpdk-dev] [PATCH 3/7] net/iavf: fix port start during configuration restore SteveX Yang
2020-08-11 6:29 ` [dpdk-dev] [PATCH 4/7] net/iavf: fix setting of MAC address on iavf SteveX Yang
2020-08-11 6:29 ` [dpdk-dev] [PATCH 5/7] net/iavf: fix multiple interrupts for VF SteveX Yang
2020-08-11 6:29 ` [dpdk-dev] [PATCH 6/7] net/iavf: downgrade error log SteveX Yang
2020-08-11 6:29 ` SteveX Yang [this message]
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 7/7] net/iavf: fix port close SteveX Yang
2020-08-12 2:57 ` Wu, Jingjing
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=20200811062917.7007-8-stevex.yang@intel.com \
--to=stevex.yang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=robinx.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).