1/* $OpenBSD: fq_codel.h,v 1.4 2020/06/18 23:29:59 dlg Exp $ */
2
3/*
4 * Copyright (c) 2017 Mike Belopuhov
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef _NET_FQ_CODEL_H_
20#define _NET_FQ_CODEL_H_
21
22/* compatible with hfsc_pktcntr */
23struct fqcodel_pktcntr {
24 uint64_t packets;
25 uint64_t bytes;
26};
27
28struct fqcodel_stats {
29 struct fqcodel_pktcntr xmit_cnt;
30 struct fqcodel_pktcntr drop_cnt;
31
32 uint32_t qlength;
33 uint32_t qlimit;
34
35 uint32_t flows;
36 uint32_t _unused; /* padding */
37
38 uint32_t target;
39 uint32_t interval;
40
41 /* the values below are used to calculate standard deviation */
42 uint64_t delaysum; /* sum of delays, us */
43 uint64_t delaysumsq;/* sum of squared delays, us */
44};
45
46#ifdef _KERNEL
47extern const struct ifq_ops * const ifq_fqcodel_ops;
48extern const struct pfq_ops * const pfq_fqcodel_ops;
49#endif /* _KERNEL */
50
51#endif /* _NET_FQ_CODEL_H_ */