Repository navigation
Expand file tree
/
Copy pathlinux-libc-headers-wrr.patch
More file actions
111 lines (108 loc) · 4.11 KB
/
Copy pathlinux-libc-headers-wrr.patch
File metadata and controls
111 lines (108 loc) · 4.11 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
--- linux-4.15/include/uapi/linux/pkt_sched.h.orig 2018-02-02 18:40:34.642685783 +0100
+++ linux-4.15/include/uapi/linux/pkt_sched.h 2018-02-02 18:46:35.879348325 +0100
@@ -26,6 +26,11 @@
#define TC_PRIO_MAX 15
+#ifndef __KERNEL__
+#include <sys/time.h>
+#endif
+#include <linux/if_ether.h>
+
/* Generic queue statistics, available for all the elements.
Particular schedulers may have also their private records.
*/
@@ -959,4 +964,96 @@
__u32 memory_limit; /* Memory limit of both queues */
};
+/* WRR section */
+
+/*
+ * A sub weight and of a class
+ * All numbers are represented as parts of (2^64-1).
+ */
+struct tc_wrr_class_weight {
+ __u64 val; // Current value (0 is not valid)
+ __u64 decr; // Value pr bytes (2^64-1 is not valid)
+ __u64 incr; // Value pr seconds (2^64-1 is not valid)
+ __u64 min; // Minimal value (0 is not valid)
+ __u64 max; // Minimal value (0 is not valid)
+ time_t tim; // The time where the above information was correct
+};
+
+/* Packet send when modifying a class */
+struct tc_wrr_class_modf {
+ /* Not-valid values are ignored */
+ struct tc_wrr_class_weight weight1;
+ struct tc_wrr_class_weight weight2;
+};
+
+/* Packet returned when quering a class */
+struct tc_wrr_class_stats {
+ char used; /* If this is false the information below is invalid */
+ struct tc_wrr_class_modf class_modf;
+ unsigned char addr[ETH_ALEN];
+ char usemac; /* True if addr is a MAC address, else it is an IP address
+ (this value is only for convience, it is always the same
+ value as in the qdisc) */
+ int heappos; /* Current heap position or 0 if not in heap */
+ __u64 penal_ls; /* Penalty value in heap (ls) */
+ __u64 penal_ms; /* Penalty value in heap (ms) */
+};
+
+/* Qdisc-wide penalty information (boolean values - 2 not valid) */
+struct tc_wrr_qdisc_weight {
+ signed char weight_mode; /* 0=No automatic change to weight
+ 1=Decrease normally
+ 2=Also multiply with number of machines
+ 3=Instead multiply with priority divided
+ with priority of the other.
+ -1=no change */
+};
+
+/* Packet send when modifing a qdisc */
+struct tc_wrr_qdisc_modf {
+ /* Not-valid values are ignored */
+ struct tc_wrr_qdisc_weight weight1;
+ struct tc_wrr_qdisc_weight weight2;
+};
+
+/* Packet send when creating a qdisc */
+struct tc_wrr_qdisc_crt {
+ struct tc_wrr_qdisc_modf qdisc_modf;
+ char srcaddr; /* 1=lookup source, 0=lookup destination */
+ char usemac; /* 1=Classify on MAC addresses, 0=classify on IP */
+ char usemasq; /* 1=Classify based on masqgrading - only valid
+ if usemac is zero */
+ int bands_max; /* Maximal number of bands (i.e.: classes) */
+ int proxy_maxconn; /* If differnt from 0 then we support proxy remapping
+ of packets. And this is the number of maximal
+ concurrent proxy connections. */
+};
+
+/* Packet returned when quering a qdisc */
+struct tc_wrr_qdisc_stats {
+ struct tc_wrr_qdisc_crt qdisc_crt;
+ int proxy_curconn;
+ int nodes_in_heap; /* Current number of bands wanting to send something */
+ int bands_cur; /* Current number of bands used (i.e.: MAC/IP addresses seen) */
+ int bands_reused; /* Number of times this band has been reused. */
+ int packets_requed; /* Number of times packets have been requeued. */
+ __u64 priosum; /* Sum of priorities in heap where 1 is 2^32 */
+};
+
+struct tc_wrr_qdisc_modf_std {
+ char proxy; /* This indicates which of the tc_wrr_qdisc_modf structers this is. 0=This struct */
+ char change_class; /* Should we also change a class? */
+ struct tc_wrr_qdisc_modf qdisc_modf; /* Only valid if change_class is false */
+ unsigned char addr[ETH_ALEN]; /* Class to change (non-used bytes should be 0). Valid only of change_class is true */
+ struct tc_wrr_class_modf class_modf; /* The change */
+};
+
+/* Used for proxyremapping */
+struct tc_wrr_qdisc_modf_proxy {
+ char proxy; /* This indicates which of the tc_wrr_qdisc_modf structers this is. 1=This struct */
+ char reset; /* This is 1 if the proxyremap information should be reset */
+ int changec; /* changec is the number of elements in changes. */
+ long changes[0]; /* This is an array of type ProxyRemapBlock */
+};
+
#endif