DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eventdev: avoid non-burst shortcut for variable-size bursts
@ 2023-05-11  6:43 Mattias Rönnblom
  2023-05-11  7:09 ` Morten Brørup
  0 siblings, 1 reply; 18+ messages in thread
From: Mattias Rönnblom @ 2023-05-11  6:43 UTC (permalink / raw)
  To: jerinj; +Cc: Jerin Jacob, hofors, dev, Mattias Rönnblom

Use non-burst event enqueue and dequeue calls from burst enqueue and
dequeue only when the burst size is compile-time constant (and equal
to one).

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 lib/eventdev/rte_eventdev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index a90e23ac8b..8af15816db 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1944,7 +1944,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
 	 * Allow zero cost non burst mode routine invocation if application
 	 * requests nb_events as const one
 	 */
-	if (nb_events == 1)
+	if (__builtin_constant_p(nb_events) && nb_events == 1)
 		return (fp_ops->enqueue)(port, ev);
 	else
 		return fn(port, ev, nb_events);
@@ -2200,7 +2200,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
 	 * Allow zero cost non burst mode routine invocation if application
 	 * requests nb_events as const one
 	 */
-	if (nb_events == 1)
+	if (__builtin_constant_p(nb_events) && nb_events == 1)
 		return (fp_ops->dequeue)(port, ev, timeout_ticks);
 	else
 		return (fp_ops->dequeue_burst)(port, ev, nb_events,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-05-17 12:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11  6:43 [PATCH] eventdev: avoid non-burst shortcut for variable-size bursts Mattias Rönnblom
2023-05-11  7:09 ` Morten Brørup
2023-05-11  8:16   ` [PATCH v2] " Mattias Rönnblom
2023-05-11  8:24     ` [PATCH v3] " Mattias Rönnblom
2023-05-11  9:01       ` Morten Brørup
2023-05-12 11:59       ` Jerin Jacob
2023-05-12 13:15         ` Mattias Rönnblom
2023-05-12 13:56           ` Morten Brørup
2023-05-12 14:52             ` Mattias Rönnblom
2023-05-15 12:33             ` Jerin Jacob
2023-05-15 12:38           ` Jerin Jacob
2023-05-15 20:52             ` Mattias Rönnblom
2023-05-16 13:08               ` Jerin Jacob
2023-05-17  7:16                 ` Mattias Rönnblom
2023-05-17 12:28                   ` Jerin Jacob
2023-05-11  8:24     ` [PATCH v2] " Morten Brørup
2023-05-11  8:29   ` [PATCH] " Mattias Rönnblom
2023-05-11  9:06     ` Morten Brørup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).