[v2,20/22] event/dlb2: add queue and port release
diff mbox series

Message ID 1602958879-8558-21-git-send-email-timothy.mcdaniel@intel.com
State Superseded
Delegated to: Jerin Jacob
Headers show
Series
  • Add DLB2 PMD
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

McDaniel, Timothy Oct. 17, 2020, 6:21 p.m. UTC
DLB does not support reconfiguring individual queues
or ports on the fly. The entire device must be reconfigured.
Previously allocated port QE ond memzone memory
is freed in this patch.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

Comments

Eads, Gage Oct. 20, 2020, 2:04 p.m. UTC | #1
> -----Original Message-----
> From: McDaniel, Timothy <timothy.mcdaniel@intel.com>
> Sent: Saturday, October 17, 2020 1:21 PM
> Cc: dev@dpdk.org; Carrillo, Erik G <erik.g.carrillo@intel.com>; Eads, Gage
> <gage.eads@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>;
> jerinj@marvell.com
> Subject: [PATCH v2 20/22] event/dlb2: add queue and port release
> 
> DLB does not support reconfiguring individual queues
> or ports on the fly. The entire device must be reconfigured.
> Previously allocated port QE ond memzone memory
> is freed in this patch.
> 
> Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
> ---
>  drivers/event/dlb2/dlb2.c | 28 ++++++++++++++++++++++++++--
>  1 file changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
> index 06a59a5..968923e 100644
> --- a/drivers/event/dlb2/dlb2.c
> +++ b/drivers/event/dlb2/dlb2.c
> @@ -89,8 +89,8 @@ dlb2_free_qe_mem(struct dlb2_port *qm_port)
>  	rte_free(qm_port->consume_qe);
>  	qm_port->consume_qe = NULL;
> 
> -	rte_free(dlb2_port[qm_port->id][PORT_TYPE(qm_port)].cq_base);
> -	rte_free(dlb2_port[qm_port->id][PORT_TYPE(qm_port)].pp_addr);
> +	rte_memzone_free(dlb2_port[qm_port-
> >id][PORT_TYPE(qm_port)].mz);
> +	dlb2_port[qm_port->id][PORT_TYPE(qm_port)].mz = NULL;
>  }

This code should be a part of patch 8, when free_qe_mem is introduced. With that change:
Reviewed-by: Gage Eads <gage.eads@intel.com>

Thanks,
Gage

Patch
diff mbox series

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 06a59a5..968923e 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -89,8 +89,8 @@  dlb2_free_qe_mem(struct dlb2_port *qm_port)
 	rte_free(qm_port->consume_qe);
 	qm_port->consume_qe = NULL;
 
-	rte_free(dlb2_port[qm_port->id][PORT_TYPE(qm_port)].cq_base);
-	rte_free(dlb2_port[qm_port->id][PORT_TYPE(qm_port)].pp_addr);
+	rte_memzone_free(dlb2_port[qm_port->id][PORT_TYPE(qm_port)].mz);
+	dlb2_port[qm_port->id][PORT_TYPE(qm_port)].mz = NULL;
 }
 
 /* override defaults with value(s) provided on command line */
@@ -3676,6 +3676,28 @@  dlb2_eventdev_close(struct rte_eventdev *dev)
 }
 
 static void
+dlb2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t id)
+{
+	RTE_SET_USED(dev);
+	RTE_SET_USED(id);
+
+	/* This function intentionally left blank. */
+}
+
+static void
+dlb2_eventdev_port_release(void *port)
+{
+	struct dlb2_eventdev_port *ev_port = port;
+	struct dlb2_port *qm_port;
+
+	if (ev_port) {
+		qm_port = &ev_port->qm_port;
+		if (qm_port->config_state == DLB2_CONFIGURED)
+			dlb2_free_qe_mem(qm_port);
+	}
+}
+
+static void
 dlb2_entry_points_init(struct rte_eventdev *dev)
 {
 	struct dlb2_eventdev *dlb2;
@@ -3689,8 +3711,10 @@  dlb2_entry_points_init(struct rte_eventdev *dev)
 		.dev_close        = dlb2_eventdev_close,
 		.queue_def_conf   = dlb2_eventdev_queue_default_conf_get,
 		.queue_setup      = dlb2_eventdev_queue_setup,
+		.queue_release    = dlb2_eventdev_queue_release,
 		.port_def_conf    = dlb2_eventdev_port_default_conf_get,
 		.port_setup       = dlb2_eventdev_port_setup,
+		.port_release     = dlb2_eventdev_port_release,
 		.port_link        = dlb2_eventdev_port_link,
 		.port_unlink      = dlb2_eventdev_port_unlink,
 		.port_unlinks_in_progress =