]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Add support for SFQ xstats
authorPatrick McHardy <kaber@trash.net>
Thu, 31 Jan 2008 17:58:52 +0000 (18:58 +0100)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 1 Feb 2008 06:28:10 +0000 (22:28 -0800)
[IPROUTE]: Add support for SFQ xstats

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
include/linux/pkt_sched.h
tc/q_sfq.c

index 32761352e858cd4c95b15ab215b8c39be9fe756e..4ccd684f93812e1161537ea68290cb02e47675dd 100644 (file)
@@ -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.
  *
index 05385cfdc45cae909e39560d3bb4a376c6d52bb3..ce4dade80c15538cd3a21c2a7001c0629d1075be 100644 (file)
@@ -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,
 };