From: Yahui Cao Date: Mon, 18 Nov 2019 22:23:43 +0000 (+0800) Subject: net/ice: fix flow director rule after device stop X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c8a9eacb210f21be592c7e7b6c37afdd32d40dfc;p=dpdk.git net/ice: fix flow director rule after device stop 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") Signed-off-by: Yahui Cao Signed-off-by: Beilei Xing Acked-by: Qi Zhang Tested-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 2e919c5796..ecfc6c9e82 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 4a0d37b32e..510f6869d7 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 a68c2956cc..9e251cee50 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.");