36 #ifndef EM_CHAINING_H_
37 #define EM_CHAINING_H_
43 #pragma GCC visibility push(default)
50 em_status_t event_send_device(em_event_t event, em_queue_t queue);
57 int event_send_device_multi(
const em_event_t events[],
int num,
59 #pragma GCC visibility pop
79 send_chaining(em_event_t event, em_queue_t chaining_queue)
81 const unsigned int num_outq =
em_shm->event_chaining.num_output_queues;
86 return event_send_device(event, chaining_queue);
90 em_queue_t output_queue;
94 idx = ((uint32_t)iq.device_id + (uint32_t)iq.queue_id) % num_outq;
95 output_queue =
em_shm->event_chaining.output_queues[idx];
96 output_q_elem = queue_elem_get(output_queue);
100 "Invalid output queue:%" PRI_QUEUE "", output_queue);
102 return send_output(event, output_q_elem);
111 send_chaining_multi(
const em_event_t events[],
const int num,
112 em_queue_t chaining_queue)
114 const unsigned int num_outq =
em_shm->event_chaining.num_output_queues;
119 return event_send_device_multi(events, num, chaining_queue);
123 em_queue_t output_queue;
127 idx = ((uint32_t)iq.device_id + (uint32_t)iq.queue_id) % num_outq;
128 output_queue =
em_shm->event_chaining.output_queues[idx];
129 output_q_elem = queue_elem_get(output_queue);
133 "Invalid output queue:%" PRI_QUEUE "", output_queue);
137 return send_output_multi(events, num, output_q_elem);
146 send_chaining_egrp(em_event_t event,
event_hdr_t *
const ev_hdr,
147 em_queue_t chaining_queue,
151 return send_chaining(event, chaining_queue);
153 em_event_group_t save_egrp;
155 int32_t save_egrp_gen;
158 save_current_evgrp(&save_egrp, &save_egrp_elem, &save_egrp_gen);
163 event_group_set_local(ev_hdr->
egrp, ev_hdr->
egrp_gen, 1);
165 em_status_t stat = send_chaining(event, chaining_queue);
167 event_group_count_decrement(1);
168 restore_current_evgrp(save_egrp, save_egrp_elem, save_egrp_gen);
179 send_chaining_egrp_multi(
const em_event_t events[],
event_hdr_t *
const ev_hdrs[],
180 const int num, em_queue_t chaining_queue,
184 return send_chaining_multi(events, num, chaining_queue);
186 em_event_group_t save_egrp;
188 int32_t save_egrp_gen;
191 save_current_evgrp(&save_egrp, &save_egrp_elem, &save_egrp_gen);
199 event_group_set_local(ev_hdrs[0]->egrp, ev_hdrs[0]->egrp_gen, num);
201 int num_sent = send_chaining_multi(events, num, chaining_queue);
203 event_group_count_decrement(num);
204 restore_current_evgrp(save_egrp, save_egrp_elem, save_egrp_gen);