Debian Codegraph @

src/network/tc/cake.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later
2 * Copyright © 2020 VMware, Inc. */
3 #pragma once
4
5 #include <linux/pkt_sched.h>
6
7 #include "qdisc.h"
8
9 typedef enum CakeCompensationMode {
10 CAKE_COMPENSATION_MODE_NONE = CAKE_ATM_NONE,
11 CAKE_COMPENSATION_MODE_ATM = CAKE_ATM_ATM,
12 CAKE_COMPENSATION_MODE_PTM = CAKE_ATM_PTM,
13 _CAKE_COMPENSATION_MODE_MAX,
14 _CAKE_COMPENSATION_MODE_INVALID = -EINVAL,
15 } CakeCompensationMode;
16
17 typedef enum CakeFlowIsolationMode {
18 CAKE_FLOW_ISOLATION_MODE_NONE = CAKE_FLOW_NONE,
19 CAKE_FLOW_ISOLATION_MODE_SRC_IP = CAKE_FLOW_SRC_IP,
20 CAKE_FLOW_ISOLATION_MODE_DST_IP = CAKE_FLOW_DST_IP,
21 CAKE_FLOW_ISOLATION_MODE_HOSTS = CAKE_FLOW_HOSTS,
22 CAKE_FLOW_ISOLATION_MODE_FLOWS = CAKE_FLOW_FLOWS,
23 CAKE_FLOW_ISOLATION_MODE_DUAL_SRC = CAKE_FLOW_DUAL_SRC,
24 CAKE_FLOW_ISOLATION_MODE_DUAL_DST = CAKE_FLOW_DUAL_DST,
25 CAKE_FLOW_ISOLATION_MODE_TRIPLE = CAKE_FLOW_TRIPLE,
26 _CAKE_FLOW_ISOLATION_MODE_MAX,
27 _CAKE_FLOW_ISOLATION_MODE_INVALID = -EINVAL,
28 } CakeFlowIsolationMode;
29
30 typedef enum CakePriorityQueueingPreset {
31 CAKE_PRESET_DIFFSERV3 = CAKE_DIFFSERV_DIFFSERV3,
32 CAKE_PRESET_DIFFSERV4 = CAKE_DIFFSERV_DIFFSERV4,
33 CAKE_PRESET_DIFFSERV8 = CAKE_DIFFSERV_DIFFSERV8,
34 CAKE_PRESET_BESTEFFORT = CAKE_DIFFSERV_BESTEFFORT,
35 CAKE_PRESET_PRECEDENCE = CAKE_DIFFSERV_PRECEDENCE,
36 _CAKE_PRESET_MAX,
37 _CAKE_PRESET_INVALID = -EINVAL,
38 } CakePriorityQueueingPreset;
39
40 typedef enum CakeAckFilter {
41 CAKE_ACK_FILTER_NO = CAKE_ACK_NONE,
42 CAKE_ACK_FILTER_YES = CAKE_ACK_FILTER,
43 CAKE_ACK_FILTER_AGGRESSIVE = CAKE_ACK_AGGRESSIVE,
44 _CAKE_ACK_FILTER_MAX,
45 _CAKE_ACK_FILTER_INVALID = -EINVAL,
46 } CakeAckFilter;
47
48 typedef struct CommonApplicationsKeptEnhanced {
49 QDisc meta;
50
51 /* Shaper parameters */
52 int autorate;
53 uint64_t bandwidth;
54
55 /* Overhead compensation parameters */
56 bool overhead_set;
57 int overhead;
58 uint32_t mpu;
59 CakeCompensationMode compensation_mode;
60 int raw;
61
62 /* Flow isolation parameters */
63 CakeFlowIsolationMode flow_isolation_mode;
64 int nat;
65
66 /* Priority queue parameters */
67 CakePriorityQueueingPreset preset;
68 uint32_t fwmark;
69
70 /* Other parameters */
71 int wash;
72 int split_gso;
73 usec_t rtt;
74 CakeAckFilter ack_filter;
75 } CommonApplicationsKeptEnhanced;
76
77 DEFINE_QDISC_CAST(CAKE, CommonApplicationsKeptEnhanced);
78 extern const QDiscVTable cake_vtable;
79
80 CONFIG_PARSER_PROTOTYPE(config_parse_cake_bandwidth);
81 CONFIG_PARSER_PROTOTYPE(config_parse_cake_overhead);
82 CONFIG_PARSER_PROTOTYPE(config_parse_cake_mpu);
83 CONFIG_PARSER_PROTOTYPE(config_parse_cake_tristate);
84 CONFIG_PARSER_PROTOTYPE(config_parse_cake_compensation_mode);
85 CONFIG_PARSER_PROTOTYPE(config_parse_cake_flow_isolation_mode);
86 CONFIG_PARSER_PROTOTYPE(config_parse_cake_priority_queueing_preset);
87 CONFIG_PARSER_PROTOTYPE(config_parse_cake_fwmark);
88 CONFIG_PARSER_PROTOTYPE(config_parse_cake_rtt);
89 CONFIG_PARSER_PROTOTYPE(config_parse_cake_ack_filter);