event/dlb2: fix CQ depth override
authorTimothy McDaniel <timothy.mcdaniel@intel.com>
Sat, 2 Jul 2022 16:22:37 +0000 (11:22 -0500)
committerJerin Jacob <jerinj@marvell.com>
Mon, 4 Jul 2022 16:04:52 +0000 (18:04 +0200)
This commit fixes a bug, where we could assign a CQ depth
of zero, leading to a subsequent divide-by-zero fault.
It also fixes an issue where the original default CQ depth
was returned on a query, instead of the overridden value.

Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
drivers/event/dlb2/dlb2.c

index a6182a1..b50cd8e 100644 (file)
@@ -4505,7 +4505,14 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
        dlb2->hw_credit_quanta = dlb2_args->hw_credit_quanta;
        dlb2->default_depth_thresh = dlb2_args->default_depth_thresh;
        dlb2->vector_opts_enabled = dlb2_args->vector_opts_enabled;
-       dlb2->max_cq_depth = dlb2_args->max_cq_depth;
+
+
+       if (dlb2_args->max_cq_depth != 0)
+               dlb2->max_cq_depth = dlb2_args->max_cq_depth;
+       else
+               dlb2->max_cq_depth = DLB2_DEFAULT_CQ_DEPTH;
+
+       evdev_dlb2_default_info.max_event_port_dequeue_depth = dlb2->max_cq_depth;
 
        err = dlb2_iface_open(&dlb2->qm_instance, name);
        if (err < 0) {