|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
20 #ifndef included_svm_queue_h
21 #define included_svm_queue_h
25 typedef struct _svm_queue
27 pthread_mutex_t mutex;
28 pthread_cond_t condvar;
int svm_queue_add(svm_queue_t *q, u8 *elem, int nowait)
void svm_queue_wait(svm_queue_t *q)
Wait for queue event.
int svm_queue_is_full(svm_queue_t *q)
void svm_queue_add_raw(svm_queue_t *q, u8 *elem)
Add element to queue with mutex held.
svm_queue_t * svm_queue_init(void *base, int nels, int elsize)
void svm_queue_free(svm_queue_t *q)
svm_queue_t * svm_queue_alloc_and_init(int nels, int elsize, int consumer_pid)
Allocate and initialize svm queue.
struct _svm_queue svm_queue_t
@ SVM_Q_NOWAIT
non-blocking call - works with both condvar and eventfd signaling
void svm_queue_unlock(svm_queue_t *q)
svm_queue_t unix_shared_memory_queue_t
int svm_queue_sub(svm_queue_t *q, u8 *elem, svm_q_conditional_wait_t cond, u32 time)
void svm_queue_send_signal(svm_queue_t *q, u8 is_prod)
int svm_queue_add_nolock(svm_queue_t *q, u8 *elem)
@ SVM_Q_TIMEDWAIT
blocking call, returns on signal or time-out - best used in combination with condvars,...
void svm_queue_lock(svm_queue_t *q)
int svm_queue_sub_raw(svm_queue_t *q, u8 *elem)
void svm_queue_set_consumer_event_fd(svm_queue_t *q, int fd)
Set consumer's event fd.
void svm_queue_set_producer_event_fd(svm_queue_t *q, int fd)
Set producer's event fd.
int svm_queue_sub2(svm_queue_t *q, u8 *elem)
@ SVM_Q_WAIT
blocking call - best used in combination with condvars, for eventfds we don't yield the cpu
int svm_queue_timedwait(svm_queue_t *q, double timeout)
Timed wait for queue event.
int svm_queue_add2(svm_queue_t *q, u8 *elem, u8 *elem2, int nowait)