in ncrx/libncrx.c [352:378]
static void make_room(struct ncrx *ncrx, int delta)
{
int i;
/* head_seq is for the next msg, need to advance for 0 @delta too */
for (i = 0; i <= delta; i++) {
struct ncrx_slot *slot;
int max_busy = ncrx->p.nr_slots - ncrx->p.retx_stride;
/* a new slot is considered hole until it gets completed */
slot = &ncrx->slots[ncrx->head];
assert(slot_is_free(slot));
list_append(&slot->hole_node, &ncrx->hole_list);
slot->timestamp = ncrx->now_mono;
slot->retx_timestamp = 0;
/*
* Wind the ring buffer and push out if overflowed. Always
* keep at least one stride empty so that retransmissions
* of expired slots don't count as oos.
*/
ncrx->head_seq++;
ncrx->head = (ncrx->head + 1) % ncrx->p.nr_slots;
if (slot_dist(ncrx->tail, ncrx) > max_busy)
retire_tail(ncrx);
}
}