summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-09-30 14:02:12 +0530
committerJerin Jacob <jerinj@marvell.com>2019-10-05 15:39:31 +0200
commitfebcd5a5b358fcbef93ee0a693260c1719f162d5 (patch)
tree28eeae5b8cf0a338e8fa17a0f6aa57539de00c82 /drivers
parentfc0acd6ac524f030ebc397fe6e98bb2607c6ed65 (diff)
downloaddpdk-febcd5a5b358fcbef93ee0a693260c1719f162d5.zip
dpdk-febcd5a5b358fcbef93ee0a693260c1719f162d5.tar.gz
dpdk-febcd5a5b358fcbef93ee0a693260c1719f162d5.tar.xz
event/dpaa2: support destroy
This patch add support to destroy the event device Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/event/dpaa2/dpaa2_eventdev.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 98b4876..9255de1 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -1060,6 +1060,39 @@ fail:
}
static int
+dpaa2_eventdev_destroy(const char *name)
+{
+ struct rte_eventdev *eventdev;
+ struct dpaa2_eventdev *priv;
+ int i;
+
+ eventdev = rte_event_pmd_get_named_dev(name);
+ if (eventdev == NULL) {
+ RTE_EDEV_LOG_ERR("eventdev with name %s not allocated", name);
+ return -1;
+ }
+
+ /* For secondary processes, the primary has done all the work */
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
+ priv = eventdev->data->dev_private;
+ for (i = 0; i < priv->max_event_queues; i++) {
+ if (priv->evq_info[i].dpcon)
+ rte_dpaa2_free_dpcon_dev(priv->evq_info[i].dpcon);
+
+ if (priv->evq_info[i].dpci)
+ rte_dpaa2_free_dpci_dev(priv->evq_info[i].dpci);
+
+ }
+ priv->max_event_queues = 0;
+
+ RTE_LOG(INFO, PMD, "%s eventdev cleaned\n", name);
+ return 0;
+}
+
+
+static int
dpaa2_eventdev_probe(struct rte_vdev_device *vdev)
{
const char *name;
@@ -1077,6 +1110,8 @@ dpaa2_eventdev_remove(struct rte_vdev_device *vdev)
name = rte_vdev_device_name(vdev);
DPAA2_EVENTDEV_INFO("Closing %s", name);
+ dpaa2_eventdev_destroy(name);
+
return rte_event_pmd_vdev_uninit(name);
}