From: Jingjing Wu Date: Fri, 21 Nov 2014 00:46:36 +0000 (+0800) Subject: i40e: tear down flow director X-Git-Tag: spdx-start~10115 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=71d35259ff67;p=dpdk.git i40e: tear down flow director release fortville resources on flow director, includes - queue 0 pair release - release vsi Signed-off-by: Jingjing Wu Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 16b4f795c4..4ebb981654 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -504,6 +504,7 @@ eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv, err_mac_alloc: i40e_vsi_release(pf->main_vsi); err_setup_pf_switch: + i40e_fdir_teardown(pf); err_get_mac_addr: err_configure_lan_hmc: (void)i40e_shutdown_lan_hmc(hw); @@ -860,11 +861,16 @@ i40e_dev_stop(struct rte_eth_dev *dev) i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi); } + if (pf->flags & I40E_FLAG_FDIR) { + i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi); + i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi); + } /* Clear all queues and release memory */ i40e_dev_clear_queues(dev); /* Set link down */ i40e_dev_set_link_down(dev); + } static void @@ -886,6 +892,7 @@ i40e_dev_close(struct rte_eth_dev *dev) i40e_shutdown_lan_hmc(hw); /* release all the existing VSIs and VEBs */ + i40e_fdir_teardown(pf); i40e_vsi_release(pf->main_vsi); /* shutdown the adminq */ diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index ceda53a374..eeae8bc604 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -425,6 +425,7 @@ const struct rte_memzone *i40e_memzone_reserve(const char *name, uint32_t len, int socket_id); int i40e_fdir_configure(struct rte_eth_dev *dev); +void i40e_fdir_teardown(struct i40e_pf *pf); /* I40E_DEV_PRIVATE_TO */ #define I40E_DEV_PRIVATE_TO_PF(adapter) \ diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c index 66ff8add48..23196f6e34 100644 --- a/lib/librte_pmd_i40e/i40e_fdir.c +++ b/lib/librte_pmd_i40e/i40e_fdir.c @@ -225,6 +225,27 @@ fail_setup_tx: return err; } +/* + * i40e_fdir_teardown - release the Flow Director resources + * @pf: board private structure + */ +void +i40e_fdir_teardown(struct i40e_pf *pf) +{ + struct i40e_hw *hw = I40E_PF_TO_HW(pf); + struct i40e_vsi *vsi; + + vsi = pf->fdir.fdir_vsi; + i40e_switch_tx_queue(hw, vsi->base_queue, FALSE); + i40e_switch_rx_queue(hw, vsi->base_queue, FALSE); + i40e_dev_rx_queue_release(pf->fdir.rxq); + pf->fdir.rxq = NULL; + i40e_dev_tx_queue_release(pf->fdir.txq); + pf->fdir.txq = NULL; + i40e_vsi_release(vsi); + pf->fdir.fdir_vsi = NULL; +} + /* check whether the flow director table in empty */ static inline int i40e_fdir_empty(struct i40e_hw *hw)