Skip to content

Commit

Permalink
event/cnxk: fix dequeue timeout configuration
Browse files Browse the repository at this point in the history
[ upstream commit efcf81e1a89fa7b20aae17accfcb4a8e7ddc3d02 ]

Allow dequeue timeout to be configured as zero, when
RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT is disabled.

Fixes: 5512c7d ("event/cnxk: add common configuration validation")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
  • Loading branch information
PavanNikhilesh authored and kevintraynor committed Mar 5, 2024
1 parent 33266c1 commit d84482b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/event/cnxk/cnxk_eventdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,17 @@ cnxk_sso_dev_validate(const struct rte_eventdev *event_dev)

deq_tmo_ns = conf->dequeue_timeout_ns;

if (deq_tmo_ns == 0)
deq_tmo_ns = dev->min_dequeue_timeout_ns;
if (deq_tmo_ns < dev->min_dequeue_timeout_ns ||
deq_tmo_ns > dev->max_dequeue_timeout_ns) {
if (deq_tmo_ns && (deq_tmo_ns < dev->min_dequeue_timeout_ns ||
deq_tmo_ns > dev->max_dequeue_timeout_ns)) {
plt_err("Unsupported dequeue timeout requested");
return -EINVAL;
}

if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)
if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) {
if (deq_tmo_ns == 0)
deq_tmo_ns = dev->min_dequeue_timeout_ns;
dev->is_timeout_deq = 1;
}

dev->deq_tmo_ns = deq_tmo_ns;

Expand Down

0 comments on commit d84482b

Please sign in to comment.