diff options
| -rw-r--r-- | include/linux/rtnetlink.h | 1 | ||||
| -rw-r--r-- | net/sched/sch_api.c | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ac4528ead16e..9bb86160c2f2 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -698,6 +698,7 @@ enum TCA_XSTATS, TCA_RATE, TCA_FCNT, + TCA_STATS2, __TCA_MAX }; diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 5da7b7312642..3c985a58145c 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -750,6 +750,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, struct tcmsg *tcm; struct nlmsghdr *nlh; unsigned char *b = skb->tail; + struct gnet_dump d; nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm)); nlh->nlmsg_flags = flags; @@ -762,9 +763,22 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, RTA_PUT(skb, TCA_KIND, IFNAMSIZ, q->ops->id); if (q->ops->dump && q->ops->dump(q, skb) < 0) goto rtattr_failure; - q->stats.qlen = q->q.qlen; - if (qdisc_copy_stats(skb, &q->stats, q->stats_lock)) + q->qstats.qlen = q->q.qlen; + + if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, + TCA_XSTATS, q->stats_lock, &d) < 0) + goto rtattr_failure; + + if (gnet_stats_copy_basic(&d, &q->bstats) < 0 || +#ifdef CONFIG_NET_ESTIMATOR + gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 || +#endif + gnet_stats_copy_queue(&d, &q->qstats) < 0) + goto rtattr_failure; + + if (gnet_stats_finish_copy(&d) < 0) goto rtattr_failure; + nlh->nlmsg_len = skb->tail - b; return skb->len; |
