aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/gen_stats.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-09-28 14:53:57 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-30 01:02:26 -0400
commit6401585366326fc0ecbc372ec60d1a15cd8be2f5 (patch)
treec3e8f777a579ee8b912e98d06ceb2aa1ffbb6a8b /net/core/gen_stats.c
parent25331d6ce42bcf4b34b6705fce4da15c3fabe62f (diff)
net: sched: restrict use of qstats qlen
This removes the use of qstats->qlen variable from the classifiers and makes it an explicit argument to gnet_stats_copy_queue(). The qlen represents the qdisc queue length and is packed into the qstats at the last moment before passnig to user space. By handling it explicitely we avoid, in the percpu stats case, having to figure out which per_cpu variable to put it in. It would probably be best to remove it from qstats completely but qstats is a user space ABI and can't be broken. A future patch could make an internal only qstats structure that would avoid having to allocate an additional u32 variable on the Qdisc struct. This would make the qstats struct 128bits instead of 128+32. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/gen_stats.c')
-rw-r--r--net/core/gen_stats.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
index 5ff8e80fe0bb..ad3ecb6ba835 100644
--- a/net/core/gen_stats.c
+++ b/net/core/gen_stats.c
@@ -219,6 +219,7 @@ EXPORT_SYMBOL(gnet_stats_copy_rate_est);
219 * gnet_stats_copy_queue - copy queue statistics into statistics TLV 219 * gnet_stats_copy_queue - copy queue statistics into statistics TLV
220 * @d: dumping handle 220 * @d: dumping handle
221 * @q: queue statistics 221 * @q: queue statistics
222 * @qlen: queue length statistics
222 * 223 *
223 * Appends the queue statistics to the top level TLV created by 224 * Appends the queue statistics to the top level TLV created by
224 * gnet_stats_start_copy(). 225 * gnet_stats_start_copy().
@@ -227,8 +228,11 @@ EXPORT_SYMBOL(gnet_stats_copy_rate_est);
227 * if the room in the socket buffer was not sufficient. 228 * if the room in the socket buffer was not sufficient.
228 */ 229 */
229int 230int
230gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q) 231gnet_stats_copy_queue(struct gnet_dump *d,
232 struct gnet_stats_queue *q, __u32 qlen)
231{ 233{
234 q->qlen = qlen;
235
232 if (d->compat_tc_stats) { 236 if (d->compat_tc_stats) {
233 d->tc_stats.drops = q->drops; 237 d->tc_stats.drops = q->drops;
234 d->tc_stats.qlen = q->qlen; 238 d->tc_stats.qlen = q->qlen;