[PATCH 1/2] eventdev: fix vector adapter power-of-2 size check

pbhagavatula at marvell.com pbhagavatula at marvell.com
Thu Sep 10 15:56:48 CEST 2026


From: Pavan Nikhilesh <pbhagavatula at marvell.com>

validate_conf() rejected valid configurations and accepted invalid
ones: when the adapter requires a log2 vector size it errored out if
the size *was* a power of 2 (rte_is_power_of_2() != 0) instead of when
it was not. Invert the condition to reject non-power-of-2 sizes.

Fixes: e12c3754da7a ("eventdev/vector: introduce event vector adapter")
Cc: stable at dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
 lib/eventdev/rte_event_vector_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_vector_adapter.c b/lib/eventdev/rte_event_vector_adapter.c
index ad764e2882f0..9a839517c865 100644
--- a/lib/eventdev/rte_event_vector_adapter.c
+++ b/lib/eventdev/rte_event_vector_adapter.c
@@ -86,7 +86,7 @@ validate_conf(const struct rte_event_vector_adapter_conf *conf,
 		return rc;
 	}
 
-	if (info->log2_sz && rte_is_power_of_2(conf->vector_sz) != 0) {
+	if (info->log2_sz && rte_is_power_of_2(conf->vector_sz) == 0) {
 		EVVEC_LOG_DBG("invalid vector size %u, should be a power of 2", conf->vector_sz);
 		return rc;
 	}
-- 
2.50.1 (Apple Git-155)



More information about the stable mailing list