Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/dn_sched_fq_codel.h
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | fq_update_stats(struct fq_codel_flow *q, struct fq_codel_si *si, int len, | ||||
} | } | ||||
} | } | ||||
/* extract the head of fq_codel sub-queue */ | /* extract the head of fq_codel sub-queue */ | ||||
__inline static struct mbuf * | __inline static struct mbuf * | ||||
fq_codel_extract_head(struct fq_codel_flow *q, aqm_time_t *pkt_ts, struct fq_codel_si *si) | fq_codel_extract_head(struct fq_codel_flow *q, aqm_time_t *pkt_ts, struct fq_codel_si *si) | ||||
{ | { | ||||
struct mbuf *m = q->mq.head; | struct mbuf *m; | ||||
next: m = q->mq.head; | |||||
if (m == NULL) | if (m == NULL) | ||||
return m; | return m; | ||||
q->mq.head = m->m_nextpkt; | q->mq.head = m->m_nextpkt; | ||||
fq_update_stats(q, si, -m->m_pkthdr.len, 0); | fq_update_stats(q, si, -m->m_pkthdr.len, 0); | ||||
if (si->main_q.ni.length == 0) /* queue is now idle */ | if (si->main_q.ni.length == 0) /* queue is now idle */ | ||||
si->main_q.q_time = V_dn_cfg.curr_time; | si->main_q.q_time = V_dn_cfg.curr_time; | ||||
/* extract packet timestamp*/ | /* extract packet timestamp*/ | ||||
struct m_tag *mtag; | struct m_tag *mtag; | ||||
mtag = m_tag_locate(m, MTAG_ABI_COMPAT, DN_AQM_MTAG_TS, NULL); | mtag = m_tag_locate(m, MTAG_ABI_COMPAT, DN_AQM_MTAG_TS, NULL); | ||||
if (mtag == NULL){ | if (mtag == NULL){ | ||||
D("timestamp tag is not found!"); | D("timestamp tag is not found!"); | ||||
*pkt_ts = 0; | *pkt_ts = 0; | ||||
} else { | } else { | ||||
*pkt_ts = *(aqm_time_t *)(mtag + 1); | *pkt_ts = *(aqm_time_t *)(mtag + 1); | ||||
m_tag_delete(m,mtag); | m_tag_delete(m,mtag); | ||||
} | } | ||||
if (m->m_pkthdr.rcvif != NULL && | |||||
__predict_false(m_rcvif_restore(m) == NULL)) { | |||||
m_freem(m); | |||||
goto next; | |||||
} | |||||
return m; | return m; | ||||
} | } | ||||
#endif | #endif |