38 COMPILE_TIME_ASSERT(
sizeof(_ev_hdr__size_check__arr_t) ==
47 EM_CHECK_LEVEL__BAD_VALUE);
54 void print_event_info(
void)
59 "event-hdr size: %zu B\n",
62 EM_DBG(
"\t\toffset\tsize\n"
64 "esv.state_cnt:\t%3zu B\t%2zu B\n"
65 "esv.state:\t%3zu B\t%2zu B\n"
66 "flags:\t\t%3zu B\t%2zu B\n"
67 "align_offset:\t%3zu B\t%2zu B\n"
68 "event_type:\t%3zu B\t%2zu B\n"
69 "event:\t\t%3zu B\t%2zu B\n"
70 "event_size:\t%3zu B\t%2zu B\n"
71 "egrp_gen:\t%3zu B\t%2zu B\n"
72 "egrp:\t\t%3zu B\t%2zu B\n"
73 "tmo:\t\t%3zu B\t%2zu B\n"
74 "user_area info:\t%3zu B\t%2zu B\n"
75 "end_hdr_data:\t%3zu B\t%2zu B\n"
77 "end:\t\t%3zu B\t%2zu B\n",
106 uint32_t offset, uint32_t size,
bool is_clone_part)
108 odp_packet_t clone_pkt;
111 clone_pkt = odp_packet_copy_part(pkt, offset, size, pkt_pool);
113 clone_pkt = odp_packet_copy(pkt, pkt_pool);
115 if (unlikely(clone_pkt == ODP_PACKET_INVALID))
120 odp_event_t odp_clone_event = odp_packet_to_event(clone_pkt);
121 event_hdr_t *clone_hdr = odp_packet_user_area(clone_pkt);
122 em_event_t clone_event = event_odp2em(odp_clone_event);
129 clone_event =
evstate_init(clone_event, clone_hdr,
false);
131 clone_hdr->
event = clone_event;
135 clone_hdr->
flags.all = 0;
145 const uint32_t qidx = output_q_elem->output.
idx;
147 if (track->used_queues[qidx] == NULL) {
148 track->used_queues[qidx] = output_q_elem;
149 track->idx[track->idx_cnt++] = qidx;
156 const em_queue_t output_queue = (em_queue_t)(uintptr_t)output_q_elem->
queue;
159 void *
const output_fn_args =
162 const int deq_max = 32;
164 em_event_t output_ev_tbl[deq_max];
166 odp_event_t *
const odp_deq_events = (odp_event_t *)output_ev_tbl;
168 const odp_queue_t odp_queue = output_q_elem->
odp_queue;
169 unsigned int output_num;
173 const bool esv_ena = esv_enabled();
176 deq = odp_queue_deq_multi(odp_queue,
179 if (unlikely(deq <= 0))
182 output_num = (
unsigned int)deq;
188 event_to_hdr_multi(output_ev_tbl, ev_hdrs, output_num);
189 for (
unsigned int i = 0; i < output_num; i++)
190 output_ev_tbl[i] = ev_hdrs[i]->event;
193 ret = output_fn(output_ev_tbl, output_num,
194 output_queue, output_fn_args);
196 if (unlikely((
unsigned int)ret != output_num))
202 output_queue_buffering_drain(
void)
206 for (
unsigned int i = 0; i < track->idx_cnt; i++) {
207 int qidx = track->idx[i];
209 env_spinlock_t *lock = &output_q_elem->output.
lock;
215 if (env_spinlock_trylock(lock)) {
216 output_queue_drain(output_q_elem);
217 env_spinlock_unlock(lock);
221 track->used_queues[qidx] = NULL;
226 uint32_t event_vector_tbl(em_event_t vector_event,
227 em_event_t **event_tbl )
229 odp_event_t odp_event = event_em2odp(vector_event);
230 odp_packet_vector_t pkt_vec = odp_packet_vector_from_event(odp_event);
231 odp_packet_t *pkt_tbl = NULL;
232 const int pkts = odp_packet_vector_tbl(pkt_vec, &pkt_tbl);
234 *event_tbl = (em_event_t *)pkt_tbl;
246 odp_packet_t odp_pkttbl[pkts];
252 events_em2pkt(*event_tbl, odp_pkttbl, pkts);
254 event_init_pkt_multi(odp_pkttbl , *event_tbl ,
255 ev_hdr_tbl , pkts,
false);
257 event_init_pkt_multi(pkt_tbl , *event_tbl ,
258 ev_hdr_tbl , pkts,
false);
264 em_status_t event_vector_max_size(em_event_t vector_event, uint32_t *max_size ,
267 odp_event_t odp_event = event_em2odp(vector_event);
268 odp_packet_vector_t pktvec = odp_packet_vector_from_event(odp_event);
269 odp_pool_t odp_pool = odp_packet_vector_pool(pktvec);
271 em_pool_t pool = (em_pool_t)(uintptr_t)pool_subpool.pool;
272 int subpool = pool_subpool.subpool;
286 if (unlikely(!pool_elem ||
290 "Invalid pool:%" PRI_POOL "", pool);
297 "Subpool not found, pool:%" PRI_POOL "", pool);
301 *max_size = pool_elem->
size[subpool];