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>
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) {