Lines Matching +full:top +full:- +full:level
1 // SPDX-License-Identifier: GPL-2.0-or-later
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()
36 return -1; in gnet_stats_copy()
40 * gnet_stats_start_copy_compat - start dumping procedure in compatibility mode
42 * @type: TLV type for top level statistic TLV
56 * Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
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()
80 * preceded by a padding attribute, in which case d->tail will 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()
96 * gnet_stats_start_copy - start dumping procedure in compatibility mode
98 * @type: TLV type for top level statistic TLV
107 * Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
129 start = u64_stats_fetch_begin_irq(&bcpu->syncp); in __gnet_stats_copy_basic_cpu()
130 bytes = bcpu->bstats.bytes; in __gnet_stats_copy_basic_cpu()
131 packets = bcpu->bstats.packets; in __gnet_stats_copy_basic_cpu()
132 } while (u64_stats_fetch_retry_irq(&bcpu->syncp, start)); in __gnet_stats_copy_basic_cpu()
134 bstats->bytes += bytes; in __gnet_stats_copy_basic_cpu()
135 bstats->packets += packets; in __gnet_stats_copy_basic_cpu()
154 bstats->bytes = b->bytes; in __gnet_stats_copy_basic()
155 bstats->packets = b->packets; in __gnet_stats_copy_basic()
171 if (d->compat_tc_stats && type == TCA_STATS_BASIC) { in ___gnet_stats_copy_basic()
172 d->tc_stats.bytes = bstats.bytes; in ___gnet_stats_copy_basic()
173 d->tc_stats.packets = bstats.packets; in ___gnet_stats_copy_basic()
176 if (d->tail) { in ___gnet_stats_copy_basic()
194 * gnet_stats_copy_basic - copy basic statistics into statistic TLV
200 * Appends the basic statistics to the top level TLV created by
203 * Returns 0 on success or -1 with the statistic lock released
218 * gnet_stats_copy_basic_hw - copy basic hw statistics into statistic TLV
224 * Appends the basic statistics to the top level TLV created by
227 * Returns 0 on success or -1 with the statistic lock released
242 * gnet_stats_copy_rate_est - copy rate estimator statistics into statistics TLV
246 * Appends the rate estimator statistics to the top level TLV created by
249 * Returns 0 on success or -1 with the statistic lock released
266 if (d->compat_tc_stats) { in gnet_stats_copy_rate_est()
267 d->tc_stats.bps = est.bps; in gnet_stats_copy_rate_est()
268 d->tc_stats.pps = est.pps; in gnet_stats_copy_rate_est()
271 if (d->tail) { in gnet_stats_copy_rate_est()
294 qstats->qlen = 0; in __gnet_stats_copy_queue_cpu()
295 qstats->backlog += qcpu->backlog; in __gnet_stats_copy_queue_cpu()
296 qstats->drops += qcpu->drops; in __gnet_stats_copy_queue_cpu()
297 qstats->requeues += qcpu->requeues; in __gnet_stats_copy_queue_cpu()
298 qstats->overlimits += qcpu->overlimits; in __gnet_stats_copy_queue_cpu()
310 qstats->qlen = q->qlen; in __gnet_stats_copy_queue()
311 qstats->backlog = q->backlog; in __gnet_stats_copy_queue()
312 qstats->drops = q->drops; in __gnet_stats_copy_queue()
313 qstats->requeues = q->requeues; in __gnet_stats_copy_queue()
314 qstats->overlimits = q->overlimits; in __gnet_stats_copy_queue()
317 qstats->qlen = qlen; in __gnet_stats_copy_queue()
322 * gnet_stats_copy_queue - copy queue statistics into statistics TLV
328 * Appends the queue statistics to the top level TLV created by
332 * Returns 0 on success or -1 with the statistic lock released
344 if (d->compat_tc_stats) { in gnet_stats_copy_queue()
345 d->tc_stats.drops = qstats.drops; in gnet_stats_copy_queue()
346 d->tc_stats.qlen = qstats.qlen; in gnet_stats_copy_queue()
347 d->tc_stats.backlog = qstats.backlog; in gnet_stats_copy_queue()
348 d->tc_stats.overlimits = qstats.overlimits; in gnet_stats_copy_queue()
351 if (d->tail) in gnet_stats_copy_queue()
361 * gnet_stats_copy_app - copy application specific statistics into statistics TLV
366 * Appends the application specific statistics to the top level TLV created by
370 * Returns 0 on success or -1 with the statistic lock released
376 if (d->compat_xstats) { in gnet_stats_copy_app()
377 d->xstats = kmemdup(st, len, GFP_ATOMIC); in gnet_stats_copy_app()
378 if (!d->xstats) in gnet_stats_copy_app()
380 d->xstats_len = len; in gnet_stats_copy_app()
383 if (d->tail) in gnet_stats_copy_app()
390 if (d->lock) in gnet_stats_copy_app()
391 spin_unlock_bh(d->lock); in gnet_stats_copy_app()
392 d->xstats_len = 0; in gnet_stats_copy_app()
393 return -1; in gnet_stats_copy_app()
398 * gnet_stats_finish_copy - finish dumping procedure
401 * Corrects the length of the top level TLV to include all TLVs added
406 * Returns 0 on success or -1 with the statistic lock released
412 if (d->tail) in gnet_stats_finish_copy()
413 d->tail->nla_len = skb_tail_pointer(d->skb) - (u8 *)d->tail; in gnet_stats_finish_copy()
415 if (d->compat_tc_stats) in gnet_stats_finish_copy()
416 if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, in gnet_stats_finish_copy()
417 sizeof(d->tc_stats), d->padattr) < 0) in gnet_stats_finish_copy()
418 return -1; in gnet_stats_finish_copy()
420 if (d->compat_xstats && d->xstats) { in gnet_stats_finish_copy()
421 if (gnet_stats_copy(d, d->compat_xstats, d->xstats, in gnet_stats_finish_copy()
422 d->xstats_len, d->padattr) < 0) in gnet_stats_finish_copy()
423 return -1; in gnet_stats_finish_copy()
426 if (d->lock) in gnet_stats_finish_copy()
427 spin_unlock_bh(d->lock); in gnet_stats_finish_copy()
428 kfree(d->xstats); in gnet_stats_finish_copy()
429 d->xstats = NULL; in gnet_stats_finish_copy()
430 d->xstats_len = 0; in gnet_stats_finish_copy()