summaryrefslogtreecommitdiff
path: root/drivers/net/i40e/i40e_pf.c
diff options
context:
space:
mode:
authorBernard Iremonger <bernard.iremonger@intel.com>2015-07-03 15:03:54 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-07-19 21:22:23 +0200
commitd42aaf30008bfaaac41da23cb1fe2ec4f6e90eb5 (patch)
treeb64e4ec7af763dc5a58c58a06235ca5e2d241c4a /drivers/net/i40e/i40e_pf.c
parent5b5edfd0406d95a0432db62bd48ad442bebd896b (diff)
downloaddpdk-d42aaf30008bfaaac41da23cb1fe2ec4f6e90eb5.zip
dpdk-d42aaf30008bfaaac41da23cb1fe2ec4f6e90eb5.tar.gz
dpdk-d42aaf30008bfaaac41da23cb1fe2ec4f6e90eb5.tar.xz
i40e: support port hotplug
This patch depends on the Port Hotplug Framework. It implements the eth_dev_uninit functions for rte_i40e_pmd and rte_i40evf_pmd. Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Helin Zhang <helin.zhang@intel.com>
Diffstat (limited to 'drivers/net/i40e/i40e_pf.c')
-rw-r--r--drivers/net/i40e/i40e_pf.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index b89a1e2..95c960c 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -1061,3 +1061,37 @@ fail:
return ret;
}
+
+int
+i40e_pf_host_uninit(struct rte_eth_dev *dev)
+{
+ struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+ struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+ uint32_t val;
+
+ PMD_INIT_FUNC_TRACE();
+
+ /**
+ * return if SRIOV not enabled, VF number not configured or
+ * no queue assigned.
+ */
+ if ((!hw->func_caps.sr_iov_1_1) ||
+ (pf->vf_num == 0) ||
+ (pf->vf_nb_qps == 0))
+ return I40E_SUCCESS;
+
+ /* free memory to store VF structure */
+ rte_free(pf->vfs);
+ pf->vfs = NULL;
+
+ /* Disable irq0 for VFR event */
+ i40e_pf_disable_irq0(hw);
+
+ /* Disable VF link status interrupt */
+ val = I40E_READ_REG(hw, I40E_PFGEN_PORTMDIO_NUM);
+ val &= ~I40E_PFGEN_PORTMDIO_NUM_VFLINK_STAT_ENA_MASK;
+ I40E_WRITE_REG(hw, I40E_PFGEN_PORTMDIO_NUM, val);
+ I40E_WRITE_FLUSH(hw);
+
+ return I40E_SUCCESS;
+}