EM-ODP  3.7.0
Event Machine on ODP
event_machine_queue_group.c
1 /*
2  * Copyright (c) 2015-2023, Nokia Solutions and Networks
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #include "em_include.h"
32 
33 /* per core (thread) state for em_queue_group_get_next() */
34 static ENV_LOCAL unsigned int _qgrp_tbl_iter_idx;
35 /* Per core (thread) state of em_queue_group_queue_get_next() */
36 static ENV_LOCAL unsigned int _qgrp_q_iter_idx;
37 static ENV_LOCAL em_queue_group_t _qgrp_q_iter_qgrp;
38 
39 em_queue_group_t
40 em_queue_group_create(const char *name, const em_core_mask_t *mask,
41  int num_notif, const em_notif_t notif_tbl[])
42 {
43  em_queue_group_t queue_group;
44  em_status_t err;
45 
46  if (unlikely(!mask)) {
47  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_CREATE,
48  "Core mask NULL");
49  return EM_QUEUE_GROUP_UNDEF;
50  }
51 
52  err = queue_group_check_mask(mask);
53  if (unlikely(err != EM_OK)) {
54  /* use mstr len > EM_CORE_MASK_STRLEN on mask-error */
55  char mstr[ODP_CPUMASK_STR_SIZE];
56 
57  em_core_mask_tostr(mstr, sizeof(mstr), mask);
58  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_CREATE,
59  "Invalid mask given:%s", mstr);
60  return EM_QUEUE_GROUP_UNDEF;
61  }
62 
63  err = check_notif_tbl(num_notif, notif_tbl);
64  if (unlikely(err != EM_OK)) {
65  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_CREATE,
66  "Invalid notif cfg given:%" PRI_STAT "!", err);
67  return EM_QUEUE_GROUP_UNDEF;
68  }
69 
70  queue_group = queue_group_create(name, mask, num_notif, notif_tbl,
71  EM_QUEUE_GROUP_UNDEF/*any free qgrp*/);
72  return queue_group;
73 }
74 
75 em_queue_group_t
76 em_queue_group_create_sync(const char *name, const em_core_mask_t *mask)
77 {
78  em_queue_group_t queue_group;
79  em_status_t err;
80 
81  if (unlikely(!mask)) {
82  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_CREATE_SYNC,
83  "Core mask NULL");
84  return EM_QUEUE_GROUP_UNDEF;
85  }
86 
87  err = queue_group_check_mask(mask);
88  if (unlikely(err != EM_OK)) {
89  /* use mstr len > EM_CORE_MASK_STRLEN on mask-error */
90  char mstr[ODP_CPUMASK_STR_SIZE];
91 
92  em_core_mask_tostr(mstr, sizeof(mstr), mask);
93  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_CREATE_SYNC,
94  "Invalid mask given:%s", mstr);
95  return EM_QUEUE_GROUP_UNDEF;
96  }
97 
98  queue_group = queue_group_create_sync(name, mask, EM_QUEUE_GROUP_UNDEF
99  /* any free queue group */);
100  return queue_group;
101 }
102 
104 em_queue_group_delete(em_queue_group_t queue_group,
105  int num_notif, const em_notif_t notif_tbl[])
106 {
107  em_core_mask_t zero_mask;
108  em_status_t err;
109 
110  queue_group_elem_t *const qgrp_elem =
111  queue_group_elem_get(queue_group);
112 
113  RETURN_ERROR_IF(!qgrp_elem || !queue_group_allocated(qgrp_elem),
114  EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_DELETE,
115  "Invalid queue group: %" PRI_QGRP "", queue_group);
116 
117  err = check_notif_tbl(num_notif, notif_tbl);
118  RETURN_ERROR_IF(err != EM_OK, EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_DELETE,
119  "Invalid notif cfg given, err=%" PRI_STAT "", err);
120 
121  em_core_mask_zero(&zero_mask);
122 
123  /* Use modify and the notif mechanism to set the core mask to zero */
124  err = queue_group_modify(qgrp_elem, &zero_mask, num_notif, notif_tbl,
125  true /*is_delete*/);
126 
127  RETURN_ERROR_IF(err != EM_OK, err, EM_ESCOPE_QUEUE_GROUP_DELETE,
128  "Queue group:%" PRI_QGRP " modify for delete failed!",
129  queue_group);
130 
131  return EM_OK;
132 }
133 
135 em_queue_group_delete_sync(em_queue_group_t queue_group)
136 {
137  em_core_mask_t zero_mask;
138  em_status_t err;
139 
140  queue_group_elem_t *const qgrp_elem =
141  queue_group_elem_get(queue_group);
142 
143  RETURN_ERROR_IF(!qgrp_elem || !queue_group_allocated(qgrp_elem),
144  EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_DELETE_SYNC,
145  "Invalid queue group:%" PRI_QGRP "", queue_group);
146 
147  em_core_mask_zero(&zero_mask);
148 
149  /* Use modify and the notif mechanism to set the core mask to zero */
150  err = queue_group_modify_sync(qgrp_elem, &zero_mask,
151  true /*is_delete*/);
152 
153  RETURN_ERROR_IF(err != EM_OK, err, EM_ESCOPE_QUEUE_GROUP_DELETE_SYNC,
154  "Queue group:%" PRI_QGRP " modify for delete failed!",
155  queue_group);
156 
157  return EM_OK;
158 }
159 
161 em_queue_group_modify(em_queue_group_t queue_group,
162  const em_core_mask_t *new_mask,
163  int num_notif, const em_notif_t notif_tbl[])
164 {
165  queue_group_elem_t *const qgrp_elem =
166  queue_group_elem_get(queue_group);
167  em_status_t err;
168 
169  RETURN_ERROR_IF(!qgrp_elem || !queue_group_allocated(qgrp_elem),
170  EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY,
171  "Invalid queue group:%" PRI_QGRP "", queue_group);
172 
173  RETURN_ERROR_IF(!new_mask, EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY,
174  "Queue group mask NULL! Queue group:%" PRI_QGRP "",
175  queue_group);
176 
177  err = queue_group_check_mask(new_mask);
178  if (unlikely(err != EM_OK)) {
179  /* use mstr len > EM_CORE_MASK_STRLEN on mask-error */
180  char mstr[ODP_CPUMASK_STR_SIZE];
181 
182  em_core_mask_tostr(mstr, sizeof(mstr), new_mask);
183  return INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY,
184  "Queue group:%" PRI_QGRP ", invalid mask given:%s",
185  queue_group, mstr);
186  }
187 
188  err = check_notif_tbl(num_notif, notif_tbl);
189  RETURN_ERROR_IF(err != EM_OK, EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY,
190  "Invalid notif cfg given, err=%" PRI_STAT "", err);
191 
192  err = queue_group_modify(qgrp_elem, new_mask, num_notif, notif_tbl,
193  false /*!is_delete*/);
194  RETURN_ERROR_IF(err != EM_OK, err, EM_ESCOPE_QUEUE_GROUP_MODIFY,
195  "Queue group:%" PRI_QGRP " modify failed!",
196  queue_group);
197  return EM_OK;
198 }
199 
201 em_queue_group_modify_sync(em_queue_group_t queue_group,
202  const em_core_mask_t *new_mask)
203 {
204  queue_group_elem_t *const qgrp_elem =
205  queue_group_elem_get(queue_group);
206  em_status_t err;
207 
208  RETURN_ERROR_IF(!qgrp_elem || !queue_group_allocated(qgrp_elem),
209  EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY_SYNC,
210  "Invalid queue group: %" PRI_QGRP "", queue_group);
211 
212  RETURN_ERROR_IF(!new_mask, EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY_SYNC,
213  "Queue group mask NULL! Queue group:%" PRI_QGRP "",
214  queue_group);
215 
216  err = queue_group_check_mask(new_mask);
217  if (unlikely(err != EM_OK)) {
218  /* use mstr len > EM_CORE_MASK_STRLEN on mask-error */
219  char mstr[ODP_CPUMASK_STR_SIZE];
220 
221  em_core_mask_tostr(mstr, sizeof(mstr), new_mask);
222  return INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MODIFY_SYNC,
223  "Queue group:%" PRI_QGRP ", invalid core mask given:%s",
224  queue_group, mstr);
225  }
226 
227  err = queue_group_modify_sync(qgrp_elem, new_mask, false/*!is_delete*/);
228 
229  RETURN_ERROR_IF(err != EM_OK, err, EM_ESCOPE_QUEUE_GROUP_MODIFY_SYNC,
230  "Queue group:%" PRI_QGRP " modify sync failed!",
231  queue_group);
232  return EM_OK;
233 }
234 
235 em_queue_group_t
236 em_queue_group_find(const char *name)
237 {
238  odp_schedule_group_t odp_group;
239 
240  if (!name || name[0] == '\0')
241  return EM_QUEUE_GROUP_UNDEF;
242 
243  odp_group = odp_schedule_group_lookup(name);
244  if (odp_group == ODP_SCHED_GROUP_INVALID)
245  return EM_QUEUE_GROUP_UNDEF;
246 
247  for (int i = 0; i < EM_MAX_QUEUE_GROUPS; i++) {
248  const queue_group_elem_t *qgrp_elem =
249  &em_shm->queue_group_tbl.queue_group_elem[i];
250 
251  if (qgrp_elem->odp_sched_group == odp_group &&
252  queue_group_allocated(qgrp_elem))
253  return qgrp_idx2hdl(i);
254  }
255 
256  return EM_QUEUE_GROUP_UNDEF;
257 }
258 
260 em_queue_group_get_mask(em_queue_group_t queue_group, em_core_mask_t *mask /*out*/)
261 {
262  int allocated;
263  bool ongoing_delete;
264  queue_group_elem_t *const qgrp_elem = queue_group_elem_get(queue_group);
265 
266  RETURN_ERROR_IF(!qgrp_elem, EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_MASK,
267  "Invalid queue group:%" PRI_QGRP "", queue_group);
268 
269  env_spinlock_lock(&qgrp_elem->lock);
270 
271  allocated = queue_group_allocated(qgrp_elem);
272  ongoing_delete = qgrp_elem->ongoing_delete;
273  em_core_mask_copy(mask, &qgrp_elem->core_mask);
274 
275  env_spinlock_unlock(&qgrp_elem->lock);
276 
277  RETURN_ERROR_IF(!allocated || ongoing_delete,
278  EM_ERR_BAD_STATE, EM_ESCOPE_QUEUE_GROUP_MASK,
279  "Queue group:%" PRI_QGRP " in bad state:\t"
280  "allocated=%s, ongoing_delete=%s",
281  queue_group, allocated ? "true" : "false(!)",
282  ongoing_delete ? "true(!)" : "false");
283 
284  return EM_OK;
285 }
286 
287 size_t
288 em_queue_group_get_name(em_queue_group_t queue_group,
289  char *name, size_t maxlen)
290 {
291  const queue_group_elem_t *qgrp_elem = queue_group_elem_get(queue_group);
292  odp_schedule_group_info_t info;
293  size_t len;
294  int ret;
295 
296  if (unlikely(!name || maxlen == 0)) {
297  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_GET_NAME,
298  "Invalid name=0x%" PRIx64 " or maxlen=%zu",
299  name, maxlen);
300  return 0;
301  }
302 
303  name[0] = '\0';
304 
305  if (unlikely(!qgrp_elem || !queue_group_allocated(qgrp_elem))) {
306  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_GET_NAME,
307  "Invalid queue group:%" PRI_QGRP "",
308  queue_group);
309  return 0;
310  }
311 
312  ret = odp_schedule_group_info(qgrp_elem->odp_sched_group, &info);
313  if (unlikely(ret != 0)) {
314  INTERNAL_ERROR(EM_ERR_LIB_FAILED, EM_ESCOPE_QUEUE_GROUP_GET_NAME,
315  "Failed to retrieve queue group info");
316  return 0;
317  }
318 
319  if (unlikely(!info.name))
320  return 0;
321 
322  len = strnlen(info.name, ODP_SCHED_GROUP_NAME_LEN - 1);
323  if (maxlen - 1 < len)
324  len = maxlen - 1;
325 
326  memcpy(name, info.name, len);
327  name[len] = '\0';
328 
329  return len;
330 }
331 
332 em_queue_group_t
333 em_queue_group_get_first(unsigned int *num)
334 {
335  const queue_group_elem_t *const qgrp_elem_tbl =
336  em_shm->queue_group_tbl.queue_group_elem;
337  const queue_group_elem_t *qgrp_elem = &qgrp_elem_tbl[0];
338  const unsigned int max_qgrps = EM_MAX_QUEUE_GROUPS;
339  const unsigned int qgrp_cnt = queue_group_count();
340 
341  _qgrp_tbl_iter_idx = 0; /* reset iteration */
342 
343  if (num)
344  *num = qgrp_cnt;
345 
346  if (qgrp_cnt == 0) {
347  _qgrp_tbl_iter_idx = max_qgrps; /* UNDEF = _get_next() */
348  return EM_QUEUE_GROUP_UNDEF;
349  }
350 
351  /* find first */
352  while (!queue_group_allocated(qgrp_elem)) {
353  _qgrp_tbl_iter_idx++;
354  if (_qgrp_tbl_iter_idx >= max_qgrps)
355  return EM_QUEUE_GROUP_UNDEF;
356  qgrp_elem = &qgrp_elem_tbl[_qgrp_tbl_iter_idx];
357  }
358 
359  return qgrp_idx2hdl(_qgrp_tbl_iter_idx);
360 }
361 
362 em_queue_group_t
364 {
365  const unsigned int max_qgrps = EM_MAX_QUEUE_GROUPS;
366 
367  if (_qgrp_tbl_iter_idx >= max_qgrps - 1)
368  return EM_QUEUE_GROUP_UNDEF;
369 
370  _qgrp_tbl_iter_idx++;
371 
372  const queue_group_elem_t *const qgrp_elem_tbl =
373  em_shm->queue_group_tbl.queue_group_elem;
374  const queue_group_elem_t *qgrp_elem =
375  &qgrp_elem_tbl[_qgrp_tbl_iter_idx];
376 
377  /* find next */
378  while (!queue_group_allocated(qgrp_elem)) {
379  _qgrp_tbl_iter_idx++;
380  if (_qgrp_tbl_iter_idx >= max_qgrps)
381  return EM_QUEUE_GROUP_UNDEF;
382  qgrp_elem = &qgrp_elem_tbl[_qgrp_tbl_iter_idx];
383  }
384 
385  return qgrp_idx2hdl(_qgrp_tbl_iter_idx);
386 }
387 
388 em_queue_t
389 em_queue_group_queue_get_first(unsigned int *num, em_queue_group_t queue_group)
390 {
391  const queue_group_elem_t *qgrp_elem = queue_group_elem_get(queue_group);
392  const unsigned int max_queues = em_shm->opt.queue.max_num;
393 
394  if (unlikely(!qgrp_elem || !queue_group_allocated(qgrp_elem))) {
395  INTERNAL_ERROR(EM_ERR_BAD_ARG, EM_ESCOPE_QUEUE_GROUP_QUEUE_GET_FIRST,
396  "Invalid queue group:%" PRI_QGRP "",
397  queue_group);
398  if (num)
399  *num = 0;
400  return EM_QUEUE_UNDEF;
401  }
402 
403  const unsigned int num_queues =
404  env_atomic32_get(&qgrp_elem->num_queues);
405 
406  if (num)
407  *num = num_queues;
408 
409  if (num_queues == 0) {
410  _qgrp_q_iter_idx = max_queues; /* UNDEF = _get_next() */
411  return EM_QUEUE_UNDEF;
412  }
413 
414  /*
415  * A 'qgrp_elem' contains a linked list with all it's queues. That list
416  * might be modified while processing this iteration, so instead we just
417  * go through the whole queue table.
418  * This is potentially a slow implementation and perhaps worth
419  * re-thinking?
420  */
421  const queue_elem_t *const q_elem_tbl = em_shm->queue_tbl.queue_elem;
422  const queue_elem_t *q_elem = &q_elem_tbl[0];
423 
424  _qgrp_q_iter_idx = 0; /* reset list */
425  _qgrp_q_iter_qgrp = queue_group;
426 
427  /* find first */
428  while (!queue_allocated(q_elem) ||
429  q_elem->queue_group != _qgrp_q_iter_qgrp) {
430  _qgrp_q_iter_idx++;
431  if (_qgrp_q_iter_idx >= max_queues)
432  return EM_QUEUE_UNDEF;
433  q_elem = &q_elem_tbl[_qgrp_q_iter_idx];
434  }
435 
436  return queue_idx2hdl(_qgrp_q_iter_idx);
437 }
438 
439 em_queue_t
441 {
442  const unsigned int max_queues = em_shm->opt.queue.max_num;
443 
444  if (_qgrp_q_iter_idx >= max_queues - 1)
445  return EM_QUEUE_UNDEF;
446 
447  _qgrp_q_iter_idx++;
448 
449  const queue_elem_t *const q_elem_tbl = em_shm->queue_tbl.queue_elem;
450  const queue_elem_t *q_elem = &q_elem_tbl[_qgrp_q_iter_idx];
451 
452  /* find next */
453  while (!queue_allocated(q_elem) ||
454  q_elem->queue_group != _qgrp_q_iter_qgrp) {
455  _qgrp_q_iter_idx++;
456  if (_qgrp_q_iter_idx >= max_queues)
457  return EM_QUEUE_UNDEF;
458  q_elem = &q_elem_tbl[_qgrp_q_iter_idx];
459  }
460 
461  return queue_idx2hdl(_qgrp_q_iter_idx);
462 }
463 
464 uint64_t em_queue_group_to_u64(em_queue_group_t queue_group)
465 {
466  return (uint64_t)queue_group;
467 }
EM_QUEUE_GROUP_UNDEF
#define EM_QUEUE_GROUP_UNDEF
Definition: event_machine_types.h:127
queue_elem_t::queue_group
em_queue_group_t queue_group
Definition: em_queue_types.h:252
em_queue_group_delete_sync
em_status_t em_queue_group_delete_sync(em_queue_group_t queue_group)
Definition: event_machine_queue_group.c:135
EM_OK
#define EM_OK
Definition: event_machine_types.h:329
em_core_mask_zero
void em_core_mask_zero(em_core_mask_t *mask)
Definition: event_machine_hw_specific.c:43
em_queue_group_create_sync
em_queue_group_t em_queue_group_create_sync(const char *name, const em_core_mask_t *mask)
Definition: event_machine_queue_group.c:76
em_queue_group_get_next
em_queue_group_t em_queue_group_get_next(void)
Definition: event_machine_queue_group.c:363
em_queue_group_to_u64
uint64_t em_queue_group_to_u64(em_queue_group_t queue_group)
Definition: event_machine_queue_group.c:464
queue_group_elem_t
Definition: em_queue_group_types.h:59
queue_group_elem_t::odp_sched_group
odp_schedule_group_t odp_sched_group
Definition: em_queue_group_types.h:63
queue_group_create_sync
em_queue_group_t queue_group_create_sync(const char *name, const em_core_mask_t *mask, em_queue_group_t requested_queue_group)
Definition: em_queue_group.c:598
EM_ERR_LIB_FAILED
@ EM_ERR_LIB_FAILED
Definition: event_machine_hw_types.h:291
em_queue_group_create
em_queue_group_t em_queue_group_create(const char *name, const em_core_mask_t *mask, int num_notif, const em_notif_t notif_tbl[])
Definition: event_machine_queue_group.c:40
check_notif_tbl
em_status_t check_notif_tbl(const int num_notif, const em_notif_t notif_tbl[])
Check that the usage of a table of notifications is valid.
Definition: em_internal_event.c:477
queue_group_elem_t::core_mask
em_core_mask_t core_mask
Definition: em_queue_group_types.h:65
em_core_mask_t
Definition: event_machine_hw_types.h:242
em_queue_group_queue_get_next
em_queue_t em_queue_group_queue_get_next(void)
Definition: event_machine_queue_group.c:440
queue_group_elem_t::ongoing_delete
bool ongoing_delete
Definition: em_queue_group_types.h:73
em_queue_group_find
em_queue_group_t em_queue_group_find(const char *name)
Definition: event_machine_queue_group.c:236
RETURN_ERROR_IF
#define RETURN_ERROR_IF(cond, error, escope, fmt,...)
Definition: em_error.h:50
INTERNAL_ERROR
#define INTERNAL_ERROR(error, escope, fmt,...)
Definition: em_error.h:43
queue_group_elem_t::num_queues
env_atomic32_t num_queues
Definition: em_queue_group_types.h:71
em_queue_group_get_name
size_t em_queue_group_get_name(em_queue_group_t queue_group, char *name, size_t maxlen)
Definition: event_machine_queue_group.c:288
em_status_t
uint32_t em_status_t
Definition: event_machine_types.h:321
em_queue_group_get_first
em_queue_group_t em_queue_group_get_first(unsigned int *num)
Definition: event_machine_queue_group.c:333
PRI_QGRP
#define PRI_QGRP
Definition: event_machine_types.h:129
em_queue_group_modify_sync
em_status_t em_queue_group_modify_sync(em_queue_group_t queue_group, const em_core_mask_t *new_mask)
Definition: event_machine_queue_group.c:201
em_core_mask_copy
void em_core_mask_copy(em_core_mask_t *dst, const em_core_mask_t *src)
Definition: event_machine_hw_specific.c:82
em_shm
em_shm_t * em_shm
Definition: event_machine_init.c:41
EM_MAX_QUEUE_GROUPS
#define EM_MAX_QUEUE_GROUPS
Definition: event_machine_hw_config.h:142
EM_QUEUE_UNDEF
#define EM_QUEUE_UNDEF
Definition: event_machine_types.h:107
em_include.h
em_core_mask_tostr
void em_core_mask_tostr(char *mask_str, int len, const em_core_mask_t *mask)
Definition: event_machine_hw_specific.c:156
queue_group_modify
em_status_t queue_group_modify(queue_group_elem_t *const qgrp_elem, const em_core_mask_t *new_mask, int num_notif, const em_notif_t notif_tbl[], bool is_delete)
Definition: em_queue_group.c:942
em_queue_group_modify
em_status_t em_queue_group_modify(em_queue_group_t queue_group, const em_core_mask_t *new_mask, int num_notif, const em_notif_t notif_tbl[])
Definition: event_machine_queue_group.c:161
em_notif_t
Definition: event_machine_types.h:268
queue_group_create
em_queue_group_t queue_group_create(const char *name, const em_core_mask_t *mask, int num_notif, const em_notif_t notif_tbl[], em_queue_group_t queue_group)
Definition: em_queue_group.c:583
queue_group_modify_sync
em_status_t queue_group_modify_sync(queue_group_elem_t *const qgrp_elem, const em_core_mask_t *new_mask, bool is_delete)
Definition: em_queue_group.c:1034
EM_ERR_BAD_ARG
@ EM_ERR_BAD_ARG
Definition: event_machine_hw_types.h:261
ENV_LOCAL
#define ENV_LOCAL
Definition: environment.h:57
EM_ERR_BAD_STATE
@ EM_ERR_BAD_STATE
Definition: event_machine_hw_types.h:263
queue_group_elem_t::lock
env_spinlock_t lock
Definition: em_queue_group_types.h:75
queue_elem_t
Definition: em_queue_types.h:180
queue_group_check_mask
em_status_t queue_group_check_mask(const em_core_mask_t *mask)
Check that only running EM cores are set in mask.
Definition: em_queue_group.c:610
em_queue_group_get_mask
em_status_t em_queue_group_get_mask(em_queue_group_t queue_group, em_core_mask_t *mask)
Definition: event_machine_queue_group.c:260
em_queue_group_queue_get_first
em_queue_t em_queue_group_queue_get_first(unsigned int *num, em_queue_group_t queue_group)
Definition: event_machine_queue_group.c:389
em_queue_group_delete
em_status_t em_queue_group_delete(em_queue_group_t queue_group, int num_notif, const em_notif_t notif_tbl[])
Definition: event_machine_queue_group.c:104