Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_dn_io.c
Show First 20 Lines • Show All 494 Lines • ▼ Show 20 Lines | dn_enqueue(struct dn_queue *q, struct mbuf* m, int drop) | ||||
q->ni.tot_bytes += len; | q->ni.tot_bytes += len; | ||||
q->ni.tot_pkts++; | q->ni.tot_pkts++; | ||||
ni->tot_bytes += len; | ni->tot_bytes += len; | ||||
ni->tot_pkts++; | ni->tot_pkts++; | ||||
if (drop) | if (drop) | ||||
goto drop; | goto drop; | ||||
if (f->plr && random() < f->plr) | if (f->plr && random() < f->plr) | ||||
goto drop; | goto drop; | ||||
if (m->m_pkthdr.rcvif != NULL) | |||||
m_rcvif_serialize(m); | |||||
#ifdef NEW_AQM | #ifdef NEW_AQM | ||||
/* Call AQM enqueue function */ | /* Call AQM enqueue function */ | ||||
if (q->fs->aqmfp) | if (q->fs->aqmfp) | ||||
return q->fs->aqmfp->enqueue(q ,m); | return q->fs->aqmfp->enqueue(q ,m); | ||||
#endif | #endif | ||||
if (f->flags & DN_IS_RED && red_drops(q, m->m_pkthdr.len)) { | if (f->flags & DN_IS_RED && red_drops(q, m->m_pkthdr.len)) { | ||||
if (!(f->flags & DN_IS_ECN) || !ecn_mark(m)) | if (!(f->flags & DN_IS_ECN) || !ecn_mark(m)) | ||||
goto drop; | goto drop; | ||||
Show All 32 Lines | transmit_event(struct mq *q, struct delay_line *dline, uint64_t now) | ||||
dline->oid.subtype = 0; /* not in heap */ | dline->oid.subtype = 0; /* not in heap */ | ||||
while ((m = dline->mq.head) != NULL) { | while ((m = dline->mq.head) != NULL) { | ||||
pkt = dn_tag_get(m); | pkt = dn_tag_get(m); | ||||
if (!DN_KEY_LEQ(pkt->output_time, now)) | if (!DN_KEY_LEQ(pkt->output_time, now)) | ||||
break; | break; | ||||
dline->mq.head = m->m_nextpkt; | dline->mq.head = m->m_nextpkt; | ||||
dline->mq.count--; | dline->mq.count--; | ||||
if (m->m_pkthdr.rcvif != NULL && | |||||
__predict_false(m_rcvif_restore(m) == NULL)) | |||||
m_freem(m); | |||||
else | |||||
mq_append(q, m); | mq_append(q, m); | ||||
} | } | ||||
if (m != NULL) { | if (m != NULL) { | ||||
dline->oid.subtype = 1; /* in heap */ | dline->oid.subtype = 1; /* in heap */ | ||||
heap_insert(&V_dn_cfg.evheap, pkt->output_time, dline); | heap_insert(&V_dn_cfg.evheap, pkt->output_time, dline); | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | while (si->credit >= 0 && (m = s->fp->dequeue(si)) != NULL) { | ||||
uint64_t len_scaled; | uint64_t len_scaled; | ||||
done++; | done++; | ||||
len_scaled = (bw == 0) ? 0 : hz * | len_scaled = (bw == 0) ? 0 : hz * | ||||
(m->m_pkthdr.len * 8 + extra_bits(m, s)); | (m->m_pkthdr.len * 8 + extra_bits(m, s)); | ||||
si->credit -= len_scaled; | si->credit -= len_scaled; | ||||
/* Move packet in the delay line */ | /* Move packet in the delay line */ | ||||
dn_tag_get(m)->output_time = V_dn_cfg.curr_time + s->link.delay ; | dn_tag_get(m)->output_time = V_dn_cfg.curr_time + s->link.delay ; | ||||
if (m->m_pkthdr.rcvif != NULL) | |||||
m_rcvif_serialize(m); | |||||
mq_append(&si->dline.mq, m); | mq_append(&si->dline.mq, m); | ||||
} | } | ||||
/* | /* | ||||
* If credit >= 0 the instance is idle, mark time. | * If credit >= 0 the instance is idle, mark time. | ||||
* Otherwise put back in the heap, and adjust the output | * Otherwise put back in the heap, and adjust the output | ||||
* time of the last inserted packet, m, which was too early. | * time of the last inserted packet, m, which was too early. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 342 Lines • Show Last 20 Lines |