From: Yahui Cao <yahui.cao@intel.com>
To: Qiming Yang <qiming.yang@intel.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,
Yahui Cao <yahui.cao@intel.com>,
Xiaolong Ye <xiaolong.ye@intel.com>,
Beilei Xing <beilei.xing@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/2] net/ice: fix FDIR rule failure after device stop
Date: Tue, 19 Nov 2019 06:23:43 +0800 [thread overview]
Message-ID: <20191118222343.45282-3-yahui.cao@intel.com> (raw)
In-Reply-To: <20191118222343.45282-1-yahui.cao@intel.com>
By moving irq enable/disable from device start/stop to FDIR
setup/teardown, FDIR queue irq config is independent of LAN queue irq
config. So device stop will not cause FDIR rule failure.
Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Cc: beilei.xing@intel.com
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/ice/ice_ethdev.c | 16 +++-------------
drivers/net/ice/ice_ethdev.h | 3 +++
drivers/net/ice/ice_fdir_filter.c | 7 +++++++
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 2e919c579..ecfc6c9e8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2301,7 +2301,7 @@ ice_release_vsi(struct ice_vsi *vsi)
return 0;
}
-static void
+void
ice_vsi_disable_queues_intr(struct ice_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2354,9 +2354,6 @@ ice_dev_stop(struct rte_eth_dev *dev)
/* disable all queue interrupts */
ice_vsi_disable_queues_intr(main_vsi);
- if (pf->fdir.fdir_vsi)
- ice_vsi_disable_queues_intr(pf->fdir.fdir_vsi);
-
/* Clear all queues and release mbufs */
ice_clear_queues(dev);
@@ -2605,7 +2602,7 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_t msix_vect,
}
}
-static void
+void
ice_vsi_queues_bind_intr(struct ice_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2658,7 +2655,7 @@ ice_vsi_queues_bind_intr(struct ice_vsi *vsi)
}
}
-static void
+void
ice_vsi_enable_queues_intr(struct ice_vsi *vsi)
{
struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2728,13 +2725,6 @@ ice_rxq_intr_setup(struct rte_eth_dev *dev)
/* Enable interrupts for all the queues */
ice_vsi_enable_queues_intr(vsi);
- /* Enable FDIR MSIX interrupt */
- if (pf->fdir.fdir_vsi) {
- pf->fdir.fdir_vsi->nb_used_qps = 1;
- ice_vsi_queues_bind_intr(pf->fdir.fdir_vsi);
- ice_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
- }
-
rte_intr_enable(intr_handle);
return 0;
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 4a0d37b32..510f6869d 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -459,6 +459,9 @@ struct ice_vsi *
ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type);
int
ice_release_vsi(struct ice_vsi *vsi);
+void ice_vsi_enable_queues_intr(struct ice_vsi *vsi);
+void ice_vsi_disable_queues_intr(struct ice_vsi *vsi);
+void ice_vsi_queues_bind_intr(struct ice_vsi *vsi);
static inline int
ice_align_floor(int n)
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 7876f4bbc..013d1ef93 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -491,6 +491,11 @@ ice_fdir_setup(struct ice_pf *pf)
goto fail_mem;
}
+ /* Enable FDIR MSIX interrupt */
+ vsi->nb_used_qps = 1;
+ ice_vsi_queues_bind_intr(vsi);
+ ice_vsi_enable_queues_intr(vsi);
+
/* reserve memory for the fdir programming packet */
snprintf(z_name, sizeof(z_name), "ICE_%s_%d",
ICE_FDIR_MZ_NAME,
@@ -615,6 +620,8 @@ ice_fdir_teardown(struct ice_pf *pf)
if (!vsi)
return;
+ ice_vsi_disable_queues_intr(vsi);
+
err = ice_fdir_tx_queue_stop(eth_dev, pf->fdir.txq->queue_id);
if (err)
PMD_DRV_LOG(ERR, "Failed to stop TX queue.");
--
2.17.1
next prev parent reply other threads:[~2019-11-18 14:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-13 16:09 [dpdk-dev] [PATCH] net/ice: fix FDIR programming status check issue Yahui Cao
2019-11-14 7:23 ` Ye Xiaolong
2019-11-15 9:06 ` Ferruh Yigit
2019-11-18 22:23 ` [dpdk-dev] [PATCH v2 0/2] fix testpmd quit error after FDIR rule created Yahui Cao
2019-11-18 22:23 ` [dpdk-dev] [PATCH v2 1/2] net/ice: fix FDIR programming status check issue Yahui Cao
2019-11-18 22:23 ` Yahui Cao [this message]
2019-11-19 1:14 ` [dpdk-dev] [PATCH v2 0/2] fix testpmd quit error after FDIR rule created Zhang, Qi Z
2019-11-19 5:11 ` Ye Xiaolong
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=20191118222343.45282-3-yahui.cao@intel.com \
--to=yahui.cao@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=wenzhuo.lu@intel.com \
--cc=xiaolong.ye@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).