[dpdk-dev,v5,02/21] i40e: tear down flow director
Commit Message
Tested-by: Min Cao <min.cao@intel.com>
Patch name: [PATCH v5 00/21] Support flow director programming on Fortville
Test Flag: Tested-by
Tester name: min.cao@intel.com
Result summary: total 3 cases, 3 passed, 0 failed
Test Case 1:
Name: Fortville flow director with no flexible playload(IPv4/IPv6)
Environment: OS: Fedora20 3.11.10-301.fc20.x86_64
gcc (GCC) 4.8.2
CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
NIC: Fortville eagle/spirit
Test result: PASSED
Test Case 2:
Name: Fortville flow director with flexible playload(IPv4/IPv6)
Environment: OS: Fedora20 3.11.10-301.fc20.x86_64
gcc (GCC) 4.8.2
CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
NIC: Fortville eagle/spirit
Test result: PASSED
Test Case 3:
Name: Fortville flow director flush
Environment: OS: Fedora20 3.11.10-301.fc20.x86_64
gcc (GCC) 4.8.2
CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
NIC: Fortville eagle/spirit
Test result: PASSED
Test Case 4:
Name: Fortville flow director performance
Environment: OS: Fedora20 3.11.10-301.fc20.x86_64
gcc (GCC) 4.8.2
CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
NIC: Fortville eagle/spirit
Test result: PASSED
-----Original Message-----
From: Wu, Jingjing
Sent: Thursday, October 30, 2014 3:26 PM
To: dev@dpdk.org
Cc: Wu, Jingjing; Cao, Min
Subject: [PATCH v5 02/21] i40e: tear down flow director
To support flow director tear down, this patch includes
- queue 0 pair release
- release vsi
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
lib/librte_pmd_i40e/i40e_ethdev.c | 4 +++-
lib/librte_pmd_i40e/i40e_ethdev.h | 1 +
lib/librte_pmd_i40e/i40e_fdir.c | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
\ No newline at end of file
@@ -514,7 +514,8 @@ eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv,
return 0;
err_setup_pf_switch:
- rte_free(pf->main_vsi);
+ i40e_fdir_teardown(pf);
+ i40e_vsi_release(pf->main_vsi);
err_get_mac_addr:
err_configure_lan_hmc:
(void)i40e_shutdown_lan_hmc(hw);
@@ -849,6 +850,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 */
@@ -379,6 +379,7 @@ enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf,
enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf,
unsigned int socket_id);
int i40e_fdir_setup(struct i40e_pf *pf);
+void i40e_fdir_teardown(struct i40e_pf *pf);
/* I40E_DEV_PRIVATE_TO */
#define I40E_DEV_PRIVATE_TO_PF(adapter) \
@@ -219,4 +219,23 @@ fail_setup_tx:
i40e_vsi_release(vsi);
pf->fdir.fdir_vsi = NULL;
return err;
+}
+
+/*
+ * i40e_fdir_teardown - release the Flow Director resources
+ * @pf: board private structure
+ */
+void
+i40e_fdir_teardown(struct i40e_pf *pf)
+{
+ struct i40e_vsi *vsi;
+
+ vsi = pf->fdir.fdir_vsi;
+ 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;
+ return;
}