35 const mpool_elem_t *
const pool_elem = pool_elem_get(pool);
41 "Invalid args: size:%u type:%u pool:%" PRI_POOL "",
47 "Invalid pool:%" PRI_POOL ", pool not created", pool);
57 "Invalid event type:0x%x for buf",
58 pool_elem->name, pool_elem->
em_pool, type);
66 "Invalid event type:0x%x for vector",
67 pool_elem->name, pool_elem->
em_pool, type);
71 const em_event_t
event = event_alloc(pool_elem, size, type, EVSTATE__ALLOC);
76 "EM-pool:'%s': sz:%u type:0x%x pool:%" PRI_POOL "",
77 pool_elem->name, size, type, pool);
80 pool_elem->
stats_opt.bit.cache_available)) {
87 call_api_hooks_alloc(&event, 1, 1, size, type, pool);
95 if (unlikely(num == 0))
98 const mpool_elem_t *
const pool_elem = pool_elem_get(pool);
102 unlikely(!events || num < 0 || size == 0 || !pool_elem ||
105 "Invalid args: events:%p num:%d size:%u type:%u pool:%" PRI_POOL "",
106 events, num, size, type, pool);
111 "Invalid pool:%" PRI_POOL ", pool not created", pool);
118 ret = event_alloc_pkt_multi(events, num, pool_elem, size, type);
127 "EM-pool:%s(%" PRI_POOL "): Invalid event type:0x%x for buf",
128 pool_elem->name, pool, type);
131 ret = event_alloc_buf_multi(events, num, pool_elem, size, type);
136 "EM-pool:%s(%" PRI_POOL "): Inv. event type:0x%x for vector",
137 pool_elem->name, pool, type);
140 ret = event_alloc_vector_multi(events, num, pool_elem, size, type);
146 "Requested num:%d events, allocated:%d\n"
147 "EM-pool:'%s': sz:%u type:0x%x pool:%" PRI_POOL "",
149 pool_elem->name, size, type, pool);
152 pool_elem->
stats_opt.bit.cache_available)) {
158 call_api_hooks_alloc(events, ret, num, size, type, pool);
170 static inline bool is_vector_type(em_event_t vector_event)
172 odp_event_t odp_event = event_em2odp(vector_event);
173 odp_event_type_t odp_etype = odp_event_type(odp_event);
175 if (odp_etype == ODP_EVENT_PACKET_VECTOR)
189 static inline bool is_vector_type_or_error(em_event_t vector_event,
192 bool is_vec = is_vector_type(vector_event);
206 static void event_vector_prepare_free_full(em_event_t event,
const uint16_t api_op)
210 uint32_t sz = event_vector_tbl(event, &ev_tbl);
216 for (uint32_t i = 0; i < sz; i++)
217 ev_hdrs[i] = event_to_hdr(ev_tbl[i]);
222 (void)events_em2pkt_inplace(ev_tbl, sz);
232 static void event_vector_prepare_free_full__revert(em_event_t event,
const uint16_t api_op)
236 uint32_t sz = event_vector_tbl(event, &ev_tbl);
241 event_to_hdr_multi(ev_tbl, ev_hdrs, sz);
245 for (
unsigned int i = 0; i < sz; i++)
246 ev_tbl[i] = ev_hdrs[i]->event;
256 static inline bool timer_rings_used(
void)
258 return em_shm->timers.num_ring_create_calls > 0 ? true :
false;
269 odp_event_t odp_event = event_em2odp(event);
270 const bool esv_ena = esv_enabled();
272 const bool check_tmos =
EM_CHECK_LEVEL >= 2 && timer_rings_used();
274 if (unlikely(check_tmos && odp_event_type(odp_event) == ODP_EVENT_TIMEOUT)) {
279 "Can't free active TIMER event");
284 }
else if (esv_ena) {
288 if (is_vector_type(event))
289 event_vector_prepare_free_full(event, EVSTATE__FREE);
293 call_api_hooks_free(&event, 1);
295 odp_event_free(odp_event);
307 rem_active_ring_timer_tmos(
const int num, odp_event_t odp_evtbl[],
311 int first_tmo_idx = -1;
314 for (
int i = 0; i < num; i++) {
315 if (unlikely(odp_event_type(odp_evtbl[i]) == ODP_EVENT_TIMEOUT &&
326 if (likely(first_tmo_idx == -1))
334 if (first_tmo_idx == num - 1)
342 int cpy_idx[num - first_tmo_idx - 1];
344 for (
int i = first_tmo_idx + 1; i < num; i++) {
345 if (likely(!(odp_event_type(odp_evtbl[i]) == ODP_EVENT_TIMEOUT &&
347 cpy_idx[num_cpy++] = i;
352 return first_tmo_idx;
358 for (
int i = 0; i < num_cpy; i++) {
359 int src_idx = cpy_idx[i];
360 int dst_idx = first_tmo_idx + i;
362 odp_evtbl[dst_idx] = odp_evtbl[src_idx];
363 ev_hdr_tbl[dst_idx] = ev_hdr_tbl[src_idx];
364 ev_tbl[dst_idx] = ev_tbl[src_idx];
367 return first_tmo_idx + num_cpy;
374 "Inv.args: events[]:%p num:%d", events, num);
377 if (unlikely(num == 0))
385 if (unlikely(i != num)) {
387 "events[%d] undefined!", i);
393 const bool esv_ena = esv_enabled();
394 odp_event_t odp_events[num];
396 events_em2odp(events, odp_events, num);
399 const bool check_tmos =
EM_CHECK_LEVEL >= 2 && timer_rings_used();
401 if (check_tmos || esv_ena) {
404 event_to_hdr_multi(events, ev_hdrs, num);
407 num_free = rem_active_ring_timer_tmos(num, odp_events, ev_hdrs, events);
408 if (unlikely(num_free != num))
410 "Can't free active TIMER events: %d of %d ignored",
417 for (
int i = 0; i < num_free; i++) {
418 if (is_vector_type(events[i]))
419 event_vector_prepare_free_full(events[i],
420 EVSTATE__FREE_MULTI);
426 call_api_hooks_free(events, num_free);
428 odp_event_free_multi(odp_events, num_free);
437 send_external(em_event_t event, em_queue_t queue)
448 "send out-of-EM via event-chaining failed: Q:%" PRI_QUEUE "", queue);
458 send_external_multi(
const em_event_t events[],
int num, em_queue_t queue)
463 int num_sent = send_chaining_multi(events, num, queue);
467 "send_chaining_multi: req:%d, sent:%d",
479 send_internal(em_event_t event,
event_hdr_t *ev_hdr, em_queue_t queue)
503 if (unlikely(num_sent != 1)) {
519 stat = send_output(event, q_elem);
521 if (unlikely(stat !=
EM_OK))
522 goto error_return_noesv;
533 switch (q_elem->
type) {
537 stat = send_event(event, q_elem);
540 stat = queue_unsched_enqueue(event, q_elem);
543 stat = send_local(event, q_elem);
550 if (likely(stat ==
EM_OK))
560 "send failed: Q:%" PRI_QUEUE " type:%" PRI_QTYPE
"",
561 queue, q_elem->
type);
570 send_internal_multi(
const em_event_t events[],
event_hdr_t *ev_hdrs[],
571 int num, em_queue_t queue)
596 EVSTATE__SEND_MULTI);
599 if (unlikely(num_sent != num))
613 num_sent = send_output_multi(events, num, q_elem);
615 if (unlikely(num_sent != num))
616 goto error_return_noesv;
627 switch (q_elem->
type) {
631 num_sent = send_event_multi(events, num, q_elem);
634 num_sent = queue_unsched_enqueue_multi(events, num, q_elem);
637 num_sent = send_local_multi(events, num, q_elem);
644 if (likely(num_sent == num))
652 EVSTATE__SEND_MULTI__FAIL);
656 "send-multi failed: req:%d, sent:%d",
663 const bool is_external = queue_external(queue);
671 EM_ERR_BAD_ARG, EM_ESCOPE_SEND,
"Timer-ring event can't be sent");
681 return send_external(event, queue);
686 return send_internal(event, ev_hdr, queue);
693 send_multi_check_events(
const em_event_t events[],
int num)
703 if (unlikely(i != num))
712 const bool is_external = queue_external(queue);
716 em_status_t err = send_multi_check_events(events, num);
718 if (unlikely(err !=
EM_OK)) {
720 "Invalid events:%p num:%d", events, num);
724 event_to_hdr_multi(events, ev_hdrs, num);
726 for (
int i = 0; i < num; i++) {
730 "Timer-ring event[%d] can't be sent", i);
742 return send_external_multi(events, num, queue);
747 return send_internal_multi(events, ev_hdrs, num, queue);
758 void *ev_ptr = event_pointer(event);
762 "Event pointer NULL (unsupported event type)");
779 void *ev_ptr = event_pointer(event);
783 "Event pointer NULL (unsupported event type)");
787 const odp_event_t odp_event = event_em2odp(event);
788 const odp_event_type_t odp_etype = odp_event_type(odp_event);
789 uint32_t event_size = 0;
792 if (odp_etype == ODP_EVENT_PACKET) {
793 const odp_packet_t odp_pkt = odp_packet_from_event(odp_event);
795 ev_ptr = odp_packet_data_seg_len(odp_pkt, &event_size);
796 }
else if (odp_etype == ODP_EVENT_BUFFER) {
797 const odp_buffer_t odp_buf = odp_buffer_from_event(odp_event);
798 const event_hdr_t *ev_hdr = odp_buffer_user_area(odp_buf);
801 ev_ptr = odp_buffer_addr(odp_buf);
803 ev_ptr = (
void *)((uintptr_t)ev_ptr + 32 - align_offset);
809 "Event pointer NULL (odp event type:%u)", odp_etype);
826 const odp_event_t odp_event = event_em2odp(event);
827 const odp_event_type_t odp_etype = odp_event_type(odp_event);
829 if (odp_etype == ODP_EVENT_PACKET) {
830 odp_packet_t odp_pkt = odp_packet_from_event(odp_event);
832 return odp_packet_seg_len(odp_pkt);
833 }
else if (odp_etype == ODP_EVENT_BUFFER) {
834 odp_buffer_t odp_buf = odp_buffer_from_event(odp_event);
835 const event_hdr_t *ev_hdr = odp_buffer_user_area(odp_buf);
838 }
else if (odp_etype == ODP_EVENT_TIMEOUT) {
844 "Unexpected odp event type:%u", odp_etype);
848 static inline odp_pool_t event_get_odp_pool(em_event_t event)
850 odp_event_t odp_event = event_em2odp(event);
852 #if ODP_VERSION_API_NUM(1, 43, 0) <= ODP_VERSION_API
853 return odp_event_pool(odp_event);
855 odp_event_type_t type = odp_event_type(odp_event);
856 odp_pool_t odp_pool = ODP_POOL_INVALID;
858 if (type == ODP_EVENT_PACKET) {
859 odp_packet_t pkt = odp_packet_from_event(odp_event);
861 odp_pool = odp_packet_pool(pkt);
862 }
else if (type == ODP_EVENT_BUFFER) {
863 odp_buffer_t buf = odp_buffer_from_event(odp_event);
865 odp_pool = odp_buffer_pool(buf);
866 }
else if (type == ODP_EVENT_PACKET_VECTOR) {
867 odp_packet_vector_t pktvec = odp_packet_vector_from_event(odp_event);
869 odp_pool = odp_packet_vector_pool(pktvec);
884 odp_pool_t odp_pool = event_get_odp_pool(event);
886 if (unlikely(odp_pool == ODP_POOL_INVALID))
889 em_pool_t pool = pool_odp2em(odp_pool);
907 odp_pool_t odp_pool = event_get_odp_pool(event);
909 if (unlikely(odp_pool == ODP_POOL_INVALID))
914 if (unlikely(pool_subpool.pool == (uint32_t)(uintptr_t)
EM_POOL_UNDEF))
918 *subpool = pool_subpool.subpool;
920 return (em_pool_t)(uintptr_t)pool_subpool.pool;
927 EM_ESCOPE_EVENT_SET_TYPE,
"event undefined!");
930 odp_event_t odp_event = event_em2odp(event);
931 odp_event_type_t evtype = odp_event_type(odp_event);
935 case ODP_EVENT_PACKET: {
936 odp_packet_t odp_pkt = odp_packet_from_event(odp_event);
938 ev_hdr = odp_packet_user_area(odp_pkt);
941 case ODP_EVENT_BUFFER: {
942 odp_buffer_t odp_buf = odp_buffer_from_event(odp_event);
944 ev_hdr = odp_buffer_user_area(odp_buf);
947 case ODP_EVENT_PACKET_VECTOR: {
948 odp_packet_vector_t odp_pktvec = odp_packet_vector_from_event(odp_event);
954 "Event type:0x%x not suitable for a vector", newtype);
955 ev_hdr = odp_packet_vector_user_area(odp_pktvec);
960 "Unsupported odp event type:%u", evtype);
978 ev_hdr = event_to_hdr(event);
996 if (unlikely(!events || num < 0 || !types)) {
998 EM_ESCOPE_EVENT_GET_TYPE_MULTI,
999 "Inv.args: events:%p num:%d types:%p",
1000 events, num, types);
1010 if (unlikely(i != num)) {
1012 EM_ESCOPE_EVENT_GET_TYPE_MULTI,
1013 "events[%d] undefined!", i);
1020 event_to_hdr_multi(events, ev_hdrs, num);
1022 for (i = 0; i < num; i++)
1023 types[i] = ev_hdrs[i]->event_type;
1033 if (unlikely(!events || num < 0 || !same_type)) {
1035 EM_ESCOPE_EVENT_SAME_TYPE_MULTI,
1036 "Inv.args: events:%p num:%d same_type:%p",
1037 events, num, same_type);
1049 if (unlikely(i != num)) {
1051 EM_ESCOPE_EVENT_SAME_TYPE_MULTI,
1052 "events[%d] undefined!", i);
1060 for (; same < num && type == event_to_hdr(events[same])->event_type;
1077 "Inv.args: event:%" PRI_EVENT "", event);
1079 const queue_elem_t *
const q_elem = queue_elem_get(queue);
1085 "Inv.queue:%" PRI_QUEUE " type:%" PRI_QTYPE
"",
1086 queue, q_elem->
type);
1092 EM_ERR_BAD_ARG, EM_ESCOPE_EVENT_MARK_SEND,
"Timer-ring event not allowed");
1119 "Inv.args: event:%" PRI_EVENT "", event);
1125 "Timer-ring event not allowed");
1139 "Event undefined!");
1147 "Timer-ring event not allowed");
1153 if (is_vector_type(event))
1154 event_vector_prepare_free_full(event, EVSTATE__MARK_FREE);
1164 "Event undefined!");
1172 "Timer-ring event not allowed");
1177 if (is_vector_type(event))
1178 event_vector_prepare_free_full__revert(event, EVSTATE__UNMARK_FREE);
1188 "Inv.args: events[]:%p num:%d", events, num);
1191 if (unlikely(num == 0))
1199 if (unlikely(i != num)) {
1201 EM_ESCOPE_EVENT_MARK_FREE_MULTI,
1202 "events[%d] undefined!", i);
1209 event_to_hdr_multi(events, ev_hdrs, num);
1211 for (
int i = 0; i < num; i++) {
1215 "Timer-ring event[%d] not allowed", i);
1219 evstate_free(events[i], ev_hdrs[i], EVSTATE__MARK_FREE_MULTI);
1220 if (is_vector_type(events[i]))
1221 event_vector_prepare_free_full(events[i], EVSTATE__MARK_FREE_MULTI);
1230 if (unlikely(!events || num < 0)) {
1232 "Inv.args: events[]:%p num:%d", events, num);
1235 if (unlikely(num == 0))
1243 if (unlikely(i != num)) {
1245 EM_ESCOPE_EVENT_UNMARK_FREE_MULTI,
1246 "events[%d] undefined!", i);
1253 event_to_hdr_multi(events, ev_hdrs, num);
1255 for (
int i = 0; i < num; i++) {
1259 "Timer-ring event[%d] not allowed", i);
1264 if (is_vector_type(events[i]))
1265 event_vector_prepare_free_full__revert(events[i],
1266 EVSTATE__UNMARK_FREE_MULTI);
1270 static em_event_t event_clone_part(em_event_t event, em_pool_t pool,
1271 uint32_t offset, uint32_t len,
bool clone_uarea,
1276 const bool is_clone_part = escope == EM_ESCOPE_EVENT_CLONE_PART ? true :
false;
1289 unlikely(pool_elem && !pool_allocated(pool_elem))) {
1291 "Inv.args: pool:%" PRI_POOL " not created", pool);
1295 odp_event_t odp_event = event_em2odp(event);
1296 odp_event_type_t odp_evtype = odp_event_type(odp_event);
1297 odp_pool_t odp_pool = ODP_POOL_INVALID;
1298 odp_packet_t pkt = ODP_PACKET_INVALID;
1299 odp_buffer_t buf = ODP_BUFFER_INVALID;
1301 if (unlikely(odp_evtype != ODP_EVENT_PACKET &&
1302 odp_evtype != ODP_EVENT_BUFFER)) {
1304 "Inv. odp-event-type:%d", odp_evtype);
1312 em_pool_t em_pool = pool;
1314 em_event_t clone_event;
1316 if (odp_evtype == ODP_EVENT_PACKET) {
1317 pkt = odp_packet_from_event(odp_event);
1318 ev_hdr = odp_packet_user_area(pkt);
1319 size = odp_packet_seg_len(pkt);
1321 odp_pool = odp_packet_pool(pkt);
1322 em_pool = pool_odp2em(odp_pool);
1325 buf = odp_buffer_from_event(odp_event);
1326 ev_hdr = odp_buffer_user_area(buf);
1329 odp_pool = odp_buffer_pool(buf);
1330 em_pool = pool_odp2em(odp_pool);
1334 if (is_clone_part) {
1336 uint64_t offset64 = offset;
1337 uint64_t len64 = len;
1338 uint64_t size64 = size;
1340 if (unlikely(len == 0 || offset64 + len64 > size64)) {
1342 "Inv.args: offset=%u len=%u (0 < offset+len <= %u)",
1353 if (unlikely(odp_evtype == ODP_EVENT_BUFFER)) {
1355 "No suitable event-pool found");
1362 clone_event =
pkt_clone_odp(pkt, odp_pool, offset, size, is_clone_part);
1365 "Cloning from ext odp-pool:%" PRIu64
" failed",
1366 odp_pool_to_u64(odp_pool));
1374 if (em_pool != pool)
1375 pool_elem = pool_elem_get(em_pool);
1384 "Invalid event type:0x%x for buf",
1385 pool_elem->name, em_pool, type);
1394 "Available user-area too small, clone uarea %u < needed uarea %u",
1401 clone_hdr = event_alloc_pkt(pool_elem, size);
1403 clone_hdr = event_alloc_buf(pool_elem, size);
1405 if (unlikely(!clone_hdr)) {
1407 "EM-pool:'%s': sz:%u type:0x%x pool:%" PRI_POOL "",
1408 pool_elem->name, size, type, em_pool);
1411 pool_elem->
stats_opt.bit.cache_available))
1420 clone_hdr->
flags.all = 0;
1431 const void *uarea_ptr = (
void *)((uintptr_t)ev_hdr +
sizeof(
event_hdr_t));
1432 void *clone_uarea_ptr = (
void *)((uintptr_t)clone_hdr +
sizeof(
event_hdr_t));
1435 memcpy(clone_uarea_ptr, uarea_ptr, sz);
1438 clone_event = clone_hdr->
event;
1441 uintptr_t src_addr = (uintptr_t)event_pointer(event) + offset;
1442 const void *src = (
void *)src_addr;
1443 void *dst = event_pointer(clone_event);
1445 memcpy(dst, src, size);
1449 call_api_hooks_alloc(&clone_event, 1, 1, size, type, pool);
1456 return event_clone_part(event, pool, 0, 0,
true, EM_ESCOPE_EVENT_CLONE);
1460 uint32_t offset, uint32_t len,
bool clone_uarea)
1462 return event_clone_part(event, pool, offset, len, clone_uarea,
1463 EM_ESCOPE_EVENT_CLONE_PART);
1467 event_uarea_init(em_event_t event,
event_hdr_t **ev_hdr)
1469 const odp_event_t odp_event = event_em2odp(event);
1470 const odp_event_type_t odp_evtype = odp_event_type(odp_event);
1471 odp_pool_t odp_pool = ODP_POOL_INVALID;
1472 odp_packet_t odp_pkt;
1473 odp_buffer_t odp_buf;
1474 odp_packet_vector_t odp_pktvec;
1478 switch (odp_evtype) {
1479 case ODP_EVENT_PACKET:
1480 odp_pkt = odp_packet_from_event(odp_event);
1481 hdr = odp_packet_user_area(odp_pkt);
1484 odp_pool = odp_packet_pool(odp_pkt);
1486 case ODP_EVENT_BUFFER:
1487 odp_buf = odp_buffer_from_event(odp_event);
1488 hdr = odp_buffer_user_area(odp_buf);
1491 odp_pool = odp_buffer_pool(odp_buf);
1493 case ODP_EVENT_PACKET_VECTOR:
1494 odp_pktvec = odp_packet_vector_from_event(odp_event);
1495 hdr = odp_packet_vector_user_area(odp_pktvec);
1498 odp_pool = odp_packet_vector_pool(odp_pktvec);
1514 em_pool_t pool = pool_odp2em(odp_pool);
1522 if (unlikely(!pool_elem))
1536 "Inv.arg: event undef");
1541 int err = event_uarea_init(event, &ev_hdr);
1545 "Cannot init event user area: %d", err);
1555 void *uarea_ptr = (
void *)((uintptr_t)ev_hdr +
sizeof(
event_hdr_t));
1574 "Inv.arg: event undef");
1577 int err = event_uarea_init(event, &ev_hdr);
1581 EM_ESCOPE_EVENT_UAREA_ID_SET,
1582 "Cannot init event user area: %d", err);
1593 bool id_set =
false;
1600 "Inv.args: event:%" PRI_EVENT " isset:%p id:%p",
1606 int err = event_uarea_init(event, &ev_hdr);
1610 EM_ESCOPE_EVENT_UAREA_ID_GET,
1611 "Cannot init event user area: %d", err);
1637 "Inv.args: event:%" PRI_EVENT " uarea_info:%p",
1643 int err = event_uarea_init(event, &ev_hdr);
1647 EM_ESCOPE_EVENT_UAREA_INFO,
1648 "Cannot init event user area: %d", err);
1653 uarea_info->
uarea = NULL;
1654 uarea_info->
size = 0;
1656 uarea_info->
uarea = (
void *)((uintptr_t)ev_hdr +
1673 uarea_info->
uarea = NULL;
1674 uarea_info->
size = 0;
1686 "Invalid arg: event:%" PRI_EVENT "", event);
1690 odp_event_t odp_event = event_em2odp(event);
1691 odp_event_type_t odp_etype = odp_event_type(odp_event);
1693 if (
EM_CHECK_LEVEL > 0 && unlikely(odp_etype != ODP_EVENT_PACKET)) {
1695 "Event not a packet! Refs not supported for odp-events of type:%d",
1700 odp_packet_t odp_pkt = odp_packet_from_event(odp_event);
1701 odp_packet_t pkt_ref = odp_packet_ref_static(odp_pkt);
1702 event_hdr_t *ev_hdr = odp_packet_user_area(odp_pkt);
1704 if (
EM_CHECK_LEVEL > 0 && unlikely(pkt_ref == ODP_PACKET_INVALID)) {
1706 "ODP failure in odp_packet_ref_static()");
1712 "EM assumes all refs use the same handle");
1713 odp_packet_free(odp_pkt);
1726 em_event_t ref = event;
1739 "Invalid arg: event:%" PRI_EVENT "", event);
1743 return event_has_ref(event);
1751 "Invalid args: vector_event:%" PRI_EVENT "",
1757 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_FREE))) {
1762 call_api_hooks_free(&vector_event, 1);
1764 if (esv_enabled()) {
1765 event_hdr_t *
const ev_hdr = eventvec_to_hdr(vector_event);
1767 evstate_free(vector_event, ev_hdr, EVSTATE__EVENT_VECTOR_FREE);
1770 odp_event_t odp_event = event_em2odp(vector_event);
1771 odp_packet_vector_t pkt_vec = odp_packet_vector_from_event(odp_event);
1773 odp_packet_vector_free(pkt_vec);
1777 em_event_t **event_tbl)
1782 "Invalid args: vector_event:%" PRI_EVENT " event_tbl:%p",
1783 vector_event, event_tbl);
1788 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_TBL))) {
1793 return event_vector_tbl(vector_event, event_tbl );
1801 "Invalid arg, vector_event undefined!", vector_event);
1806 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_SIZE)))
1809 odp_event_t odp_event = event_em2odp(vector_event);
1810 odp_packet_vector_t pkt_vec = odp_packet_vector_from_event(odp_event);
1812 return odp_packet_vector_size(pkt_vec);
1820 "Invalid arg, vector_event undefined!", vector_event);
1825 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_SIZE_SET)))
1828 odp_event_t odp_event = event_em2odp(vector_event);
1829 odp_packet_vector_t pkt_vec = odp_packet_vector_from_event(odp_event);
1831 odp_packet_vector_size_set(pkt_vec, size);
1839 "Invalid arg, vector_event undefined!", vector_event);
1844 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_MAX_SIZE)))
1847 uint32_t max_size = 0;
1848 em_status_t err = event_vector_max_size(vector_event, &max_size,
1849 EM_ESCOPE_EVENT_VECTOR_MAX_SIZE);
1850 if (unlikely(err !=
EM_OK))
1865 "Invalid args: vector_event:%" PRI_EVENT " vector_info:%p",
1866 vector_event, vector_info);
1871 unlikely(!is_vector_type_or_error(vector_event, EM_ESCOPE_EVENT_VECTOR_INFO))) {
1877 status = event_vector_max_size(vector_event, &vector_info->
max_size,
1878 EM_ESCOPE_EVENT_VECTOR_INFO);
1879 if (unlikely(status !=
EM_OK))
1883 vector_info->
size = event_vector_tbl(vector_event, &vector_info->
event_tbl);
1890 vector_info->
size = 0;
1898 return (uint64_t)event;