Lines Matching refs:d
24 gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size, int padattr) in gnet_stats_copy() argument
26 if (nla_put_64bit(d->skb, type, size, buf, padattr)) in gnet_stats_copy()
31 if (d->lock) in gnet_stats_copy()
32 spin_unlock_bh(d->lock); in gnet_stats_copy()
33 kfree(d->xstats); in gnet_stats_copy()
34 d->xstats = NULL; in gnet_stats_copy()
35 d->xstats_len = 0; in gnet_stats_copy()
61 struct gnet_dump *d, int padattr) in gnet_stats_start_copy_compat() argument
64 memset(d, 0, sizeof(*d)); in gnet_stats_start_copy_compat()
67 d->tail = (struct nlattr *)skb_tail_pointer(skb); in gnet_stats_start_copy_compat()
68 d->skb = skb; in gnet_stats_start_copy_compat()
69 d->compat_tc_stats = tc_stats_type; in gnet_stats_start_copy_compat()
70 d->compat_xstats = xstats_type; in gnet_stats_start_copy_compat()
71 d->padattr = padattr; in gnet_stats_start_copy_compat()
73 d->lock = lock; in gnet_stats_start_copy_compat()
76 if (d->tail) { in gnet_stats_start_copy_compat()
77 int ret = gnet_stats_copy(d, type, NULL, 0, padattr); in gnet_stats_start_copy_compat()
85 if (ret == 0 && d->tail->nla_type == padattr) in gnet_stats_start_copy_compat()
86 d->tail = (struct nlattr *)((char *)d->tail + in gnet_stats_start_copy_compat()
87 NLA_ALIGN(d->tail->nla_len)); in gnet_stats_start_copy_compat()
111 struct gnet_dump *d, int padattr) in gnet_stats_start_copy() argument
113 return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d, padattr); in gnet_stats_start_copy()
211 ___gnet_stats_copy_basic(struct gnet_dump *d, in ___gnet_stats_copy_basic() argument
220 if (d->compat_tc_stats && type == TCA_STATS_BASIC) { in ___gnet_stats_copy_basic()
221 d->tc_stats.bytes = bstats_bytes; in ___gnet_stats_copy_basic()
222 d->tc_stats.packets = bstats_packets; in ___gnet_stats_copy_basic()
225 if (d->tail) { in ___gnet_stats_copy_basic()
232 res = gnet_stats_copy(d, type, &sb, sizeof(sb), TCA_STATS_PAD); in ___gnet_stats_copy_basic()
236 return gnet_stats_copy(d, TCA_STATS_PKT64, &bstats_packets, in ___gnet_stats_copy_basic()
260 gnet_stats_copy_basic(struct gnet_dump *d, in gnet_stats_copy_basic() argument
265 return ___gnet_stats_copy_basic(d, cpu, b, TCA_STATS_BASIC, running); in gnet_stats_copy_basic()
287 gnet_stats_copy_basic_hw(struct gnet_dump *d, in gnet_stats_copy_basic_hw() argument
292 return ___gnet_stats_copy_basic(d, cpu, b, TCA_STATS_BASIC_HW, running); in gnet_stats_copy_basic_hw()
308 gnet_stats_copy_rate_est(struct gnet_dump *d, in gnet_stats_copy_rate_est() argument
321 if (d->compat_tc_stats) { in gnet_stats_copy_rate_est()
322 d->tc_stats.bps = est.bps; in gnet_stats_copy_rate_est()
323 d->tc_stats.pps = est.pps; in gnet_stats_copy_rate_est()
326 if (d->tail) { in gnet_stats_copy_rate_est()
327 res = gnet_stats_copy(d, TCA_STATS_RATE_EST, &est, sizeof(est), in gnet_stats_copy_rate_est()
332 return gnet_stats_copy(d, TCA_STATS_RATE_EST64, &sample, in gnet_stats_copy_rate_est()
387 gnet_stats_copy_queue(struct gnet_dump *d, in gnet_stats_copy_queue() argument
396 if (d->compat_tc_stats) { in gnet_stats_copy_queue()
397 d->tc_stats.drops = qstats.drops; in gnet_stats_copy_queue()
398 d->tc_stats.qlen = qstats.qlen; in gnet_stats_copy_queue()
399 d->tc_stats.backlog = qstats.backlog; in gnet_stats_copy_queue()
400 d->tc_stats.overlimits = qstats.overlimits; in gnet_stats_copy_queue()
403 if (d->tail) in gnet_stats_copy_queue()
404 return gnet_stats_copy(d, TCA_STATS_QUEUE, in gnet_stats_copy_queue()
426 gnet_stats_copy_app(struct gnet_dump *d, void *st, int len) in gnet_stats_copy_app() argument
428 if (d->compat_xstats) { in gnet_stats_copy_app()
429 d->xstats = kmemdup(st, len, GFP_ATOMIC); in gnet_stats_copy_app()
430 if (!d->xstats) in gnet_stats_copy_app()
432 d->xstats_len = len; in gnet_stats_copy_app()
435 if (d->tail) in gnet_stats_copy_app()
436 return gnet_stats_copy(d, TCA_STATS_APP, st, len, in gnet_stats_copy_app()
442 if (d->lock) in gnet_stats_copy_app()
443 spin_unlock_bh(d->lock); in gnet_stats_copy_app()
444 d->xstats_len = 0; in gnet_stats_copy_app()
462 gnet_stats_finish_copy(struct gnet_dump *d) in gnet_stats_finish_copy() argument
464 if (d->tail) in gnet_stats_finish_copy()
465 d->tail->nla_len = skb_tail_pointer(d->skb) - (u8 *)d->tail; in gnet_stats_finish_copy()
467 if (d->compat_tc_stats) in gnet_stats_finish_copy()
468 if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, in gnet_stats_finish_copy()
469 sizeof(d->tc_stats), d->padattr) < 0) in gnet_stats_finish_copy()
472 if (d->compat_xstats && d->xstats) { in gnet_stats_finish_copy()
473 if (gnet_stats_copy(d, d->compat_xstats, d->xstats, in gnet_stats_finish_copy()
474 d->xstats_len, d->padattr) < 0) in gnet_stats_finish_copy()
478 if (d->lock) in gnet_stats_finish_copy()
479 spin_unlock_bh(d->lock); in gnet_stats_finish_copy()
480 kfree(d->xstats); in gnet_stats_finish_copy()
481 d->xstats = NULL; in gnet_stats_finish_copy()
482 d->xstats_len = 0; in gnet_stats_finish_copy()