]>
Commit | Line | Data |
---|---|---|
d4576a7b JB |
1 | --- linux-4.15/include/uapi/linux/pkt_sched.h.orig 2018-02-02 18:40:34.642685783 +0100 |
2 | +++ linux-4.15/include/uapi/linux/pkt_sched.h 2018-02-02 18:46:35.879348325 +0100 | |
3 | @@ -26,6 +26,11 @@ | |
0c49a87a | 4 | |
963876a8 JB |
5 | #define TC_PRIO_MAX 15 |
6 | ||
7 | +#ifndef __KERNEL__ | |
0c49a87a | 8 | +#include <sys/time.h> |
963876a8 | 9 | +#endif |
0c49a87a | 10 | +#include <linux/if_ether.h> |
963876a8 JB |
11 | + |
12 | /* Generic queue statistics, available for all the elements. | |
13 | Particular schedulers may have also their private records. | |
14 | */ | |
d4576a7b JB |
15 | @@ -959,4 +964,96 @@ |
16 | ||
25e33390 | 17 | #define TCA_ETS_MAX (__TCA_ETS_MAX - 1) |
d4576a7b | 18 | |
22250af1 PS |
19 | +/* WRR section */ |
20 | + | |
963876a8 JB |
21 | +/* |
22 | + * A sub weight and of a class | |
23 | + * All numbers are represented as parts of (2^64-1). | |
24 | + */ | |
22250af1 | 25 | +struct tc_wrr_class_weight { |
963876a8 JB |
26 | + __u64 val; // Current value (0 is not valid) |
27 | + __u64 decr; // Value pr bytes (2^64-1 is not valid) | |
28 | + __u64 incr; // Value pr seconds (2^64-1 is not valid) | |
29 | + __u64 min; // Minimal value (0 is not valid) | |
30 | + __u64 max; // Minimal value (0 is not valid) | |
31 | + time_t tim; // The time where the above information was correct | |
22250af1 PS |
32 | +}; |
33 | + | |
963876a8 | 34 | +/* Packet send when modifying a class */ |
22250af1 | 35 | +struct tc_wrr_class_modf { |
963876a8 JB |
36 | + /* Not-valid values are ignored */ |
37 | + struct tc_wrr_class_weight weight1; | |
38 | + struct tc_wrr_class_weight weight2; | |
22250af1 PS |
39 | +}; |
40 | + | |
963876a8 | 41 | +/* Packet returned when quering a class */ |
22250af1 | 42 | +struct tc_wrr_class_stats { |
963876a8 JB |
43 | + char used; /* If this is false the information below is invalid */ |
44 | + struct tc_wrr_class_modf class_modf; | |
45 | + unsigned char addr[ETH_ALEN]; | |
46 | + char usemac; /* True if addr is a MAC address, else it is an IP address | |
47 | + (this value is only for convience, it is always the same | |
48 | + value as in the qdisc) */ | |
49 | + int heappos; /* Current heap position or 0 if not in heap */ | |
50 | + __u64 penal_ls; /* Penalty value in heap (ls) */ | |
51 | + __u64 penal_ms; /* Penalty value in heap (ms) */ | |
22250af1 PS |
52 | +}; |
53 | + | |
963876a8 | 54 | +/* Qdisc-wide penalty information (boolean values - 2 not valid) */ |
22250af1 | 55 | +struct tc_wrr_qdisc_weight { |
963876a8 JB |
56 | + signed char weight_mode; /* 0=No automatic change to weight |
57 | + 1=Decrease normally | |
58 | + 2=Also multiply with number of machines | |
59 | + 3=Instead multiply with priority divided | |
60 | + with priority of the other. | |
61 | + -1=no change */ | |
22250af1 PS |
62 | +}; |
63 | + | |
963876a8 | 64 | +/* Packet send when modifing a qdisc */ |
22250af1 | 65 | +struct tc_wrr_qdisc_modf { |
963876a8 JB |
66 | + /* Not-valid values are ignored */ |
67 | + struct tc_wrr_qdisc_weight weight1; | |
68 | + struct tc_wrr_qdisc_weight weight2; | |
22250af1 PS |
69 | +}; |
70 | + | |
963876a8 | 71 | +/* Packet send when creating a qdisc */ |
22250af1 | 72 | +struct tc_wrr_qdisc_crt { |
963876a8 JB |
73 | + struct tc_wrr_qdisc_modf qdisc_modf; |
74 | + char srcaddr; /* 1=lookup source, 0=lookup destination */ | |
75 | + char usemac; /* 1=Classify on MAC addresses, 0=classify on IP */ | |
76 | + char usemasq; /* 1=Classify based on masqgrading - only valid | |
77 | + if usemac is zero */ | |
78 | + int bands_max; /* Maximal number of bands (i.e.: classes) */ | |
79 | + int proxy_maxconn; /* If differnt from 0 then we support proxy remapping | |
80 | + of packets. And this is the number of maximal | |
81 | + concurrent proxy connections. */ | |
22250af1 PS |
82 | +}; |
83 | + | |
963876a8 | 84 | +/* Packet returned when quering a qdisc */ |
22250af1 | 85 | +struct tc_wrr_qdisc_stats { |
963876a8 JB |
86 | + struct tc_wrr_qdisc_crt qdisc_crt; |
87 | + int proxy_curconn; | |
88 | + int nodes_in_heap; /* Current number of bands wanting to send something */ | |
89 | + int bands_cur; /* Current number of bands used (i.e.: MAC/IP addresses seen) */ | |
90 | + int bands_reused; /* Number of times this band has been reused. */ | |
91 | + int packets_requed; /* Number of times packets have been requeued. */ | |
92 | + __u64 priosum; /* Sum of priorities in heap where 1 is 2^32 */ | |
22250af1 PS |
93 | +}; |
94 | + | |
95 | +struct tc_wrr_qdisc_modf_std { | |
963876a8 JB |
96 | + char proxy; /* This indicates which of the tc_wrr_qdisc_modf structers this is. 0=This struct */ |
97 | + char change_class; /* Should we also change a class? */ | |
98 | + struct tc_wrr_qdisc_modf qdisc_modf; /* Only valid if change_class is false */ | |
99 | + unsigned char addr[ETH_ALEN]; /* Class to change (non-used bytes should be 0). Valid only of change_class is true */ | |
100 | + struct tc_wrr_class_modf class_modf; /* The change */ | |
22250af1 PS |
101 | +}; |
102 | + | |
963876a8 | 103 | +/* Used for proxyremapping */ |
22250af1 | 104 | +struct tc_wrr_qdisc_modf_proxy { |
963876a8 JB |
105 | + char proxy; /* This indicates which of the tc_wrr_qdisc_modf structers this is. 1=This struct */ |
106 | + char reset; /* This is 1 if the proxyremap information should be reset */ | |
107 | + int changec; /* changec is the number of elements in changes. */ | |
108 | + long changes[0]; /* This is an array of type ProxyRemapBlock */ | |
22250af1 PS |
109 | +}; |
110 | + | |
b4f81b20 | 111 | #endif |