Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/dn_aqm.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
typedef uint32_t aqm_time_t; | typedef uint32_t aqm_time_t; | ||||
typedef int32_t aqm_stime_t; | typedef int32_t aqm_stime_t; | ||||
#define DN_AQM_MTAG_TS 55345 | #define DN_AQM_MTAG_TS 55345 | ||||
/* Macro for variable bounding */ | /* Macro for variable bounding */ | ||||
#define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) | #define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) | ||||
/* sysctl variable to count number of dropped packets */ | |||||
extern unsigned long io_pkt_drop; | |||||
/* | /* | ||||
* Structure for holding data and function pointers that together represent a | * Structure for holding data and function pointers that together represent a | ||||
* AQM algorithm. | * AQM algorithm. | ||||
*/ | */ | ||||
struct dn_aqm { | struct dn_aqm { | ||||
#define DN_AQM_NAME_MAX 50 | #define DN_AQM_NAME_MAX 50 | ||||
char name[DN_AQM_NAME_MAX]; /* name of AQM algorithm */ | char name[DN_AQM_NAME_MAX]; /* name of AQM algorithm */ | ||||
uint32_t type; /* AQM type number */ | uint32_t type; /* AQM type number */ | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | update_stats(struct dn_queue *q, int len, int drop) | ||||
if (len < 0) | if (len < 0) | ||||
inc = -1; | inc = -1; | ||||
else if(len > 0) | else if(len > 0) | ||||
inc = 1; | inc = 1; | ||||
if (drop) { | if (drop) { | ||||
qni->drops++; | qni->drops++; | ||||
sni->drops++; | sni->drops++; | ||||
io_pkt_drop++; | dn_cfg.io_pkt_drop++; | ||||
} else { | } else { | ||||
/*update queue stats */ | /*update queue stats */ | ||||
qni->length += inc; | qni->length += inc; | ||||
qni->len_bytes += len; | qni->len_bytes += len; | ||||
/*update scheduler instance stats */ | /*update scheduler instance stats */ | ||||
sni->length += inc; | sni->length += inc; | ||||
sni->len_bytes += len; | sni->len_bytes += len; | ||||
Show All 17 Lines |