Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netpfil/ipfw/dn_sched.h
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | struct dn_alg { | ||||
int (*config)(struct dn_schk *); | int (*config)(struct dn_schk *); | ||||
int (*destroy)(struct dn_schk*); | int (*destroy)(struct dn_schk*); | ||||
int (*new_sched)(struct dn_sch_inst *); | int (*new_sched)(struct dn_sch_inst *); | ||||
int (*free_sched)(struct dn_sch_inst *); | int (*free_sched)(struct dn_sch_inst *); | ||||
int (*new_fsk)(struct dn_fsk *f); | int (*new_fsk)(struct dn_fsk *f); | ||||
int (*free_fsk)(struct dn_fsk *f); | int (*free_fsk)(struct dn_fsk *f); | ||||
int (*new_queue)(struct dn_queue *q); | int (*new_queue)(struct dn_queue *q); | ||||
int (*free_queue)(struct dn_queue *q); | int (*free_queue)(struct dn_queue *q); | ||||
#ifdef NEW_AQM | |||||
/* Getting scheduler extra parameters */ | |||||
int (*getconfig)(struct dn_schk *, struct dn_extra_parms *); | |||||
#endif | |||||
/* run-time fields */ | /* run-time fields */ | ||||
int ref_count; /* XXX number of instances in the system */ | int ref_count; /* XXX number of instances in the system */ | ||||
SLIST_ENTRY(dn_alg) next; /* Next scheduler in the list */ | SLIST_ENTRY(dn_alg) next; /* Next scheduler in the list */ | ||||
}; | }; | ||||
/* MSVC does not support initializers so we need this ugly macro */ | /* MSVC does not support initializers so we need this ugly macro */ | ||||
#ifdef _WIN32 | #ifdef _WIN32 | ||||
Show All 17 Lines | |||||
* thing done on a dequeue as the queue itself may go away. | * thing done on a dequeue as the queue itself may go away. | ||||
*/ | */ | ||||
static __inline struct mbuf* | static __inline struct mbuf* | ||||
dn_dequeue(struct dn_queue *q) | dn_dequeue(struct dn_queue *q) | ||||
{ | { | ||||
struct mbuf *m = q->mq.head; | struct mbuf *m = q->mq.head; | ||||
if (m == NULL) | if (m == NULL) | ||||
return NULL; | return NULL; | ||||
#ifdef NEW_AQM | |||||
/* Call AQM dequeue function */ | |||||
if (q->fs->aqmfp && q->fs->aqmfp->dequeue ) | |||||
return q->fs->aqmfp->dequeue(q); | |||||
#endif | |||||
q->mq.head = m->m_nextpkt; | q->mq.head = m->m_nextpkt; | ||||
q->mq.count--; | q->mq.count--; | ||||
/* Update stats for the queue */ | /* Update stats for the queue */ | ||||
q->ni.length--; | q->ni.length--; | ||||
q->ni.len_bytes -= m->m_pkthdr.len; | q->ni.len_bytes -= m->m_pkthdr.len; | ||||
if (q->_si) { | if (q->_si) { | ||||
q->_si->ni.length--; | q->_si->ni.length--; | ||||
Show All 17 Lines |