Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/dn_aqm.h
Show All 31 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _IP_DN_AQM_H | #ifndef _IP_DN_AQM_H | ||||
#define _IP_DN_AQM_H | #define _IP_DN_AQM_H | ||||
/* NOW is the current time in millisecond*/ | /* NOW is the current time in millisecond*/ | ||||
#define NOW ((dn_cfg.curr_time * tick) / 1000) | #define NOW ((V_dn_cfg.curr_time * tick) / 1000) | ||||
#define AQM_UNOW (dn_cfg.curr_time * tick) | #define AQM_UNOW (V_dn_cfg.curr_time * tick) | ||||
#define AQM_TIME_1US ((aqm_time_t)(1)) | #define AQM_TIME_1US ((aqm_time_t)(1)) | ||||
#define AQM_TIME_1MS ((aqm_time_t)(1000)) | #define AQM_TIME_1MS ((aqm_time_t)(1000)) | ||||
#define AQM_TIME_1S ((aqm_time_t)(AQM_TIME_1MS * 1000)) | #define AQM_TIME_1S ((aqm_time_t)(AQM_TIME_1MS * 1000)) | ||||
/* aqm time allows to store up to 4294 seconds */ | /* aqm time allows to store up to 4294 seconds */ | ||||
typedef uint32_t aqm_time_t; | typedef uint32_t aqm_time_t; | ||||
typedef int32_t aqm_stime_t; | typedef int32_t aqm_stime_t; | ||||
▲ Show 20 Lines • Show All 78 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++; | ||||
dn_cfg.io_pkt_drop++; | V_dn_cfg.io_pkt_drop++; | ||||
kp: Sidenote: sooner or later we'll want to turn these into counter_u64's. | |||||
} 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 |
Sidenote: sooner or later we'll want to turn these into counter_u64's.