};
struct heap {
- uint32_t limit; /* max size */
- uint32_t size; /* current size */
+ uint64_t limit; /* max size */
+ uint64_t size; /* current size */
struct heap_elem p[0];
};
-static struct heap *heap_create(uint32_t size);
+static struct heap *heap_create(uint64_t size);
static int heap_insert(struct heap *h, uint64_t k, pktsched_pkt_t *p);
static int heap_peek(struct heap *h, uint64_t *k, pktsched_pkt_t *p);
static int heap_extract(struct heap *h, uint64_t *k, pktsched_pkt_t *p);
lck_mtx_unlock(&(_sch)->netem_lock)
static struct heap *
-heap_create(uint32_t limit)
+heap_create(uint64_t limit)
{
struct heap *h = NULL;
ASSERT(h != NULL);
if (h->size == h->limit) {
- return ENOMEM;
+ return ENOBUFS;
}
- uint32_t child, parent;
+ uint64_t child, parent;
if (pkt == NULL) {
child = key;
ASSERT(child < h->size);
static int
heap_extract(struct heap *h, uint64_t *key, pktsched_pkt_t *pkt)
{
- uint32_t child, parent, max;
+ uint64_t child, parent, max;
if (h->size == 0) {
netem_log(NETEM_LOG_ERROR, "warning: extract from empty heap");
return ret;
}
-int
-netem_dequeue(struct netem *ne, pktsched_pkt_t *p,
- boolean_t *ppending)
-{
- int ret;
-
- NETEM_MTX_LOCK(ne);
- netem_update_locked(ne);
- ret = netem_dequeue_internal_locked(ne, p, ppending);
- NETEM_MTX_UNLOCK(ne);
-
- return ret;
-}
-
__attribute__((noreturn))
static void
netem_output_thread_cont(void *v, wait_result_t w)
struct reordering *r = &ne->netem_reordering_model;
r->reordering_p = p->ifnetem_reordering_p;
- netem_log(NETEM_LOG_INFO, "success: bandwidth %d bps", tb->rate);
- netem_log(NETEM_LOG_INFO, "success: corruption %d\%",
+ netem_log(NETEM_LOG_INFO, "success: bandwidth %llu bps", tb->rate);
+ netem_log(NETEM_LOG_INFO, "success: corruption %d%% ",
corr->corruption_p);
- netem_log(NETEM_LOG_INFO, "success: duplication %d\%",
+ netem_log(NETEM_LOG_INFO, "success: duplication %d%%",
dup->duplication_p);
netem_log(NETEM_LOG_INFO, "success: latency_ms %d jitter_ms %d",
late->latency_ms, late->jitter_ms);
netem_log(NETEM_LOG_INFO, "changed loss p_gr_gl %d p_gr_bl %d "
"p_bl_gr %d p_bl_br %d p_br_bl %d", loss->p_gr_gl, loss->p_gr_bl,
loss->p_bl_gr, loss->p_bl_br, loss->p_br_bl);
- netem_log(NETEM_LOG_DEBUG, "success: reordering %d\%",
+ netem_log(NETEM_LOG_DEBUG, "success: reordering %d%%",
r->reordering_p);
NETEM_MTX_UNLOCK(ne);
panic("unexpected netem call");
return 0;
}
-
-int
-netem_dequeue(struct netem *ne, pktsched_pkt_t *p, boolean_t *ppending)
-{
-#pragma unused(ne, p, ppending)
- panic("unexpected netem call");
- return 0;
-}
#endif /* !CONFIG_NETEM */