summaryrefslogtreecommitdiffstats
path: root/src/network/tc/cake.h
blob: ff68cedabf4e3f5cded8d04a25757dfc0253e02d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* SPDX-License-Identifier: LGPL-2.1-or-later
 * Copyright © 2020 VMware, Inc. */
#pragma once

#include <linux/pkt_sched.h>

#include "conf-parser.h"
#include "qdisc.h"

typedef enum CakeCompensationMode {
        CAKE_COMPENSATION_MODE_NONE = CAKE_ATM_NONE,
        CAKE_COMPENSATION_MODE_ATM  = CAKE_ATM_ATM,
        CAKE_COMPENSATION_MODE_PTM  = CAKE_ATM_PTM,
        _CAKE_COMPENSATION_MODE_MAX,
        _CAKE_COMPENSATION_MODE_INVALID = -EINVAL,
} CakeCompensationMode;

typedef enum CakeFlowIsolationMode {
        CAKE_FLOW_ISOLATION_MODE_NONE     = CAKE_FLOW_NONE,
        CAKE_FLOW_ISOLATION_MODE_SRC_IP   = CAKE_FLOW_SRC_IP,
        CAKE_FLOW_ISOLATION_MODE_DST_IP   = CAKE_FLOW_DST_IP,
        CAKE_FLOW_ISOLATION_MODE_HOSTS    = CAKE_FLOW_HOSTS,
        CAKE_FLOW_ISOLATION_MODE_FLOWS    = CAKE_FLOW_FLOWS,
        CAKE_FLOW_ISOLATION_MODE_DUAL_SRC = CAKE_FLOW_DUAL_SRC,
        CAKE_FLOW_ISOLATION_MODE_DUAL_DST = CAKE_FLOW_DUAL_DST,
        CAKE_FLOW_ISOLATION_MODE_TRIPLE   = CAKE_FLOW_TRIPLE,
        _CAKE_FLOW_ISOLATION_MODE_MAX,
        _CAKE_FLOW_ISOLATION_MODE_INVALID = -EINVAL,
} CakeFlowIsolationMode;

typedef enum CakePriorityQueueingPreset {
        CAKE_PRESET_DIFFSERV3  = CAKE_DIFFSERV_DIFFSERV3,
        CAKE_PRESET_DIFFSERV4  = CAKE_DIFFSERV_DIFFSERV4,
        CAKE_PRESET_DIFFSERV8  = CAKE_DIFFSERV_DIFFSERV8,
        CAKE_PRESET_BESTEFFORT = CAKE_DIFFSERV_BESTEFFORT,
        CAKE_PRESET_PRECEDENCE = CAKE_DIFFSERV_PRECEDENCE,
        _CAKE_PRESET_MAX,
        _CAKE_PRESET_INVALID = -EINVAL,
} CakePriorityQueueingPreset;

typedef struct CommonApplicationsKeptEnhanced {
        QDisc meta;

        /* Shaper parameters */
        int autorate;
        uint64_t bandwidth;

        /* Overhead compensation parameters */
        bool overhead_set;
        int overhead;
        uint32_t mpu;
        CakeCompensationMode compensation_mode;
        int raw;

        /* Flow isolation parameters */
        CakeFlowIsolationMode flow_isolation_mode;
        int nat;

        /* Priority queue parameters */
        CakePriorityQueueingPreset preset;
        uint32_t fwmark;

        /* Other parameters */
        int wash;
        int split_gso;

} CommonApplicationsKeptEnhanced;

DEFINE_QDISC_CAST(CAKE, CommonApplicationsKeptEnhanced);
extern const QDiscVTable cake_vtable;

CONFIG_PARSER_PROTOTYPE(config_parse_cake_bandwidth);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_overhead);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_mpu);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_tristate);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_compensation_mode);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_flow_isolation_mode);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_priority_queueing_preset);
CONFIG_PARSER_PROTOTYPE(config_parse_cake_fwmark);