"""
451 while (qb_rb_space_free(rb) < (len + QB_RB_CHUNK_MARGIN)) {
(gdb) p qb_rb_space_free(rb)
$5 = 408
(gdb) p len
$6 = 561
QB_RB_CHUNK_MARGIN apparently equals to 12
#define QB_RB_CHUNK_MARGIN (sizeof(uint32_t) * (QB_RB_CHUNK_HEADER_WORDS +\
QB_RB_WORD_ALIGN +\
QB_CACHE_LINE_WORDS))
qb_rb_chunk_alloc(struct qb_ringbuffer_s * rb, size_t len)
{
.....
/*
* Reclaim data if we are over writing and we need space
*/
if (rb->flags & QB_RB_FLAG_OVERWRITE) {
while (qb_rb_space_free(rb) < (len + QB_RB_CHUNK_MARGIN)) {
int rc = _rb_chunk_reclaim(rb);
if (rc != 0) {
errno = rc;
return NULL;
}
}
"""
So do you know how should we control the value of 'len' and where it comes to avoid failing to call function qb_rb_chunk_alloc(), , is there any concern with big packets throw to the ringbuffer? and especially what does "#define QB_RB_CHUNK_MAGIC 0xA1A1A1A1" <- this magic number mean, is there any document to describe?
Thanks in advance with your great help.