diff options
author | glebius <glebius@FreeBSD.org> | 2013-03-05 08:08:16 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-03-05 08:08:16 +0000 |
commit | 793da79af8292525d65c090f712685472aad4154 (patch) | |
tree | cebe181525957df033d132a31ce9e5408b1c2f0f /sys/contrib/altq/altq/altq_hfsc.h | |
parent | 78bc79154383d481c3e1c7062776ad59a2ba8366 (diff) | |
download | FreeBSD-src-793da79af8292525d65c090f712685472aad4154.zip FreeBSD-src-793da79af8292525d65c090f712685472aad4154.tar.gz |
Simplify TAILQ usage and avoid additional memory allocations.
Tested by: Eugene M. Zheganin <emz norma.perm.ru>
Sponsored by: Nginx, Inc
Diffstat (limited to 'sys/contrib/altq/altq/altq_hfsc.h')
-rw-r--r-- | sys/contrib/altq/altq/altq_hfsc.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/contrib/altq/altq/altq_hfsc.h b/sys/contrib/altq/altq/altq_hfsc.h index 91ba3d1..d04b378 100644 --- a/sys/contrib/altq/altq/altq_hfsc.h +++ b/sys/contrib/altq/altq/altq_hfsc.h @@ -218,16 +218,6 @@ struct runtime_sc { u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */ }; -/* for TAILQ based ellist and actlist implementation */ -struct hfsc_class; -typedef TAILQ_HEAD(_eligible, hfsc_class) ellist_t; -typedef TAILQ_ENTRY(hfsc_class) elentry_t; -typedef TAILQ_HEAD(_active, hfsc_class) actlist_t; -typedef TAILQ_ENTRY(hfsc_class) actentry_t; -#define ellist_first(s) TAILQ_FIRST(s) -#define actlist_first(s) TAILQ_FIRST(s) -#define actlist_last(s) TAILQ_LAST(s, _active) - struct hfsc_class { u_int cl_id; /* class id (just for debug) */ u_int32_t cl_handle; /* class handle */ @@ -277,10 +267,10 @@ struct hfsc_class { u_int cl_vtperiod; /* vt period sequence no */ u_int cl_parentperiod; /* parent's vt period seqno */ int cl_nactive; /* number of active children */ - actlist_t *cl_actc; /* active children list */ - actentry_t cl_actlist; /* active children list entry */ - elentry_t cl_ellist; /* eligible list entry */ + TAILQ_HEAD(acthead, hfsc_class) cl_actc; /* active children list */ + TAILQ_ENTRY(hfsc_class) cl_actlist; /* active children list entry */ + TAILQ_ENTRY(hfsc_class) cl_ellist; /* eligible list entry */ struct { struct pktcntr xmit_cnt; @@ -304,7 +294,7 @@ struct hfsc_if { u_int hif_packets; /* # of packets in the tree */ u_int hif_classid; /* class id sequence number */ - ellist_t *hif_eligible; /* eligible list */ + TAILQ_HEAD(elighead, hfsc_class) hif_eligible; /* eligible list */ #ifdef ALTQ3_CLFIER_COMPAT struct acc_classifier hif_classifier; |