From: Patrick McHardy Date: Thu, 31 Jan 2008 17:58:52 +0000 (+0100) Subject: Add support for SFQ xstats X-Git-Tag: v2.6.25~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5626a24a8bcbbd149718a5bf148eb18b61d46538;p=thirdparty%2Fiproute2.git Add support for SFQ xstats [IPROUTE]: Add support for SFQ xstats Signed-off-by: Patrick McHardy Signed-off-by: Stephen Hemminger --- diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 32761352e..4ccd684f9 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h @@ -150,6 +150,11 @@ struct tc_sfq_qopt unsigned flows; /* Maximal number of flows */ }; +struct tc_sfq_xstats +{ + __u32 allot; +}; + /* * NOTE: limit, divisor and flows are hardwired to code at the moment. * diff --git a/tc/q_sfq.c b/tc/q_sfq.c index 05385cfdc..ce4dade80 100644 --- a/tc/q_sfq.c +++ b/tc/q_sfq.c @@ -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, };