1*f7c14bbaSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*f7c14bbaSAndroid Build Coastguard Worker #ifndef __LINUX_PKT_SCHED_H 3*f7c14bbaSAndroid Build Coastguard Worker #define __LINUX_PKT_SCHED_H 4*f7c14bbaSAndroid Build Coastguard Worker 5*f7c14bbaSAndroid Build Coastguard Worker #include <linux/types.h> 6*f7c14bbaSAndroid Build Coastguard Worker 7*f7c14bbaSAndroid Build Coastguard Worker /* Logical priority bands not depending on specific packet scheduler. 8*f7c14bbaSAndroid Build Coastguard Worker Every scheduler will map them to real traffic classes, if it has 9*f7c14bbaSAndroid Build Coastguard Worker no more precise mechanism to classify packets. 10*f7c14bbaSAndroid Build Coastguard Worker 11*f7c14bbaSAndroid Build Coastguard Worker These numbers have no special meaning, though their coincidence 12*f7c14bbaSAndroid Build Coastguard Worker with obsolete IPv6 values is not occasional :-). New IPv6 drafts 13*f7c14bbaSAndroid Build Coastguard Worker preferred full anarchy inspired by diffserv group. 14*f7c14bbaSAndroid Build Coastguard Worker 15*f7c14bbaSAndroid Build Coastguard Worker Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy 16*f7c14bbaSAndroid Build Coastguard Worker class, actually, as rule it will be handled with more care than 17*f7c14bbaSAndroid Build Coastguard Worker filler or even bulk. 18*f7c14bbaSAndroid Build Coastguard Worker */ 19*f7c14bbaSAndroid Build Coastguard Worker 20*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_BESTEFFORT 0 21*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_FILLER 1 22*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_BULK 2 23*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_INTERACTIVE_BULK 4 24*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_INTERACTIVE 6 25*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_CONTROL 7 26*f7c14bbaSAndroid Build Coastguard Worker 27*f7c14bbaSAndroid Build Coastguard Worker #define TC_PRIO_MAX 15 28*f7c14bbaSAndroid Build Coastguard Worker 29*f7c14bbaSAndroid Build Coastguard Worker /* Generic queue statistics, available for all the elements. 30*f7c14bbaSAndroid Build Coastguard Worker Particular schedulers may have also their private records. 31*f7c14bbaSAndroid Build Coastguard Worker */ 32*f7c14bbaSAndroid Build Coastguard Worker 33*f7c14bbaSAndroid Build Coastguard Worker struct tc_stats { 34*f7c14bbaSAndroid Build Coastguard Worker __u64 bytes; /* Number of enqueued bytes */ 35*f7c14bbaSAndroid Build Coastguard Worker __u32 packets; /* Number of enqueued packets */ 36*f7c14bbaSAndroid Build Coastguard Worker __u32 drops; /* Packets dropped because of lack of resources */ 37*f7c14bbaSAndroid Build Coastguard Worker __u32 overlimits; /* Number of throttle events when this 38*f7c14bbaSAndroid Build Coastguard Worker * flow goes out of allocated bandwidth */ 39*f7c14bbaSAndroid Build Coastguard Worker __u32 bps; /* Current flow byte rate */ 40*f7c14bbaSAndroid Build Coastguard Worker __u32 pps; /* Current flow packet rate */ 41*f7c14bbaSAndroid Build Coastguard Worker __u32 qlen; 42*f7c14bbaSAndroid Build Coastguard Worker __u32 backlog; 43*f7c14bbaSAndroid Build Coastguard Worker }; 44*f7c14bbaSAndroid Build Coastguard Worker 45*f7c14bbaSAndroid Build Coastguard Worker struct tc_estimator { 46*f7c14bbaSAndroid Build Coastguard Worker signed char interval; 47*f7c14bbaSAndroid Build Coastguard Worker unsigned char ewma_log; 48*f7c14bbaSAndroid Build Coastguard Worker }; 49*f7c14bbaSAndroid Build Coastguard Worker 50*f7c14bbaSAndroid Build Coastguard Worker /* "Handles" 51*f7c14bbaSAndroid Build Coastguard Worker --------- 52*f7c14bbaSAndroid Build Coastguard Worker 53*f7c14bbaSAndroid Build Coastguard Worker All the traffic control objects have 32bit identifiers, or "handles". 54*f7c14bbaSAndroid Build Coastguard Worker 55*f7c14bbaSAndroid Build Coastguard Worker They can be considered as opaque numbers from user API viewpoint, 56*f7c14bbaSAndroid Build Coastguard Worker but actually they always consist of two fields: major and 57*f7c14bbaSAndroid Build Coastguard Worker minor numbers, which are interpreted by kernel specially, 58*f7c14bbaSAndroid Build Coastguard Worker that may be used by applications, though not recommended. 59*f7c14bbaSAndroid Build Coastguard Worker 60*f7c14bbaSAndroid Build Coastguard Worker F.e. qdisc handles always have minor number equal to zero, 61*f7c14bbaSAndroid Build Coastguard Worker classes (or flows) have major equal to parent qdisc major, and 62*f7c14bbaSAndroid Build Coastguard Worker minor uniquely identifying class inside qdisc. 63*f7c14bbaSAndroid Build Coastguard Worker 64*f7c14bbaSAndroid Build Coastguard Worker Macros to manipulate handles: 65*f7c14bbaSAndroid Build Coastguard Worker */ 66*f7c14bbaSAndroid Build Coastguard Worker 67*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MAJ_MASK (0xFFFF0000U) 68*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MIN_MASK (0x0000FFFFU) 69*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK) 70*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MIN(h) ((h)&TC_H_MIN_MASK) 71*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) 72*f7c14bbaSAndroid Build Coastguard Worker 73*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_UNSPEC (0U) 74*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_ROOT (0xFFFFFFFFU) 75*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_INGRESS (0xFFFFFFF1U) 76*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_CLSACT TC_H_INGRESS 77*f7c14bbaSAndroid Build Coastguard Worker 78*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MIN_PRIORITY 0xFFE0U 79*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MIN_INGRESS 0xFFF2U 80*f7c14bbaSAndroid Build Coastguard Worker #define TC_H_MIN_EGRESS 0xFFF3U 81*f7c14bbaSAndroid Build Coastguard Worker 82*f7c14bbaSAndroid Build Coastguard Worker /* Need to corrospond to iproute2 tc/tc_core.h "enum link_layer" */ 83*f7c14bbaSAndroid Build Coastguard Worker enum tc_link_layer { 84*f7c14bbaSAndroid Build Coastguard Worker TC_LINKLAYER_UNAWARE, /* Indicate unaware old iproute2 util */ 85*f7c14bbaSAndroid Build Coastguard Worker TC_LINKLAYER_ETHERNET, 86*f7c14bbaSAndroid Build Coastguard Worker TC_LINKLAYER_ATM, 87*f7c14bbaSAndroid Build Coastguard Worker }; 88*f7c14bbaSAndroid Build Coastguard Worker #define TC_LINKLAYER_MASK 0x0F /* limit use to lower 4 bits */ 89*f7c14bbaSAndroid Build Coastguard Worker 90*f7c14bbaSAndroid Build Coastguard Worker struct tc_ratespec { 91*f7c14bbaSAndroid Build Coastguard Worker unsigned char cell_log; 92*f7c14bbaSAndroid Build Coastguard Worker __u8 linklayer; /* lower 4 bits */ 93*f7c14bbaSAndroid Build Coastguard Worker unsigned short overhead; 94*f7c14bbaSAndroid Build Coastguard Worker short cell_align; 95*f7c14bbaSAndroid Build Coastguard Worker unsigned short mpu; 96*f7c14bbaSAndroid Build Coastguard Worker __u32 rate; 97*f7c14bbaSAndroid Build Coastguard Worker }; 98*f7c14bbaSAndroid Build Coastguard Worker 99*f7c14bbaSAndroid Build Coastguard Worker #define TC_RTAB_SIZE 1024 100*f7c14bbaSAndroid Build Coastguard Worker 101*f7c14bbaSAndroid Build Coastguard Worker struct tc_sizespec { 102*f7c14bbaSAndroid Build Coastguard Worker unsigned char cell_log; 103*f7c14bbaSAndroid Build Coastguard Worker unsigned char size_log; 104*f7c14bbaSAndroid Build Coastguard Worker short cell_align; 105*f7c14bbaSAndroid Build Coastguard Worker int overhead; 106*f7c14bbaSAndroid Build Coastguard Worker unsigned int linklayer; 107*f7c14bbaSAndroid Build Coastguard Worker unsigned int mpu; 108*f7c14bbaSAndroid Build Coastguard Worker unsigned int mtu; 109*f7c14bbaSAndroid Build Coastguard Worker unsigned int tsize; 110*f7c14bbaSAndroid Build Coastguard Worker }; 111*f7c14bbaSAndroid Build Coastguard Worker 112*f7c14bbaSAndroid Build Coastguard Worker enum { 113*f7c14bbaSAndroid Build Coastguard Worker TCA_STAB_UNSPEC, 114*f7c14bbaSAndroid Build Coastguard Worker TCA_STAB_BASE, 115*f7c14bbaSAndroid Build Coastguard Worker TCA_STAB_DATA, 116*f7c14bbaSAndroid Build Coastguard Worker __TCA_STAB_MAX 117*f7c14bbaSAndroid Build Coastguard Worker }; 118*f7c14bbaSAndroid Build Coastguard Worker 119*f7c14bbaSAndroid Build Coastguard Worker #define TCA_STAB_MAX (__TCA_STAB_MAX - 1) 120*f7c14bbaSAndroid Build Coastguard Worker 121*f7c14bbaSAndroid Build Coastguard Worker /* FIFO section */ 122*f7c14bbaSAndroid Build Coastguard Worker 123*f7c14bbaSAndroid Build Coastguard Worker struct tc_fifo_qopt { 124*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ 125*f7c14bbaSAndroid Build Coastguard Worker }; 126*f7c14bbaSAndroid Build Coastguard Worker 127*f7c14bbaSAndroid Build Coastguard Worker /* SKBPRIO section */ 128*f7c14bbaSAndroid Build Coastguard Worker 129*f7c14bbaSAndroid Build Coastguard Worker /* 130*f7c14bbaSAndroid Build Coastguard Worker * Priorities go from zero to (SKBPRIO_MAX_PRIORITY - 1). 131*f7c14bbaSAndroid Build Coastguard Worker * SKBPRIO_MAX_PRIORITY should be at least 64 in order for skbprio to be able 132*f7c14bbaSAndroid Build Coastguard Worker * to map one to one the DS field of IPV4 and IPV6 headers. 133*f7c14bbaSAndroid Build Coastguard Worker * Memory allocation grows linearly with SKBPRIO_MAX_PRIORITY. 134*f7c14bbaSAndroid Build Coastguard Worker */ 135*f7c14bbaSAndroid Build Coastguard Worker 136*f7c14bbaSAndroid Build Coastguard Worker #define SKBPRIO_MAX_PRIORITY 64 137*f7c14bbaSAndroid Build Coastguard Worker 138*f7c14bbaSAndroid Build Coastguard Worker struct tc_skbprio_qopt { 139*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* Queue length in packets. */ 140*f7c14bbaSAndroid Build Coastguard Worker }; 141*f7c14bbaSAndroid Build Coastguard Worker 142*f7c14bbaSAndroid Build Coastguard Worker /* PRIO section */ 143*f7c14bbaSAndroid Build Coastguard Worker 144*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_PRIO_BANDS 16 145*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_MIN_PRIO_BANDS 2 146*f7c14bbaSAndroid Build Coastguard Worker 147*f7c14bbaSAndroid Build Coastguard Worker struct tc_prio_qopt { 148*f7c14bbaSAndroid Build Coastguard Worker int bands; /* Number of bands */ 149*f7c14bbaSAndroid Build Coastguard Worker __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 150*f7c14bbaSAndroid Build Coastguard Worker }; 151*f7c14bbaSAndroid Build Coastguard Worker 152*f7c14bbaSAndroid Build Coastguard Worker /* MULTIQ section */ 153*f7c14bbaSAndroid Build Coastguard Worker 154*f7c14bbaSAndroid Build Coastguard Worker struct tc_multiq_qopt { 155*f7c14bbaSAndroid Build Coastguard Worker __u16 bands; /* Number of bands */ 156*f7c14bbaSAndroid Build Coastguard Worker __u16 max_bands; /* Maximum number of queues */ 157*f7c14bbaSAndroid Build Coastguard Worker }; 158*f7c14bbaSAndroid Build Coastguard Worker 159*f7c14bbaSAndroid Build Coastguard Worker /* PLUG section */ 160*f7c14bbaSAndroid Build Coastguard Worker 161*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_PLUG_BUFFER 0 162*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_PLUG_RELEASE_ONE 1 163*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_PLUG_RELEASE_INDEFINITE 2 164*f7c14bbaSAndroid Build Coastguard Worker #define TCQ_PLUG_LIMIT 3 165*f7c14bbaSAndroid Build Coastguard Worker 166*f7c14bbaSAndroid Build Coastguard Worker struct tc_plug_qopt { 167*f7c14bbaSAndroid Build Coastguard Worker /* TCQ_PLUG_BUFFER: Inset a plug into the queue and 168*f7c14bbaSAndroid Build Coastguard Worker * buffer any incoming packets 169*f7c14bbaSAndroid Build Coastguard Worker * TCQ_PLUG_RELEASE_ONE: Dequeue packets from queue head 170*f7c14bbaSAndroid Build Coastguard Worker * to beginning of the next plug. 171*f7c14bbaSAndroid Build Coastguard Worker * TCQ_PLUG_RELEASE_INDEFINITE: Dequeue all packets from queue. 172*f7c14bbaSAndroid Build Coastguard Worker * Stop buffering packets until the next TCQ_PLUG_BUFFER 173*f7c14bbaSAndroid Build Coastguard Worker * command is received (just act as a pass-thru queue). 174*f7c14bbaSAndroid Build Coastguard Worker * TCQ_PLUG_LIMIT: Increase/decrease queue size 175*f7c14bbaSAndroid Build Coastguard Worker */ 176*f7c14bbaSAndroid Build Coastguard Worker int action; 177*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; 178*f7c14bbaSAndroid Build Coastguard Worker }; 179*f7c14bbaSAndroid Build Coastguard Worker 180*f7c14bbaSAndroid Build Coastguard Worker /* TBF section */ 181*f7c14bbaSAndroid Build Coastguard Worker 182*f7c14bbaSAndroid Build Coastguard Worker struct tc_tbf_qopt { 183*f7c14bbaSAndroid Build Coastguard Worker struct tc_ratespec rate; 184*f7c14bbaSAndroid Build Coastguard Worker struct tc_ratespec peakrate; 185*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; 186*f7c14bbaSAndroid Build Coastguard Worker __u32 buffer; 187*f7c14bbaSAndroid Build Coastguard Worker __u32 mtu; 188*f7c14bbaSAndroid Build Coastguard Worker }; 189*f7c14bbaSAndroid Build Coastguard Worker 190*f7c14bbaSAndroid Build Coastguard Worker enum { 191*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_UNSPEC, 192*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_PARMS, 193*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_RTAB, 194*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_PTAB, 195*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_RATE64, 196*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_PRATE64, 197*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_BURST, 198*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_PBURST, 199*f7c14bbaSAndroid Build Coastguard Worker TCA_TBF_PAD, 200*f7c14bbaSAndroid Build Coastguard Worker __TCA_TBF_MAX, 201*f7c14bbaSAndroid Build Coastguard Worker }; 202*f7c14bbaSAndroid Build Coastguard Worker 203*f7c14bbaSAndroid Build Coastguard Worker #define TCA_TBF_MAX (__TCA_TBF_MAX - 1) 204*f7c14bbaSAndroid Build Coastguard Worker 205*f7c14bbaSAndroid Build Coastguard Worker 206*f7c14bbaSAndroid Build Coastguard Worker /* TEQL section */ 207*f7c14bbaSAndroid Build Coastguard Worker 208*f7c14bbaSAndroid Build Coastguard Worker /* TEQL does not require any parameters */ 209*f7c14bbaSAndroid Build Coastguard Worker 210*f7c14bbaSAndroid Build Coastguard Worker /* SFQ section */ 211*f7c14bbaSAndroid Build Coastguard Worker 212*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfq_qopt { 213*f7c14bbaSAndroid Build Coastguard Worker unsigned quantum; /* Bytes per round allocated to flow */ 214*f7c14bbaSAndroid Build Coastguard Worker int perturb_period; /* Period of hash perturbation */ 215*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* Maximal packets in queue */ 216*f7c14bbaSAndroid Build Coastguard Worker unsigned divisor; /* Hash divisor */ 217*f7c14bbaSAndroid Build Coastguard Worker unsigned flows; /* Maximal number of flows */ 218*f7c14bbaSAndroid Build Coastguard Worker }; 219*f7c14bbaSAndroid Build Coastguard Worker 220*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfqred_stats { 221*f7c14bbaSAndroid Build Coastguard Worker __u32 prob_drop; /* Early drops, below max threshold */ 222*f7c14bbaSAndroid Build Coastguard Worker __u32 forced_drop; /* Early drops, after max threshold */ 223*f7c14bbaSAndroid Build Coastguard Worker __u32 prob_mark; /* Marked packets, below max threshold */ 224*f7c14bbaSAndroid Build Coastguard Worker __u32 forced_mark; /* Marked packets, after max threshold */ 225*f7c14bbaSAndroid Build Coastguard Worker __u32 prob_mark_head; /* Marked packets, below max threshold */ 226*f7c14bbaSAndroid Build Coastguard Worker __u32 forced_mark_head;/* Marked packets, after max threshold */ 227*f7c14bbaSAndroid Build Coastguard Worker }; 228*f7c14bbaSAndroid Build Coastguard Worker 229*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfq_qopt_v1 { 230*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfq_qopt v0; 231*f7c14bbaSAndroid Build Coastguard Worker unsigned int depth; /* max number of packets per flow */ 232*f7c14bbaSAndroid Build Coastguard Worker unsigned int headdrop; 233*f7c14bbaSAndroid Build Coastguard Worker /* SFQRED parameters */ 234*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* HARD maximal flow queue length (bytes) */ 235*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_min; /* Min average length threshold (bytes) */ 236*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_max; /* Max average length threshold (bytes) */ 237*f7c14bbaSAndroid Build Coastguard Worker unsigned char Wlog; /* log(W) */ 238*f7c14bbaSAndroid Build Coastguard Worker unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 239*f7c14bbaSAndroid Build Coastguard Worker unsigned char Scell_log; /* cell size for idle damping */ 240*f7c14bbaSAndroid Build Coastguard Worker unsigned char flags; 241*f7c14bbaSAndroid Build Coastguard Worker __u32 max_P; /* probability, high resolution */ 242*f7c14bbaSAndroid Build Coastguard Worker /* SFQRED stats */ 243*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfqred_stats stats; 244*f7c14bbaSAndroid Build Coastguard Worker }; 245*f7c14bbaSAndroid Build Coastguard Worker 246*f7c14bbaSAndroid Build Coastguard Worker 247*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfq_xstats { 248*f7c14bbaSAndroid Build Coastguard Worker __s32 allot; 249*f7c14bbaSAndroid Build Coastguard Worker }; 250*f7c14bbaSAndroid Build Coastguard Worker 251*f7c14bbaSAndroid Build Coastguard Worker /* RED section */ 252*f7c14bbaSAndroid Build Coastguard Worker 253*f7c14bbaSAndroid Build Coastguard Worker enum { 254*f7c14bbaSAndroid Build Coastguard Worker TCA_RED_UNSPEC, 255*f7c14bbaSAndroid Build Coastguard Worker TCA_RED_PARMS, 256*f7c14bbaSAndroid Build Coastguard Worker TCA_RED_STAB, 257*f7c14bbaSAndroid Build Coastguard Worker TCA_RED_MAX_P, 258*f7c14bbaSAndroid Build Coastguard Worker __TCA_RED_MAX, 259*f7c14bbaSAndroid Build Coastguard Worker }; 260*f7c14bbaSAndroid Build Coastguard Worker 261*f7c14bbaSAndroid Build Coastguard Worker #define TCA_RED_MAX (__TCA_RED_MAX - 1) 262*f7c14bbaSAndroid Build Coastguard Worker 263*f7c14bbaSAndroid Build Coastguard Worker struct tc_red_qopt { 264*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* HARD maximal queue length (bytes) */ 265*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_min; /* Min average length threshold (bytes) */ 266*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_max; /* Max average length threshold (bytes) */ 267*f7c14bbaSAndroid Build Coastguard Worker unsigned char Wlog; /* log(W) */ 268*f7c14bbaSAndroid Build Coastguard Worker unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 269*f7c14bbaSAndroid Build Coastguard Worker unsigned char Scell_log; /* cell size for idle damping */ 270*f7c14bbaSAndroid Build Coastguard Worker unsigned char flags; 271*f7c14bbaSAndroid Build Coastguard Worker #define TC_RED_ECN 1 272*f7c14bbaSAndroid Build Coastguard Worker #define TC_RED_HARDDROP 2 273*f7c14bbaSAndroid Build Coastguard Worker #define TC_RED_ADAPTATIVE 4 274*f7c14bbaSAndroid Build Coastguard Worker }; 275*f7c14bbaSAndroid Build Coastguard Worker 276*f7c14bbaSAndroid Build Coastguard Worker struct tc_red_xstats { 277*f7c14bbaSAndroid Build Coastguard Worker __u32 early; /* Early drops */ 278*f7c14bbaSAndroid Build Coastguard Worker __u32 pdrop; /* Drops due to queue limits */ 279*f7c14bbaSAndroid Build Coastguard Worker __u32 other; /* Drops due to drop() calls */ 280*f7c14bbaSAndroid Build Coastguard Worker __u32 marked; /* Marked packets */ 281*f7c14bbaSAndroid Build Coastguard Worker }; 282*f7c14bbaSAndroid Build Coastguard Worker 283*f7c14bbaSAndroid Build Coastguard Worker /* GRED section */ 284*f7c14bbaSAndroid Build Coastguard Worker 285*f7c14bbaSAndroid Build Coastguard Worker #define MAX_DPs 16 286*f7c14bbaSAndroid Build Coastguard Worker 287*f7c14bbaSAndroid Build Coastguard Worker enum { 288*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_UNSPEC, 289*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_PARMS, 290*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_STAB, 291*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_DPS, 292*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_MAX_P, 293*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_LIMIT, 294*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_LIST, /* nested TCA_GRED_VQ_ENTRY */ 295*f7c14bbaSAndroid Build Coastguard Worker __TCA_GRED_MAX, 296*f7c14bbaSAndroid Build Coastguard Worker }; 297*f7c14bbaSAndroid Build Coastguard Worker 298*f7c14bbaSAndroid Build Coastguard Worker #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 299*f7c14bbaSAndroid Build Coastguard Worker 300*f7c14bbaSAndroid Build Coastguard Worker enum { 301*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_ENTRY_UNSPEC, 302*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_ENTRY, /* nested TCA_GRED_VQ_* */ 303*f7c14bbaSAndroid Build Coastguard Worker __TCA_GRED_VQ_ENTRY_MAX, 304*f7c14bbaSAndroid Build Coastguard Worker }; 305*f7c14bbaSAndroid Build Coastguard Worker #define TCA_GRED_VQ_ENTRY_MAX (__TCA_GRED_VQ_ENTRY_MAX - 1) 306*f7c14bbaSAndroid Build Coastguard Worker 307*f7c14bbaSAndroid Build Coastguard Worker enum { 308*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_UNSPEC, 309*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_PAD, 310*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_DP, /* u32 */ 311*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_BYTES, /* u64 */ 312*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_PACKETS, /* u32 */ 313*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_BACKLOG, /* u32 */ 314*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_PROB_DROP, /* u32 */ 315*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_PROB_MARK, /* u32 */ 316*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_FORCED_DROP, /* u32 */ 317*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_FORCED_MARK, /* u32 */ 318*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_PDROP, /* u32 */ 319*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_STAT_OTHER, /* u32 */ 320*f7c14bbaSAndroid Build Coastguard Worker TCA_GRED_VQ_FLAGS, /* u32 */ 321*f7c14bbaSAndroid Build Coastguard Worker __TCA_GRED_VQ_MAX 322*f7c14bbaSAndroid Build Coastguard Worker }; 323*f7c14bbaSAndroid Build Coastguard Worker 324*f7c14bbaSAndroid Build Coastguard Worker #define TCA_GRED_VQ_MAX (__TCA_GRED_VQ_MAX - 1) 325*f7c14bbaSAndroid Build Coastguard Worker 326*f7c14bbaSAndroid Build Coastguard Worker struct tc_gred_qopt { 327*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* HARD maximal queue length (bytes) */ 328*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_min; /* Min average length threshold (bytes) */ 329*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_max; /* Max average length threshold (bytes) */ 330*f7c14bbaSAndroid Build Coastguard Worker __u32 DP; /* up to 2^32 DPs */ 331*f7c14bbaSAndroid Build Coastguard Worker __u32 backlog; 332*f7c14bbaSAndroid Build Coastguard Worker __u32 qave; 333*f7c14bbaSAndroid Build Coastguard Worker __u32 forced; 334*f7c14bbaSAndroid Build Coastguard Worker __u32 early; 335*f7c14bbaSAndroid Build Coastguard Worker __u32 other; 336*f7c14bbaSAndroid Build Coastguard Worker __u32 pdrop; 337*f7c14bbaSAndroid Build Coastguard Worker __u8 Wlog; /* log(W) */ 338*f7c14bbaSAndroid Build Coastguard Worker __u8 Plog; /* log(P_max/(qth_max-qth_min)) */ 339*f7c14bbaSAndroid Build Coastguard Worker __u8 Scell_log; /* cell size for idle damping */ 340*f7c14bbaSAndroid Build Coastguard Worker __u8 prio; /* prio of this VQ */ 341*f7c14bbaSAndroid Build Coastguard Worker __u32 packets; 342*f7c14bbaSAndroid Build Coastguard Worker __u32 bytesin; 343*f7c14bbaSAndroid Build Coastguard Worker }; 344*f7c14bbaSAndroid Build Coastguard Worker 345*f7c14bbaSAndroid Build Coastguard Worker /* gred setup */ 346*f7c14bbaSAndroid Build Coastguard Worker struct tc_gred_sopt { 347*f7c14bbaSAndroid Build Coastguard Worker __u32 DPs; 348*f7c14bbaSAndroid Build Coastguard Worker __u32 def_DP; 349*f7c14bbaSAndroid Build Coastguard Worker __u8 grio; 350*f7c14bbaSAndroid Build Coastguard Worker __u8 flags; 351*f7c14bbaSAndroid Build Coastguard Worker __u16 pad1; 352*f7c14bbaSAndroid Build Coastguard Worker }; 353*f7c14bbaSAndroid Build Coastguard Worker 354*f7c14bbaSAndroid Build Coastguard Worker /* CHOKe section */ 355*f7c14bbaSAndroid Build Coastguard Worker 356*f7c14bbaSAndroid Build Coastguard Worker enum { 357*f7c14bbaSAndroid Build Coastguard Worker TCA_CHOKE_UNSPEC, 358*f7c14bbaSAndroid Build Coastguard Worker TCA_CHOKE_PARMS, 359*f7c14bbaSAndroid Build Coastguard Worker TCA_CHOKE_STAB, 360*f7c14bbaSAndroid Build Coastguard Worker TCA_CHOKE_MAX_P, 361*f7c14bbaSAndroid Build Coastguard Worker __TCA_CHOKE_MAX, 362*f7c14bbaSAndroid Build Coastguard Worker }; 363*f7c14bbaSAndroid Build Coastguard Worker 364*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CHOKE_MAX (__TCA_CHOKE_MAX - 1) 365*f7c14bbaSAndroid Build Coastguard Worker 366*f7c14bbaSAndroid Build Coastguard Worker struct tc_choke_qopt { 367*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* Hard queue length (packets) */ 368*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_min; /* Min average threshold (packets) */ 369*f7c14bbaSAndroid Build Coastguard Worker __u32 qth_max; /* Max average threshold (packets) */ 370*f7c14bbaSAndroid Build Coastguard Worker unsigned char Wlog; /* log(W) */ 371*f7c14bbaSAndroid Build Coastguard Worker unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 372*f7c14bbaSAndroid Build Coastguard Worker unsigned char Scell_log; /* cell size for idle damping */ 373*f7c14bbaSAndroid Build Coastguard Worker unsigned char flags; /* see RED flags */ 374*f7c14bbaSAndroid Build Coastguard Worker }; 375*f7c14bbaSAndroid Build Coastguard Worker 376*f7c14bbaSAndroid Build Coastguard Worker struct tc_choke_xstats { 377*f7c14bbaSAndroid Build Coastguard Worker __u32 early; /* Early drops */ 378*f7c14bbaSAndroid Build Coastguard Worker __u32 pdrop; /* Drops due to queue limits */ 379*f7c14bbaSAndroid Build Coastguard Worker __u32 other; /* Drops due to drop() calls */ 380*f7c14bbaSAndroid Build Coastguard Worker __u32 marked; /* Marked packets */ 381*f7c14bbaSAndroid Build Coastguard Worker __u32 matched; /* Drops due to flow match */ 382*f7c14bbaSAndroid Build Coastguard Worker }; 383*f7c14bbaSAndroid Build Coastguard Worker 384*f7c14bbaSAndroid Build Coastguard Worker /* HTB section */ 385*f7c14bbaSAndroid Build Coastguard Worker #define TC_HTB_NUMPRIO 8 386*f7c14bbaSAndroid Build Coastguard Worker #define TC_HTB_MAXDEPTH 8 387*f7c14bbaSAndroid Build Coastguard Worker #define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ 388*f7c14bbaSAndroid Build Coastguard Worker 389*f7c14bbaSAndroid Build Coastguard Worker struct tc_htb_opt { 390*f7c14bbaSAndroid Build Coastguard Worker struct tc_ratespec rate; 391*f7c14bbaSAndroid Build Coastguard Worker struct tc_ratespec ceil; 392*f7c14bbaSAndroid Build Coastguard Worker __u32 buffer; 393*f7c14bbaSAndroid Build Coastguard Worker __u32 cbuffer; 394*f7c14bbaSAndroid Build Coastguard Worker __u32 quantum; 395*f7c14bbaSAndroid Build Coastguard Worker __u32 level; /* out only */ 396*f7c14bbaSAndroid Build Coastguard Worker __u32 prio; 397*f7c14bbaSAndroid Build Coastguard Worker }; 398*f7c14bbaSAndroid Build Coastguard Worker struct tc_htb_glob { 399*f7c14bbaSAndroid Build Coastguard Worker __u32 version; /* to match HTB/TC */ 400*f7c14bbaSAndroid Build Coastguard Worker __u32 rate2quantum; /* bps->quantum divisor */ 401*f7c14bbaSAndroid Build Coastguard Worker __u32 defcls; /* default class number */ 402*f7c14bbaSAndroid Build Coastguard Worker __u32 debug; /* debug flags */ 403*f7c14bbaSAndroid Build Coastguard Worker 404*f7c14bbaSAndroid Build Coastguard Worker /* stats */ 405*f7c14bbaSAndroid Build Coastguard Worker __u32 direct_pkts; /* count of non shaped packets */ 406*f7c14bbaSAndroid Build Coastguard Worker }; 407*f7c14bbaSAndroid Build Coastguard Worker enum { 408*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_UNSPEC, 409*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_PARMS, 410*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_INIT, 411*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_CTAB, 412*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_RTAB, 413*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_DIRECT_QLEN, 414*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_RATE64, 415*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_CEIL64, 416*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_PAD, 417*f7c14bbaSAndroid Build Coastguard Worker TCA_HTB_OFFLOAD, 418*f7c14bbaSAndroid Build Coastguard Worker __TCA_HTB_MAX, 419*f7c14bbaSAndroid Build Coastguard Worker }; 420*f7c14bbaSAndroid Build Coastguard Worker 421*f7c14bbaSAndroid Build Coastguard Worker #define TCA_HTB_MAX (__TCA_HTB_MAX - 1) 422*f7c14bbaSAndroid Build Coastguard Worker 423*f7c14bbaSAndroid Build Coastguard Worker struct tc_htb_xstats { 424*f7c14bbaSAndroid Build Coastguard Worker __u32 lends; 425*f7c14bbaSAndroid Build Coastguard Worker __u32 borrows; 426*f7c14bbaSAndroid Build Coastguard Worker __u32 giants; /* unused since 'Make HTB scheduler work with TSO.' */ 427*f7c14bbaSAndroid Build Coastguard Worker __s32 tokens; 428*f7c14bbaSAndroid Build Coastguard Worker __s32 ctokens; 429*f7c14bbaSAndroid Build Coastguard Worker }; 430*f7c14bbaSAndroid Build Coastguard Worker 431*f7c14bbaSAndroid Build Coastguard Worker /* HFSC section */ 432*f7c14bbaSAndroid Build Coastguard Worker 433*f7c14bbaSAndroid Build Coastguard Worker struct tc_hfsc_qopt { 434*f7c14bbaSAndroid Build Coastguard Worker __u16 defcls; /* default class */ 435*f7c14bbaSAndroid Build Coastguard Worker }; 436*f7c14bbaSAndroid Build Coastguard Worker 437*f7c14bbaSAndroid Build Coastguard Worker struct tc_service_curve { 438*f7c14bbaSAndroid Build Coastguard Worker __u32 m1; /* slope of the first segment in bps */ 439*f7c14bbaSAndroid Build Coastguard Worker __u32 d; /* x-projection of the first segment in us */ 440*f7c14bbaSAndroid Build Coastguard Worker __u32 m2; /* slope of the second segment in bps */ 441*f7c14bbaSAndroid Build Coastguard Worker }; 442*f7c14bbaSAndroid Build Coastguard Worker 443*f7c14bbaSAndroid Build Coastguard Worker struct tc_hfsc_stats { 444*f7c14bbaSAndroid Build Coastguard Worker __u64 work; /* total work done */ 445*f7c14bbaSAndroid Build Coastguard Worker __u64 rtwork; /* work done by real-time criteria */ 446*f7c14bbaSAndroid Build Coastguard Worker __u32 period; /* current period */ 447*f7c14bbaSAndroid Build Coastguard Worker __u32 level; /* class level in hierarchy */ 448*f7c14bbaSAndroid Build Coastguard Worker }; 449*f7c14bbaSAndroid Build Coastguard Worker 450*f7c14bbaSAndroid Build Coastguard Worker enum { 451*f7c14bbaSAndroid Build Coastguard Worker TCA_HFSC_UNSPEC, 452*f7c14bbaSAndroid Build Coastguard Worker TCA_HFSC_RSC, 453*f7c14bbaSAndroid Build Coastguard Worker TCA_HFSC_FSC, 454*f7c14bbaSAndroid Build Coastguard Worker TCA_HFSC_USC, 455*f7c14bbaSAndroid Build Coastguard Worker __TCA_HFSC_MAX, 456*f7c14bbaSAndroid Build Coastguard Worker }; 457*f7c14bbaSAndroid Build Coastguard Worker 458*f7c14bbaSAndroid Build Coastguard Worker #define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1) 459*f7c14bbaSAndroid Build Coastguard Worker 460*f7c14bbaSAndroid Build Coastguard Worker /* Network emulator */ 461*f7c14bbaSAndroid Build Coastguard Worker 462*f7c14bbaSAndroid Build Coastguard Worker enum { 463*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_UNSPEC, 464*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_CORR, 465*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_DELAY_DIST, 466*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_REORDER, 467*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_CORRUPT, 468*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_LOSS, 469*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_RATE, 470*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_ECN, 471*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_RATE64, 472*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_PAD, 473*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_LATENCY64, 474*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_JITTER64, 475*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_SLOT, 476*f7c14bbaSAndroid Build Coastguard Worker TCA_NETEM_SLOT_DIST, 477*f7c14bbaSAndroid Build Coastguard Worker __TCA_NETEM_MAX, 478*f7c14bbaSAndroid Build Coastguard Worker }; 479*f7c14bbaSAndroid Build Coastguard Worker 480*f7c14bbaSAndroid Build Coastguard Worker #define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) 481*f7c14bbaSAndroid Build Coastguard Worker 482*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_qopt { 483*f7c14bbaSAndroid Build Coastguard Worker __u32 latency; /* added delay (us) */ 484*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* fifo limit (packets) */ 485*f7c14bbaSAndroid Build Coastguard Worker __u32 loss; /* random packet loss (0=none ~0=100%) */ 486*f7c14bbaSAndroid Build Coastguard Worker __u32 gap; /* re-ordering gap (0 for none) */ 487*f7c14bbaSAndroid Build Coastguard Worker __u32 duplicate; /* random packet dup (0=none ~0=100%) */ 488*f7c14bbaSAndroid Build Coastguard Worker __u32 jitter; /* random jitter in latency (us) */ 489*f7c14bbaSAndroid Build Coastguard Worker }; 490*f7c14bbaSAndroid Build Coastguard Worker 491*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_corr { 492*f7c14bbaSAndroid Build Coastguard Worker __u32 delay_corr; /* delay correlation */ 493*f7c14bbaSAndroid Build Coastguard Worker __u32 loss_corr; /* packet loss correlation */ 494*f7c14bbaSAndroid Build Coastguard Worker __u32 dup_corr; /* duplicate correlation */ 495*f7c14bbaSAndroid Build Coastguard Worker }; 496*f7c14bbaSAndroid Build Coastguard Worker 497*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_reorder { 498*f7c14bbaSAndroid Build Coastguard Worker __u32 probability; 499*f7c14bbaSAndroid Build Coastguard Worker __u32 correlation; 500*f7c14bbaSAndroid Build Coastguard Worker }; 501*f7c14bbaSAndroid Build Coastguard Worker 502*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_corrupt { 503*f7c14bbaSAndroid Build Coastguard Worker __u32 probability; 504*f7c14bbaSAndroid Build Coastguard Worker __u32 correlation; 505*f7c14bbaSAndroid Build Coastguard Worker }; 506*f7c14bbaSAndroid Build Coastguard Worker 507*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_rate { 508*f7c14bbaSAndroid Build Coastguard Worker __u32 rate; /* byte/s */ 509*f7c14bbaSAndroid Build Coastguard Worker __s32 packet_overhead; 510*f7c14bbaSAndroid Build Coastguard Worker __u32 cell_size; 511*f7c14bbaSAndroid Build Coastguard Worker __s32 cell_overhead; 512*f7c14bbaSAndroid Build Coastguard Worker }; 513*f7c14bbaSAndroid Build Coastguard Worker 514*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_slot { 515*f7c14bbaSAndroid Build Coastguard Worker __s64 min_delay; /* nsec */ 516*f7c14bbaSAndroid Build Coastguard Worker __s64 max_delay; 517*f7c14bbaSAndroid Build Coastguard Worker __s32 max_packets; 518*f7c14bbaSAndroid Build Coastguard Worker __s32 max_bytes; 519*f7c14bbaSAndroid Build Coastguard Worker __s64 dist_delay; /* nsec */ 520*f7c14bbaSAndroid Build Coastguard Worker __s64 dist_jitter; /* nsec */ 521*f7c14bbaSAndroid Build Coastguard Worker }; 522*f7c14bbaSAndroid Build Coastguard Worker 523*f7c14bbaSAndroid Build Coastguard Worker enum { 524*f7c14bbaSAndroid Build Coastguard Worker NETEM_LOSS_UNSPEC, 525*f7c14bbaSAndroid Build Coastguard Worker NETEM_LOSS_GI, /* General Intuitive - 4 state model */ 526*f7c14bbaSAndroid Build Coastguard Worker NETEM_LOSS_GE, /* Gilbert Elliot models */ 527*f7c14bbaSAndroid Build Coastguard Worker __NETEM_LOSS_MAX 528*f7c14bbaSAndroid Build Coastguard Worker }; 529*f7c14bbaSAndroid Build Coastguard Worker #define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1) 530*f7c14bbaSAndroid Build Coastguard Worker 531*f7c14bbaSAndroid Build Coastguard Worker /* State transition probabilities for 4 state model */ 532*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_gimodel { 533*f7c14bbaSAndroid Build Coastguard Worker __u32 p13; 534*f7c14bbaSAndroid Build Coastguard Worker __u32 p31; 535*f7c14bbaSAndroid Build Coastguard Worker __u32 p32; 536*f7c14bbaSAndroid Build Coastguard Worker __u32 p14; 537*f7c14bbaSAndroid Build Coastguard Worker __u32 p23; 538*f7c14bbaSAndroid Build Coastguard Worker }; 539*f7c14bbaSAndroid Build Coastguard Worker 540*f7c14bbaSAndroid Build Coastguard Worker /* Gilbert-Elliot models */ 541*f7c14bbaSAndroid Build Coastguard Worker struct tc_netem_gemodel { 542*f7c14bbaSAndroid Build Coastguard Worker __u32 p; 543*f7c14bbaSAndroid Build Coastguard Worker __u32 r; 544*f7c14bbaSAndroid Build Coastguard Worker __u32 h; 545*f7c14bbaSAndroid Build Coastguard Worker __u32 k1; 546*f7c14bbaSAndroid Build Coastguard Worker }; 547*f7c14bbaSAndroid Build Coastguard Worker 548*f7c14bbaSAndroid Build Coastguard Worker #define NETEM_DIST_SCALE 8192 549*f7c14bbaSAndroid Build Coastguard Worker #define NETEM_DIST_MAX 16384 550*f7c14bbaSAndroid Build Coastguard Worker 551*f7c14bbaSAndroid Build Coastguard Worker /* DRR */ 552*f7c14bbaSAndroid Build Coastguard Worker 553*f7c14bbaSAndroid Build Coastguard Worker enum { 554*f7c14bbaSAndroid Build Coastguard Worker TCA_DRR_UNSPEC, 555*f7c14bbaSAndroid Build Coastguard Worker TCA_DRR_QUANTUM, 556*f7c14bbaSAndroid Build Coastguard Worker __TCA_DRR_MAX 557*f7c14bbaSAndroid Build Coastguard Worker }; 558*f7c14bbaSAndroid Build Coastguard Worker 559*f7c14bbaSAndroid Build Coastguard Worker #define TCA_DRR_MAX (__TCA_DRR_MAX - 1) 560*f7c14bbaSAndroid Build Coastguard Worker 561*f7c14bbaSAndroid Build Coastguard Worker struct tc_drr_stats { 562*f7c14bbaSAndroid Build Coastguard Worker __u32 deficit; 563*f7c14bbaSAndroid Build Coastguard Worker }; 564*f7c14bbaSAndroid Build Coastguard Worker 565*f7c14bbaSAndroid Build Coastguard Worker /* MQPRIO */ 566*f7c14bbaSAndroid Build Coastguard Worker #define TC_QOPT_BITMASK 15 567*f7c14bbaSAndroid Build Coastguard Worker #define TC_QOPT_MAX_QUEUE 16 568*f7c14bbaSAndroid Build Coastguard Worker 569*f7c14bbaSAndroid Build Coastguard Worker enum { 570*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_HW_OFFLOAD_NONE, /* no offload requested */ 571*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_HW_OFFLOAD_TCS, /* offload TCs, no queue counts */ 572*f7c14bbaSAndroid Build Coastguard Worker __TC_MQPRIO_HW_OFFLOAD_MAX 573*f7c14bbaSAndroid Build Coastguard Worker }; 574*f7c14bbaSAndroid Build Coastguard Worker 575*f7c14bbaSAndroid Build Coastguard Worker #define TC_MQPRIO_HW_OFFLOAD_MAX (__TC_MQPRIO_HW_OFFLOAD_MAX - 1) 576*f7c14bbaSAndroid Build Coastguard Worker 577*f7c14bbaSAndroid Build Coastguard Worker enum { 578*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_MODE_DCB, 579*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_MODE_CHANNEL, 580*f7c14bbaSAndroid Build Coastguard Worker __TC_MQPRIO_MODE_MAX 581*f7c14bbaSAndroid Build Coastguard Worker }; 582*f7c14bbaSAndroid Build Coastguard Worker 583*f7c14bbaSAndroid Build Coastguard Worker #define __TC_MQPRIO_MODE_MAX (__TC_MQPRIO_MODE_MAX - 1) 584*f7c14bbaSAndroid Build Coastguard Worker 585*f7c14bbaSAndroid Build Coastguard Worker enum { 586*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_SHAPER_DCB, 587*f7c14bbaSAndroid Build Coastguard Worker TC_MQPRIO_SHAPER_BW_RATE, /* Add new shapers below */ 588*f7c14bbaSAndroid Build Coastguard Worker __TC_MQPRIO_SHAPER_MAX 589*f7c14bbaSAndroid Build Coastguard Worker }; 590*f7c14bbaSAndroid Build Coastguard Worker 591*f7c14bbaSAndroid Build Coastguard Worker #define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1) 592*f7c14bbaSAndroid Build Coastguard Worker 593*f7c14bbaSAndroid Build Coastguard Worker struct tc_mqprio_qopt { 594*f7c14bbaSAndroid Build Coastguard Worker __u8 num_tc; 595*f7c14bbaSAndroid Build Coastguard Worker __u8 prio_tc_map[TC_QOPT_BITMASK + 1]; 596*f7c14bbaSAndroid Build Coastguard Worker __u8 hw; 597*f7c14bbaSAndroid Build Coastguard Worker __u16 count[TC_QOPT_MAX_QUEUE]; 598*f7c14bbaSAndroid Build Coastguard Worker __u16 offset[TC_QOPT_MAX_QUEUE]; 599*f7c14bbaSAndroid Build Coastguard Worker }; 600*f7c14bbaSAndroid Build Coastguard Worker 601*f7c14bbaSAndroid Build Coastguard Worker #define TC_MQPRIO_F_MODE 0x1 602*f7c14bbaSAndroid Build Coastguard Worker #define TC_MQPRIO_F_SHAPER 0x2 603*f7c14bbaSAndroid Build Coastguard Worker #define TC_MQPRIO_F_MIN_RATE 0x4 604*f7c14bbaSAndroid Build Coastguard Worker #define TC_MQPRIO_F_MAX_RATE 0x8 605*f7c14bbaSAndroid Build Coastguard Worker 606*f7c14bbaSAndroid Build Coastguard Worker enum { 607*f7c14bbaSAndroid Build Coastguard Worker TCA_MQPRIO_UNSPEC, 608*f7c14bbaSAndroid Build Coastguard Worker TCA_MQPRIO_MODE, 609*f7c14bbaSAndroid Build Coastguard Worker TCA_MQPRIO_SHAPER, 610*f7c14bbaSAndroid Build Coastguard Worker TCA_MQPRIO_MIN_RATE64, 611*f7c14bbaSAndroid Build Coastguard Worker TCA_MQPRIO_MAX_RATE64, 612*f7c14bbaSAndroid Build Coastguard Worker __TCA_MQPRIO_MAX, 613*f7c14bbaSAndroid Build Coastguard Worker }; 614*f7c14bbaSAndroid Build Coastguard Worker 615*f7c14bbaSAndroid Build Coastguard Worker #define TCA_MQPRIO_MAX (__TCA_MQPRIO_MAX - 1) 616*f7c14bbaSAndroid Build Coastguard Worker 617*f7c14bbaSAndroid Build Coastguard Worker /* SFB */ 618*f7c14bbaSAndroid Build Coastguard Worker 619*f7c14bbaSAndroid Build Coastguard Worker enum { 620*f7c14bbaSAndroid Build Coastguard Worker TCA_SFB_UNSPEC, 621*f7c14bbaSAndroid Build Coastguard Worker TCA_SFB_PARMS, 622*f7c14bbaSAndroid Build Coastguard Worker __TCA_SFB_MAX, 623*f7c14bbaSAndroid Build Coastguard Worker }; 624*f7c14bbaSAndroid Build Coastguard Worker 625*f7c14bbaSAndroid Build Coastguard Worker #define TCA_SFB_MAX (__TCA_SFB_MAX - 1) 626*f7c14bbaSAndroid Build Coastguard Worker 627*f7c14bbaSAndroid Build Coastguard Worker /* 628*f7c14bbaSAndroid Build Coastguard Worker * Note: increment, decrement are Q0.16 fixed-point values. 629*f7c14bbaSAndroid Build Coastguard Worker */ 630*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfb_qopt { 631*f7c14bbaSAndroid Build Coastguard Worker __u32 rehash_interval; /* delay between hash move, in ms */ 632*f7c14bbaSAndroid Build Coastguard Worker __u32 warmup_time; /* double buffering warmup time in ms (warmup_time < rehash_interval) */ 633*f7c14bbaSAndroid Build Coastguard Worker __u32 max; /* max len of qlen_min */ 634*f7c14bbaSAndroid Build Coastguard Worker __u32 bin_size; /* maximum queue length per bin */ 635*f7c14bbaSAndroid Build Coastguard Worker __u32 increment; /* probability increment, (d1 in Blue) */ 636*f7c14bbaSAndroid Build Coastguard Worker __u32 decrement; /* probability decrement, (d2 in Blue) */ 637*f7c14bbaSAndroid Build Coastguard Worker __u32 limit; /* max SFB queue length */ 638*f7c14bbaSAndroid Build Coastguard Worker __u32 penalty_rate; /* inelastic flows are rate limited to 'rate' pps */ 639*f7c14bbaSAndroid Build Coastguard Worker __u32 penalty_burst; 640*f7c14bbaSAndroid Build Coastguard Worker }; 641*f7c14bbaSAndroid Build Coastguard Worker 642*f7c14bbaSAndroid Build Coastguard Worker struct tc_sfb_xstats { 643*f7c14bbaSAndroid Build Coastguard Worker __u32 earlydrop; 644*f7c14bbaSAndroid Build Coastguard Worker __u32 penaltydrop; 645*f7c14bbaSAndroid Build Coastguard Worker __u32 bucketdrop; 646*f7c14bbaSAndroid Build Coastguard Worker __u32 queuedrop; 647*f7c14bbaSAndroid Build Coastguard Worker __u32 childdrop; /* drops in child qdisc */ 648*f7c14bbaSAndroid Build Coastguard Worker __u32 marked; 649*f7c14bbaSAndroid Build Coastguard Worker __u32 maxqlen; 650*f7c14bbaSAndroid Build Coastguard Worker __u32 maxprob; 651*f7c14bbaSAndroid Build Coastguard Worker __u32 avgprob; 652*f7c14bbaSAndroid Build Coastguard Worker }; 653*f7c14bbaSAndroid Build Coastguard Worker 654*f7c14bbaSAndroid Build Coastguard Worker #define SFB_MAX_PROB 0xFFFF 655*f7c14bbaSAndroid Build Coastguard Worker 656*f7c14bbaSAndroid Build Coastguard Worker /* QFQ */ 657*f7c14bbaSAndroid Build Coastguard Worker enum { 658*f7c14bbaSAndroid Build Coastguard Worker TCA_QFQ_UNSPEC, 659*f7c14bbaSAndroid Build Coastguard Worker TCA_QFQ_WEIGHT, 660*f7c14bbaSAndroid Build Coastguard Worker TCA_QFQ_LMAX, 661*f7c14bbaSAndroid Build Coastguard Worker __TCA_QFQ_MAX 662*f7c14bbaSAndroid Build Coastguard Worker }; 663*f7c14bbaSAndroid Build Coastguard Worker 664*f7c14bbaSAndroid Build Coastguard Worker #define TCA_QFQ_MAX (__TCA_QFQ_MAX - 1) 665*f7c14bbaSAndroid Build Coastguard Worker 666*f7c14bbaSAndroid Build Coastguard Worker struct tc_qfq_stats { 667*f7c14bbaSAndroid Build Coastguard Worker __u32 weight; 668*f7c14bbaSAndroid Build Coastguard Worker __u32 lmax; 669*f7c14bbaSAndroid Build Coastguard Worker }; 670*f7c14bbaSAndroid Build Coastguard Worker 671*f7c14bbaSAndroid Build Coastguard Worker /* CODEL */ 672*f7c14bbaSAndroid Build Coastguard Worker 673*f7c14bbaSAndroid Build Coastguard Worker enum { 674*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_UNSPEC, 675*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_TARGET, 676*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_LIMIT, 677*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_INTERVAL, 678*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_ECN, 679*f7c14bbaSAndroid Build Coastguard Worker TCA_CODEL_CE_THRESHOLD, 680*f7c14bbaSAndroid Build Coastguard Worker __TCA_CODEL_MAX 681*f7c14bbaSAndroid Build Coastguard Worker }; 682*f7c14bbaSAndroid Build Coastguard Worker 683*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1) 684*f7c14bbaSAndroid Build Coastguard Worker 685*f7c14bbaSAndroid Build Coastguard Worker struct tc_codel_xstats { 686*f7c14bbaSAndroid Build Coastguard Worker __u32 maxpacket; /* largest packet we've seen so far */ 687*f7c14bbaSAndroid Build Coastguard Worker __u32 count; /* how many drops we've done since the last time we 688*f7c14bbaSAndroid Build Coastguard Worker * entered dropping state 689*f7c14bbaSAndroid Build Coastguard Worker */ 690*f7c14bbaSAndroid Build Coastguard Worker __u32 lastcount; /* count at entry to dropping state */ 691*f7c14bbaSAndroid Build Coastguard Worker __u32 ldelay; /* in-queue delay seen by most recently dequeued packet */ 692*f7c14bbaSAndroid Build Coastguard Worker __s32 drop_next; /* time to drop next packet */ 693*f7c14bbaSAndroid Build Coastguard Worker __u32 drop_overlimit; /* number of time max qdisc packet limit was hit */ 694*f7c14bbaSAndroid Build Coastguard Worker __u32 ecn_mark; /* number of packets we ECN marked instead of dropped */ 695*f7c14bbaSAndroid Build Coastguard Worker __u32 dropping; /* are we in dropping state ? */ 696*f7c14bbaSAndroid Build Coastguard Worker __u32 ce_mark; /* number of CE marked packets because of ce_threshold */ 697*f7c14bbaSAndroid Build Coastguard Worker }; 698*f7c14bbaSAndroid Build Coastguard Worker 699*f7c14bbaSAndroid Build Coastguard Worker /* FQ_CODEL */ 700*f7c14bbaSAndroid Build Coastguard Worker 701*f7c14bbaSAndroid Build Coastguard Worker enum { 702*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_UNSPEC, 703*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_TARGET, 704*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_LIMIT, 705*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_INTERVAL, 706*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_ECN, 707*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_FLOWS, 708*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_QUANTUM, 709*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_CE_THRESHOLD, 710*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_DROP_BATCH_SIZE, 711*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_MEMORY_LIMIT, 712*f7c14bbaSAndroid Build Coastguard Worker __TCA_FQ_CODEL_MAX 713*f7c14bbaSAndroid Build Coastguard Worker }; 714*f7c14bbaSAndroid Build Coastguard Worker 715*f7c14bbaSAndroid Build Coastguard Worker #define TCA_FQ_CODEL_MAX (__TCA_FQ_CODEL_MAX - 1) 716*f7c14bbaSAndroid Build Coastguard Worker 717*f7c14bbaSAndroid Build Coastguard Worker enum { 718*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_XSTATS_QDISC, 719*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CODEL_XSTATS_CLASS, 720*f7c14bbaSAndroid Build Coastguard Worker }; 721*f7c14bbaSAndroid Build Coastguard Worker 722*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_codel_qd_stats { 723*f7c14bbaSAndroid Build Coastguard Worker __u32 maxpacket; /* largest packet we've seen so far */ 724*f7c14bbaSAndroid Build Coastguard Worker __u32 drop_overlimit; /* number of time max qdisc 725*f7c14bbaSAndroid Build Coastguard Worker * packet limit was hit 726*f7c14bbaSAndroid Build Coastguard Worker */ 727*f7c14bbaSAndroid Build Coastguard Worker __u32 ecn_mark; /* number of packets we ECN marked 728*f7c14bbaSAndroid Build Coastguard Worker * instead of being dropped 729*f7c14bbaSAndroid Build Coastguard Worker */ 730*f7c14bbaSAndroid Build Coastguard Worker __u32 new_flow_count; /* number of time packets 731*f7c14bbaSAndroid Build Coastguard Worker * created a 'new flow' 732*f7c14bbaSAndroid Build Coastguard Worker */ 733*f7c14bbaSAndroid Build Coastguard Worker __u32 new_flows_len; /* count of flows in new list */ 734*f7c14bbaSAndroid Build Coastguard Worker __u32 old_flows_len; /* count of flows in old list */ 735*f7c14bbaSAndroid Build Coastguard Worker __u32 ce_mark; /* packets above ce_threshold */ 736*f7c14bbaSAndroid Build Coastguard Worker __u32 memory_usage; /* in bytes */ 737*f7c14bbaSAndroid Build Coastguard Worker __u32 drop_overmemory; 738*f7c14bbaSAndroid Build Coastguard Worker }; 739*f7c14bbaSAndroid Build Coastguard Worker 740*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_codel_cl_stats { 741*f7c14bbaSAndroid Build Coastguard Worker __s32 deficit; 742*f7c14bbaSAndroid Build Coastguard Worker __u32 ldelay; /* in-queue delay seen by most recently 743*f7c14bbaSAndroid Build Coastguard Worker * dequeued packet 744*f7c14bbaSAndroid Build Coastguard Worker */ 745*f7c14bbaSAndroid Build Coastguard Worker __u32 count; 746*f7c14bbaSAndroid Build Coastguard Worker __u32 lastcount; 747*f7c14bbaSAndroid Build Coastguard Worker __u32 dropping; 748*f7c14bbaSAndroid Build Coastguard Worker __s32 drop_next; 749*f7c14bbaSAndroid Build Coastguard Worker }; 750*f7c14bbaSAndroid Build Coastguard Worker 751*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_codel_xstats { 752*f7c14bbaSAndroid Build Coastguard Worker __u32 type; 753*f7c14bbaSAndroid Build Coastguard Worker union { 754*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_codel_qd_stats qdisc_stats; 755*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_codel_cl_stats class_stats; 756*f7c14bbaSAndroid Build Coastguard Worker }; 757*f7c14bbaSAndroid Build Coastguard Worker }; 758*f7c14bbaSAndroid Build Coastguard Worker 759*f7c14bbaSAndroid Build Coastguard Worker /* FQ */ 760*f7c14bbaSAndroid Build Coastguard Worker 761*f7c14bbaSAndroid Build Coastguard Worker enum { 762*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_UNSPEC, 763*f7c14bbaSAndroid Build Coastguard Worker 764*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_PLIMIT, /* limit of total number of packets in queue */ 765*f7c14bbaSAndroid Build Coastguard Worker 766*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_FLOW_PLIMIT, /* limit of packets per flow */ 767*f7c14bbaSAndroid Build Coastguard Worker 768*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_QUANTUM, /* RR quantum */ 769*f7c14bbaSAndroid Build Coastguard Worker 770*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_INITIAL_QUANTUM, /* RR quantum for new flow */ 771*f7c14bbaSAndroid Build Coastguard Worker 772*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */ 773*f7c14bbaSAndroid Build Coastguard Worker 774*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_FLOW_DEFAULT_RATE,/* obsolete, do not use */ 775*f7c14bbaSAndroid Build Coastguard Worker 776*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */ 777*f7c14bbaSAndroid Build Coastguard Worker 778*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */ 779*f7c14bbaSAndroid Build Coastguard Worker 780*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */ 781*f7c14bbaSAndroid Build Coastguard Worker 782*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_ORPHAN_MASK, /* mask applied to orphaned skb hashes */ 783*f7c14bbaSAndroid Build Coastguard Worker 784*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_LOW_RATE_THRESHOLD, /* per packet delay under this rate */ 785*f7c14bbaSAndroid Build Coastguard Worker 786*f7c14bbaSAndroid Build Coastguard Worker TCA_FQ_CE_THRESHOLD, /* DCTCP-like CE-marking threshold */ 787*f7c14bbaSAndroid Build Coastguard Worker 788*f7c14bbaSAndroid Build Coastguard Worker __TCA_FQ_MAX 789*f7c14bbaSAndroid Build Coastguard Worker }; 790*f7c14bbaSAndroid Build Coastguard Worker 791*f7c14bbaSAndroid Build Coastguard Worker #define TCA_FQ_MAX (__TCA_FQ_MAX - 1) 792*f7c14bbaSAndroid Build Coastguard Worker 793*f7c14bbaSAndroid Build Coastguard Worker struct tc_fq_qd_stats { 794*f7c14bbaSAndroid Build Coastguard Worker __u64 gc_flows; 795*f7c14bbaSAndroid Build Coastguard Worker __u64 highprio_packets; 796*f7c14bbaSAndroid Build Coastguard Worker __u64 tcp_retrans; 797*f7c14bbaSAndroid Build Coastguard Worker __u64 throttled; 798*f7c14bbaSAndroid Build Coastguard Worker __u64 flows_plimit; 799*f7c14bbaSAndroid Build Coastguard Worker __u64 pkts_too_long; 800*f7c14bbaSAndroid Build Coastguard Worker __u64 allocation_errors; 801*f7c14bbaSAndroid Build Coastguard Worker __s64 time_next_delayed_flow; 802*f7c14bbaSAndroid Build Coastguard Worker __u32 flows; 803*f7c14bbaSAndroid Build Coastguard Worker __u32 inactive_flows; 804*f7c14bbaSAndroid Build Coastguard Worker __u32 throttled_flows; 805*f7c14bbaSAndroid Build Coastguard Worker __u32 unthrottle_latency_ns; 806*f7c14bbaSAndroid Build Coastguard Worker __u64 ce_mark; /* packets above ce_threshold */ 807*f7c14bbaSAndroid Build Coastguard Worker }; 808*f7c14bbaSAndroid Build Coastguard Worker 809*f7c14bbaSAndroid Build Coastguard Worker /* Heavy-Hitter Filter */ 810*f7c14bbaSAndroid Build Coastguard Worker 811*f7c14bbaSAndroid Build Coastguard Worker enum { 812*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_UNSPEC, 813*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_BACKLOG_LIMIT, 814*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_QUANTUM, 815*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_HH_FLOWS_LIMIT, 816*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_RESET_TIMEOUT, 817*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_ADMIT_BYTES, 818*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_EVICT_TIMEOUT, 819*f7c14bbaSAndroid Build Coastguard Worker TCA_HHF_NON_HH_WEIGHT, 820*f7c14bbaSAndroid Build Coastguard Worker __TCA_HHF_MAX 821*f7c14bbaSAndroid Build Coastguard Worker }; 822*f7c14bbaSAndroid Build Coastguard Worker 823*f7c14bbaSAndroid Build Coastguard Worker #define TCA_HHF_MAX (__TCA_HHF_MAX - 1) 824*f7c14bbaSAndroid Build Coastguard Worker 825*f7c14bbaSAndroid Build Coastguard Worker struct tc_hhf_xstats { 826*f7c14bbaSAndroid Build Coastguard Worker __u32 drop_overlimit; /* number of times max qdisc packet limit 827*f7c14bbaSAndroid Build Coastguard Worker * was hit 828*f7c14bbaSAndroid Build Coastguard Worker */ 829*f7c14bbaSAndroid Build Coastguard Worker __u32 hh_overlimit; /* number of times max heavy-hitters was hit */ 830*f7c14bbaSAndroid Build Coastguard Worker __u32 hh_tot_count; /* number of captured heavy-hitters so far */ 831*f7c14bbaSAndroid Build Coastguard Worker __u32 hh_cur_count; /* number of current heavy-hitters */ 832*f7c14bbaSAndroid Build Coastguard Worker }; 833*f7c14bbaSAndroid Build Coastguard Worker 834*f7c14bbaSAndroid Build Coastguard Worker /* PIE */ 835*f7c14bbaSAndroid Build Coastguard Worker enum { 836*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_UNSPEC, 837*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_TARGET, 838*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_LIMIT, 839*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_TUPDATE, 840*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_ALPHA, 841*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_BETA, 842*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_ECN, 843*f7c14bbaSAndroid Build Coastguard Worker TCA_PIE_BYTEMODE, 844*f7c14bbaSAndroid Build Coastguard Worker __TCA_PIE_MAX 845*f7c14bbaSAndroid Build Coastguard Worker }; 846*f7c14bbaSAndroid Build Coastguard Worker #define TCA_PIE_MAX (__TCA_PIE_MAX - 1) 847*f7c14bbaSAndroid Build Coastguard Worker 848*f7c14bbaSAndroid Build Coastguard Worker struct tc_pie_xstats { 849*f7c14bbaSAndroid Build Coastguard Worker __u32 prob; /* current probability */ 850*f7c14bbaSAndroid Build Coastguard Worker __u32 delay; /* current delay in ms */ 851*f7c14bbaSAndroid Build Coastguard Worker __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */ 852*f7c14bbaSAndroid Build Coastguard Worker __u32 packets_in; /* total number of packets enqueued */ 853*f7c14bbaSAndroid Build Coastguard Worker __u32 dropped; /* packets dropped due to pie_action */ 854*f7c14bbaSAndroid Build Coastguard Worker __u32 overlimit; /* dropped due to lack of space in queue */ 855*f7c14bbaSAndroid Build Coastguard Worker __u32 maxq; /* maximum queue size */ 856*f7c14bbaSAndroid Build Coastguard Worker __u32 ecn_mark; /* packets marked with ecn*/ 857*f7c14bbaSAndroid Build Coastguard Worker }; 858*f7c14bbaSAndroid Build Coastguard Worker 859*f7c14bbaSAndroid Build Coastguard Worker /* CBS */ 860*f7c14bbaSAndroid Build Coastguard Worker struct tc_cbs_qopt { 861*f7c14bbaSAndroid Build Coastguard Worker __u8 offload; 862*f7c14bbaSAndroid Build Coastguard Worker __u8 _pad[3]; 863*f7c14bbaSAndroid Build Coastguard Worker __s32 hicredit; 864*f7c14bbaSAndroid Build Coastguard Worker __s32 locredit; 865*f7c14bbaSAndroid Build Coastguard Worker __s32 idleslope; 866*f7c14bbaSAndroid Build Coastguard Worker __s32 sendslope; 867*f7c14bbaSAndroid Build Coastguard Worker }; 868*f7c14bbaSAndroid Build Coastguard Worker 869*f7c14bbaSAndroid Build Coastguard Worker enum { 870*f7c14bbaSAndroid Build Coastguard Worker TCA_CBS_UNSPEC, 871*f7c14bbaSAndroid Build Coastguard Worker TCA_CBS_PARMS, 872*f7c14bbaSAndroid Build Coastguard Worker __TCA_CBS_MAX, 873*f7c14bbaSAndroid Build Coastguard Worker }; 874*f7c14bbaSAndroid Build Coastguard Worker 875*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CBS_MAX (__TCA_CBS_MAX - 1) 876*f7c14bbaSAndroid Build Coastguard Worker 877*f7c14bbaSAndroid Build Coastguard Worker 878*f7c14bbaSAndroid Build Coastguard Worker /* ETF */ 879*f7c14bbaSAndroid Build Coastguard Worker struct tc_etf_qopt { 880*f7c14bbaSAndroid Build Coastguard Worker __s32 delta; 881*f7c14bbaSAndroid Build Coastguard Worker __s32 clockid; 882*f7c14bbaSAndroid Build Coastguard Worker __u32 flags; 883*f7c14bbaSAndroid Build Coastguard Worker #define TC_ETF_DEADLINE_MODE_ON BIT(0) 884*f7c14bbaSAndroid Build Coastguard Worker #define TC_ETF_OFFLOAD_ON BIT(1) 885*f7c14bbaSAndroid Build Coastguard Worker }; 886*f7c14bbaSAndroid Build Coastguard Worker 887*f7c14bbaSAndroid Build Coastguard Worker enum { 888*f7c14bbaSAndroid Build Coastguard Worker TCA_ETF_UNSPEC, 889*f7c14bbaSAndroid Build Coastguard Worker TCA_ETF_PARMS, 890*f7c14bbaSAndroid Build Coastguard Worker __TCA_ETF_MAX, 891*f7c14bbaSAndroid Build Coastguard Worker }; 892*f7c14bbaSAndroid Build Coastguard Worker 893*f7c14bbaSAndroid Build Coastguard Worker #define TCA_ETF_MAX (__TCA_ETF_MAX - 1) 894*f7c14bbaSAndroid Build Coastguard Worker 895*f7c14bbaSAndroid Build Coastguard Worker 896*f7c14bbaSAndroid Build Coastguard Worker /* CAKE */ 897*f7c14bbaSAndroid Build Coastguard Worker enum { 898*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_UNSPEC, 899*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_PAD, 900*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_BASE_RATE64, 901*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_DIFFSERV_MODE, 902*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_ATM, 903*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_FLOW_MODE, 904*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_OVERHEAD, 905*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_RTT, 906*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TARGET, 907*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_AUTORATE, 908*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_MEMORY, 909*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_NAT, 910*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_RAW, 911*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_WASH, 912*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_MPU, 913*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_INGRESS, 914*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_ACK_FILTER, 915*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_SPLIT_GSO, 916*f7c14bbaSAndroid Build Coastguard Worker __TCA_CAKE_MAX 917*f7c14bbaSAndroid Build Coastguard Worker }; 918*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1) 919*f7c14bbaSAndroid Build Coastguard Worker 920*f7c14bbaSAndroid Build Coastguard Worker enum { 921*f7c14bbaSAndroid Build Coastguard Worker __TCA_CAKE_STATS_INVALID, 922*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_PAD, 923*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_CAPACITY_ESTIMATE64, 924*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MEMORY_LIMIT, 925*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MEMORY_USED, 926*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_AVG_NETOFF, 927*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MIN_NETLEN, 928*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MAX_NETLEN, 929*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MIN_ADJLEN, 930*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_MAX_ADJLEN, 931*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_TIN_STATS, 932*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_DEFICIT, 933*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_COBALT_COUNT, 934*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_DROPPING, 935*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_DROP_NEXT_US, 936*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_P_DROP, 937*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_STATS_BLUE_TIMER_US, 938*f7c14bbaSAndroid Build Coastguard Worker __TCA_CAKE_STATS_MAX 939*f7c14bbaSAndroid Build Coastguard Worker }; 940*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1) 941*f7c14bbaSAndroid Build Coastguard Worker 942*f7c14bbaSAndroid Build Coastguard Worker enum { 943*f7c14bbaSAndroid Build Coastguard Worker __TCA_CAKE_TIN_STATS_INVALID, 944*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_PAD, 945*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_SENT_PACKETS, 946*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_SENT_BYTES64, 947*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_DROPPED_PACKETS, 948*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_DROPPED_BYTES64, 949*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_ACKS_DROPPED_PACKETS, 950*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_ACKS_DROPPED_BYTES64, 951*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_ECN_MARKED_PACKETS, 952*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_ECN_MARKED_BYTES64, 953*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_BACKLOG_PACKETS, 954*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_BACKLOG_BYTES, 955*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_THRESHOLD_RATE64, 956*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_TARGET_US, 957*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_INTERVAL_US, 958*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_WAY_INDIRECT_HITS, 959*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_WAY_MISSES, 960*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_WAY_COLLISIONS, 961*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_PEAK_DELAY_US, 962*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_AVG_DELAY_US, 963*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_BASE_DELAY_US, 964*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_SPARSE_FLOWS, 965*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_BULK_FLOWS, 966*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_UNRESPONSIVE_FLOWS, 967*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_MAX_SKBLEN, 968*f7c14bbaSAndroid Build Coastguard Worker TCA_CAKE_TIN_STATS_FLOW_QUANTUM, 969*f7c14bbaSAndroid Build Coastguard Worker __TCA_CAKE_TIN_STATS_MAX 970*f7c14bbaSAndroid Build Coastguard Worker }; 971*f7c14bbaSAndroid Build Coastguard Worker #define TCA_CAKE_TIN_STATS_MAX (__TCA_CAKE_TIN_STATS_MAX - 1) 972*f7c14bbaSAndroid Build Coastguard Worker #define TC_CAKE_MAX_TINS (8) 973*f7c14bbaSAndroid Build Coastguard Worker 974*f7c14bbaSAndroid Build Coastguard Worker enum { 975*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_NONE = 0, 976*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_SRC_IP, 977*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_DST_IP, 978*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_HOSTS, /* = CAKE_FLOW_SRC_IP | CAKE_FLOW_DST_IP */ 979*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_FLOWS, 980*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_DUAL_SRC, /* = CAKE_FLOW_SRC_IP | CAKE_FLOW_FLOWS */ 981*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_DUAL_DST, /* = CAKE_FLOW_DST_IP | CAKE_FLOW_FLOWS */ 982*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_TRIPLE, /* = CAKE_FLOW_HOSTS | CAKE_FLOW_FLOWS */ 983*f7c14bbaSAndroid Build Coastguard Worker CAKE_FLOW_MAX, 984*f7c14bbaSAndroid Build Coastguard Worker }; 985*f7c14bbaSAndroid Build Coastguard Worker 986*f7c14bbaSAndroid Build Coastguard Worker enum { 987*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_DIFFSERV3 = 0, 988*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_DIFFSERV4, 989*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_DIFFSERV8, 990*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_BESTEFFORT, 991*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_PRECEDENCE, 992*f7c14bbaSAndroid Build Coastguard Worker CAKE_DIFFSERV_MAX 993*f7c14bbaSAndroid Build Coastguard Worker }; 994*f7c14bbaSAndroid Build Coastguard Worker 995*f7c14bbaSAndroid Build Coastguard Worker enum { 996*f7c14bbaSAndroid Build Coastguard Worker CAKE_ACK_NONE = 0, 997*f7c14bbaSAndroid Build Coastguard Worker CAKE_ACK_FILTER, 998*f7c14bbaSAndroid Build Coastguard Worker CAKE_ACK_AGGRESSIVE, 999*f7c14bbaSAndroid Build Coastguard Worker CAKE_ACK_MAX 1000*f7c14bbaSAndroid Build Coastguard Worker }; 1001*f7c14bbaSAndroid Build Coastguard Worker 1002*f7c14bbaSAndroid Build Coastguard Worker enum { 1003*f7c14bbaSAndroid Build Coastguard Worker CAKE_ATM_NONE = 0, 1004*f7c14bbaSAndroid Build Coastguard Worker CAKE_ATM_ATM, 1005*f7c14bbaSAndroid Build Coastguard Worker CAKE_ATM_PTM, 1006*f7c14bbaSAndroid Build Coastguard Worker CAKE_ATM_MAX 1007*f7c14bbaSAndroid Build Coastguard Worker }; 1008*f7c14bbaSAndroid Build Coastguard Worker 1009*f7c14bbaSAndroid Build Coastguard Worker 1010*f7c14bbaSAndroid Build Coastguard Worker /* TAPRIO */ 1011*f7c14bbaSAndroid Build Coastguard Worker enum { 1012*f7c14bbaSAndroid Build Coastguard Worker TC_TAPRIO_CMD_SET_GATES = 0x00, 1013*f7c14bbaSAndroid Build Coastguard Worker TC_TAPRIO_CMD_SET_AND_HOLD = 0x01, 1014*f7c14bbaSAndroid Build Coastguard Worker TC_TAPRIO_CMD_SET_AND_RELEASE = 0x02, 1015*f7c14bbaSAndroid Build Coastguard Worker }; 1016*f7c14bbaSAndroid Build Coastguard Worker 1017*f7c14bbaSAndroid Build Coastguard Worker enum { 1018*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY_UNSPEC, 1019*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY_INDEX, /* u32 */ 1020*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY_CMD, /* u8 */ 1021*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY_GATE_MASK, /* u32 */ 1022*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY_INTERVAL, /* u32 */ 1023*f7c14bbaSAndroid Build Coastguard Worker __TCA_TAPRIO_SCHED_ENTRY_MAX, 1024*f7c14bbaSAndroid Build Coastguard Worker }; 1025*f7c14bbaSAndroid Build Coastguard Worker #define TCA_TAPRIO_SCHED_ENTRY_MAX (__TCA_TAPRIO_SCHED_ENTRY_MAX - 1) 1026*f7c14bbaSAndroid Build Coastguard Worker 1027*f7c14bbaSAndroid Build Coastguard Worker /* The format for schedule entry list is: 1028*f7c14bbaSAndroid Build Coastguard Worker * [TCA_TAPRIO_SCHED_ENTRY_LIST] 1029*f7c14bbaSAndroid Build Coastguard Worker * [TCA_TAPRIO_SCHED_ENTRY] 1030*f7c14bbaSAndroid Build Coastguard Worker * [TCA_TAPRIO_SCHED_ENTRY_CMD] 1031*f7c14bbaSAndroid Build Coastguard Worker * [TCA_TAPRIO_SCHED_ENTRY_GATES] 1032*f7c14bbaSAndroid Build Coastguard Worker * [TCA_TAPRIO_SCHED_ENTRY_INTERVAL] 1033*f7c14bbaSAndroid Build Coastguard Worker */ 1034*f7c14bbaSAndroid Build Coastguard Worker enum { 1035*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_UNSPEC, 1036*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_SCHED_ENTRY, 1037*f7c14bbaSAndroid Build Coastguard Worker __TCA_TAPRIO_SCHED_MAX, 1038*f7c14bbaSAndroid Build Coastguard Worker }; 1039*f7c14bbaSAndroid Build Coastguard Worker 1040*f7c14bbaSAndroid Build Coastguard Worker #define TCA_TAPRIO_SCHED_MAX (__TCA_TAPRIO_SCHED_MAX - 1) 1041*f7c14bbaSAndroid Build Coastguard Worker 1042*f7c14bbaSAndroid Build Coastguard Worker enum { 1043*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_UNSPEC, 1044*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */ 1045*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST, /* nested of entry */ 1046*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_SCHED_BASE_TIME, /* s64 */ 1047*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY, /* single entry */ 1048*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_ATTR_SCHED_CLOCKID, /* s32 */ 1049*f7c14bbaSAndroid Build Coastguard Worker TCA_TAPRIO_PAD, 1050*f7c14bbaSAndroid Build Coastguard Worker __TCA_TAPRIO_ATTR_MAX, 1051*f7c14bbaSAndroid Build Coastguard Worker }; 1052*f7c14bbaSAndroid Build Coastguard Worker 1053*f7c14bbaSAndroid Build Coastguard Worker #define TCA_TAPRIO_ATTR_MAX (__TCA_TAPRIO_ATTR_MAX - 1) 1054*f7c14bbaSAndroid Build Coastguard Worker 1055*f7c14bbaSAndroid Build Coastguard Worker #endif 1056