aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/include
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2022-12-05 12:51:32 +0200
committerMatias Elo <matias.elo@nokia.com>2022-12-13 15:27:08 +0200
commit6ee4f0da2f5fb0f3e6d0b830448f83f1927c4ada (patch)
treeda90377bca75517af167907dcd663d5ff664fb1f /platform/linux-dpdk/include
parent78c0cf3e24f2b36a21905a2afea81f4bd8787b8c (diff)
Port 19bcb9061 "linux-gen: buffer: implement multi variants of event conversion functions"
Port original commit from linux-generic. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include')
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
index 46029eb89..6265914b4 100644
--- a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h
@@ -33,7 +33,9 @@
/* Inline functions by default */
#define _ODP_INLINE static inline
#define odp_buffer_from_event __odp_buffer_from_event
+ #define odp_buffer_from_event_multi __odp_buffer_from_event_multi
#define odp_buffer_to_event __odp_buffer_to_event
+ #define odp_buffer_to_event_multi __odp_buffer_to_event_multi
#define odp_buffer_addr __odp_buffer_addr
#define odp_buffer_size __odp_buffer_size
#define odp_buffer_pool __odp_buffer_pool
@@ -52,11 +54,23 @@ _ODP_INLINE odp_buffer_t odp_buffer_from_event(odp_event_t ev)
return (odp_buffer_t)ev;
}
+_ODP_INLINE void odp_buffer_from_event_multi(odp_buffer_t buf[], const odp_event_t ev[], int num)
+{
+ for (int i = 0; i < num; i++)
+ buf[i] = odp_buffer_from_event(ev[i]);
+}
+
_ODP_INLINE odp_event_t odp_buffer_to_event(odp_buffer_t buf)
{
return (odp_event_t)buf;
}
+_ODP_INLINE void odp_buffer_to_event_multi(const odp_buffer_t buf[], odp_event_t ev[], int num)
+{
+ for (int i = 0; i < num; i++)
+ ev[i] = odp_buffer_to_event(buf[i]);
+}
+
_ODP_INLINE void *odp_buffer_addr(odp_buffer_t buf)
{
return _odp_event_hdr_field(buf, void *, base_data);