iproute2 support for Heavy Hitter Filter (HHF) qdisc.
Subsystems (2)
PATCH 1/1 iproute2 support for Heavy Hitter Filter (HHF) qdisc.
$tc qdisc add dev eth0 hhf help
Usage: ... hhf [ limit PACKETS ] [ quantum BYTES]
[ hh_limit NUMBER ]
[ reset_timeout TIME ]
[ admit_bytes BYTES ]
[ evict_timeout TIME ]
[ non_hh_weight NUMBER ]
$tc -s -d qdisc show dev eth0
qdisc hhf 8005: root refcnt 32 limit 1000p quantum 1514 hh_limit 2048 reset_timeout 40.0ms admit_bytes 131072 evict_timeout 1.0s non_hh_weight 2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
drop_overlimit 0 hh_overlimit 0 tot_hh 0 cur_hh 0
HHF qdisc parameters:
- limit: max number of packets in qdisc (default 1000)
- quantum: max deficit per RR round (default 1 MTU)
- hh_limit: max number of HHs to keep states (default 2048)
- reset_timeout: time to reset HHF counters (default 40ms)
- admit_bytes: counter thresh to classify as HH (default 128KB)
- evict_timeout: threshold to evict idle HHs (default 1s)
- non_hh_weight: DRR weight for mice (default 2)
--- include/linux/pkt_sched.h | 23 ++++++ tc/Makefile | 1 + tc/q_hhf.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+) create mode 100644 tc/q_hhf.c
include/linux/pkt_sched.h +23 -0
@@ -790,4 +790,27 @@ struct tc_fq_qd_stats {__u32 throttled_flows; __u32 pad; }; + +/* Heavy-Hitter Filter */ + +enum { +TCA_HHF_UNSPEC , +TCA_HHF_BACKLOG_LIMIT , +TCA_HHF_QUANTUM , +TCA_HHF_HH_FLOWS_LIMIT , +TCA_HHF_RESET_TIMEOUT , +TCA_HHF_ADMIT_BYTES , +TCA_HHF_EVICT_TIMEOUT , +TCA_HHF_NON_HH_WEIGHT , + __TCA_HHF_MAX +}; + +#define TCA_HHF_MAX (__TCA_HHF_MAX - 1) + +struct tc_hhf_xstats { +__u32 drop_overlimit;/* number of time qdisc packet limit was hit */ +__u32 hh_overlimit;/* number of time max heavy-hitters was hit */ +__u32 hh_tot_count;/* number of captured heavy-hitters so far */ +__u32 hh_cur_count;/* number of current heavy-hitters */ +};#endif
tc/Makefile +1 -0
@@ -53,6 +53,7 @@ TCMODULES += q_mqprio.o TCMODULES += q_codel.o TCMODULES += q_fq_codel.o TCMODULES += q_fq.o +TCMODULES += q_hhf.o ifeq ($(TC_CONFIG_IPSET), y) ifeq ($(TC_CONFIG_XT), y)
tc/q_hhf.c new file +199 -0
199 lines not on this page · raw message
Signature · 1 line
1.8.5.1
Stephen Hemminger
AppliedQuoted 24 lines · On Thu, 9 Jan 2014 00:23:11 -0800 Terry Lam <[email protected]> wrote:
$tc qdisc add dev eth0 hhf help
Usage: ... hhf [ limit PACKETS ] [ quantum BYTES]
[hh_limitNUMBER ]
[reset_timeoutTIME ]
[admit_bytesBYTES ]
[evict_timeoutTIME ]
[non_hh_weightNUMBER ]$tc -s -d qdisc show dev eth0
qdisc hhf 8005: root refcnt 32 limit 1000p quantum 1514hh_limit2048reset_timeout40.0msadmit_bytes131072evict_timeout1.0snon_hh_weight2
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
drop_overlimit0hh_overlimit0tot_hh0cur_hh0HHF qdisc parameters:
- limit: max number of packets in qdisc (default 1000)
- quantum: max deficit per RR round (default 1 MTU)
-hh_limit: max number of HHs to keep states (default 2048)
-reset_timeout: time to reset HHF counters (default 40ms)
-admit_bytes: counter thresh to classify as HH (default 128KB)
-evict_timeout: threshold to evict idle HHs (default 1s)
-non_hh_weight: DRR weight for mice (default 2)
Quoted 1 line
Signed-
Applied to net-next-for-3.13 branch