: Add support for SFQ xstats
Subsystems (2)
PATCH 1/2 : Add support for SFQ xstats
[IPROUTE]: Add support for SFQ xstats
Signed-off-by Patrick McHardy <[email protected]>
---
commit 196870f762ee393438c42115425f4af69e5b5186
tree 5650c1f93cc58886f8f97a0e55e374c157b96e2e
parent 54bb35c69cec6c730a4ac95530a1d2ca6670f73b
author Patrick McHardy <[email protected]> Thu, 31 Jan 2008 15:10:07 +0100 committer Patrick McHardy <[email protected]> Thu, 31 Jan 2008 15:10:07 +0100
include/linux/pkt_sched.h | 5 +++++ tc/q_sfq.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-)
include/linux/pkt_sched.h +5 -0
@@ -150,6 +150,11 @@ struct tc_sfq_qoptunsigned flows;/* Maximal number of flows */ }; +struct tc_sfq_xstats +{ +__u32 allot; +}; +/* * NOTE: limit, divisor and flows are hardwired to code at the moment. *
tc/q_sfq.c +17 -0
@@ -100,8 +100,25 @@ static int sfq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)return 0 ; } +static int sfq_print_xstats (struct qdisc_util *qu,FILE *f, +struct rtattr *xstats) +{ +struct tc_sfq_xstats *st; + +if (xstats ==NULL ) +return 0 ; +if (RTA_PAYLOAD (xstats) <sizeof (*st)) +return -1 ; + st =RTA_DATA (xstats); + +fprintf (f," allot %d " , st->allot); +fprintf (f,"\n" ); +return 0 ; +} +struct qdisc_util sfq_qdisc_util = { .id ="sfq" , .parse_qopt = sfq_parse_opt, .print_qopt = sfq_print_opt, + .print_xstats = sfq_print_xstats, };