Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef __LINUX_PKT_SCHED_H
     20 #define __LINUX_PKT_SCHED_H
     21 #include <linux/types.h>
     22 #define TC_PRIO_BESTEFFORT 0
     23 #define TC_PRIO_FILLER 1
     24 #define TC_PRIO_BULK 2
     25 #define TC_PRIO_INTERACTIVE_BULK 4
     26 #define TC_PRIO_INTERACTIVE 6
     27 #define TC_PRIO_CONTROL 7
     28 #define TC_PRIO_MAX 15
     29 struct tc_stats {
     30   __u64 bytes;
     31   __u32 packets;
     32   __u32 drops;
     33   __u32 overlimits;
     34   __u32 bps;
     35   __u32 pps;
     36   __u32 qlen;
     37   __u32 backlog;
     38 };
     39 struct tc_estimator {
     40   signed char interval;
     41   unsigned char ewma_log;
     42 };
     43 #define TC_H_MAJ_MASK (0xFFFF0000U)
     44 #define TC_H_MIN_MASK (0x0000FFFFU)
     45 #define TC_H_MAJ(h) ((h) & TC_H_MAJ_MASK)
     46 #define TC_H_MIN(h) ((h) & TC_H_MIN_MASK)
     47 #define TC_H_MAKE(maj,min) (((maj) & TC_H_MAJ_MASK) | ((min) & TC_H_MIN_MASK))
     48 #define TC_H_UNSPEC (0U)
     49 #define TC_H_ROOT (0xFFFFFFFFU)
     50 #define TC_H_INGRESS (0xFFFFFFF1U)
     51 #define TC_H_CLSACT TC_H_INGRESS
     52 #define TC_H_MIN_INGRESS 0xFFF2U
     53 #define TC_H_MIN_EGRESS 0xFFF3U
     54 enum tc_link_layer {
     55   TC_LINKLAYER_UNAWARE,
     56   TC_LINKLAYER_ETHERNET,
     57   TC_LINKLAYER_ATM,
     58 };
     59 #define TC_LINKLAYER_MASK 0x0F
     60 struct tc_ratespec {
     61   unsigned char cell_log;
     62   __u8 linklayer;
     63   unsigned short overhead;
     64   short cell_align;
     65   unsigned short mpu;
     66   __u32 rate;
     67 };
     68 #define TC_RTAB_SIZE 1024
     69 struct tc_sizespec {
     70   unsigned char cell_log;
     71   unsigned char size_log;
     72   short cell_align;
     73   int overhead;
     74   unsigned int linklayer;
     75   unsigned int mpu;
     76   unsigned int mtu;
     77   unsigned int tsize;
     78 };
     79 enum {
     80   TCA_STAB_UNSPEC,
     81   TCA_STAB_BASE,
     82   TCA_STAB_DATA,
     83   __TCA_STAB_MAX
     84 };
     85 #define TCA_STAB_MAX (__TCA_STAB_MAX - 1)
     86 struct tc_fifo_qopt {
     87   __u32 limit;
     88 };
     89 #define TCQ_PRIO_BANDS 16
     90 #define TCQ_MIN_PRIO_BANDS 2
     91 struct tc_prio_qopt {
     92   int bands;
     93   __u8 priomap[TC_PRIO_MAX + 1];
     94 };
     95 struct tc_multiq_qopt {
     96   __u16 bands;
     97   __u16 max_bands;
     98 };
     99 #define TCQ_PLUG_BUFFER 0
    100 #define TCQ_PLUG_RELEASE_ONE 1
    101 #define TCQ_PLUG_RELEASE_INDEFINITE 2
    102 #define TCQ_PLUG_LIMIT 3
    103 struct tc_plug_qopt {
    104   int action;
    105   __u32 limit;
    106 };
    107 struct tc_tbf_qopt {
    108   struct tc_ratespec rate;
    109   struct tc_ratespec peakrate;
    110   __u32 limit;
    111   __u32 buffer;
    112   __u32 mtu;
    113 };
    114 enum {
    115   TCA_TBF_UNSPEC,
    116   TCA_TBF_PARMS,
    117   TCA_TBF_RTAB,
    118   TCA_TBF_PTAB,
    119   TCA_TBF_RATE64,
    120   TCA_TBF_PRATE64,
    121   TCA_TBF_BURST,
    122   TCA_TBF_PBURST,
    123   TCA_TBF_PAD,
    124   __TCA_TBF_MAX,
    125 };
    126 #define TCA_TBF_MAX (__TCA_TBF_MAX - 1)
    127 struct tc_sfq_qopt {
    128   unsigned quantum;
    129   int perturb_period;
    130   __u32 limit;
    131   unsigned divisor;
    132   unsigned flows;
    133 };
    134 struct tc_sfqred_stats {
    135   __u32 prob_drop;
    136   __u32 forced_drop;
    137   __u32 prob_mark;
    138   __u32 forced_mark;
    139   __u32 prob_mark_head;
    140   __u32 forced_mark_head;
    141 };
    142 struct tc_sfq_qopt_v1 {
    143   struct tc_sfq_qopt v0;
    144   unsigned int depth;
    145   unsigned int headdrop;
    146   __u32 limit;
    147   __u32 qth_min;
    148   __u32 qth_max;
    149   unsigned char Wlog;
    150   unsigned char Plog;
    151   unsigned char Scell_log;
    152   unsigned char flags;
    153   __u32 max_P;
    154   struct tc_sfqred_stats stats;
    155 };
    156 struct tc_sfq_xstats {
    157   __s32 allot;
    158 };
    159 enum {
    160   TCA_RED_UNSPEC,
    161   TCA_RED_PARMS,
    162   TCA_RED_STAB,
    163   TCA_RED_MAX_P,
    164   __TCA_RED_MAX,
    165 };
    166 #define TCA_RED_MAX (__TCA_RED_MAX - 1)
    167 struct tc_red_qopt {
    168   __u32 limit;
    169   __u32 qth_min;
    170   __u32 qth_max;
    171   unsigned char Wlog;
    172   unsigned char Plog;
    173   unsigned char Scell_log;
    174   unsigned char flags;
    175 #define TC_RED_ECN 1
    176 #define TC_RED_HARDDROP 2
    177 #define TC_RED_ADAPTATIVE 4
    178 };
    179 struct tc_red_xstats {
    180   __u32 early;
    181   __u32 pdrop;
    182   __u32 other;
    183   __u32 marked;
    184 };
    185 #define MAX_DPs 16
    186 enum {
    187   TCA_GRED_UNSPEC,
    188   TCA_GRED_PARMS,
    189   TCA_GRED_STAB,
    190   TCA_GRED_DPS,
    191   TCA_GRED_MAX_P,
    192   TCA_GRED_LIMIT,
    193   __TCA_GRED_MAX,
    194 };
    195 #define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
    196 struct tc_gred_qopt {
    197   __u32 limit;
    198   __u32 qth_min;
    199   __u32 qth_max;
    200   __u32 DP;
    201   __u32 backlog;
    202   __u32 qave;
    203   __u32 forced;
    204   __u32 early;
    205   __u32 other;
    206   __u32 pdrop;
    207   __u8 Wlog;
    208   __u8 Plog;
    209   __u8 Scell_log;
    210   __u8 prio;
    211   __u32 packets;
    212   __u32 bytesin;
    213 };
    214 struct tc_gred_sopt {
    215   __u32 DPs;
    216   __u32 def_DP;
    217   __u8 grio;
    218   __u8 flags;
    219   __u16 pad1;
    220 };
    221 enum {
    222   TCA_CHOKE_UNSPEC,
    223   TCA_CHOKE_PARMS,
    224   TCA_CHOKE_STAB,
    225   TCA_CHOKE_MAX_P,
    226   __TCA_CHOKE_MAX,
    227 };
    228 #define TCA_CHOKE_MAX (__TCA_CHOKE_MAX - 1)
    229 struct tc_choke_qopt {
    230   __u32 limit;
    231   __u32 qth_min;
    232   __u32 qth_max;
    233   unsigned char Wlog;
    234   unsigned char Plog;
    235   unsigned char Scell_log;
    236   unsigned char flags;
    237 };
    238 struct tc_choke_xstats {
    239   __u32 early;
    240   __u32 pdrop;
    241   __u32 other;
    242   __u32 marked;
    243   __u32 matched;
    244 };
    245 #define TC_HTB_NUMPRIO 8
    246 #define TC_HTB_MAXDEPTH 8
    247 #define TC_HTB_PROTOVER 3
    248 struct tc_htb_opt {
    249   struct tc_ratespec rate;
    250   struct tc_ratespec ceil;
    251   __u32 buffer;
    252   __u32 cbuffer;
    253   __u32 quantum;
    254   __u32 level;
    255   __u32 prio;
    256 };
    257 struct tc_htb_glob {
    258   __u32 version;
    259   __u32 rate2quantum;
    260   __u32 defcls;
    261   __u32 debug;
    262   __u32 direct_pkts;
    263 };
    264 enum {
    265   TCA_HTB_UNSPEC,
    266   TCA_HTB_PARMS,
    267   TCA_HTB_INIT,
    268   TCA_HTB_CTAB,
    269   TCA_HTB_RTAB,
    270   TCA_HTB_DIRECT_QLEN,
    271   TCA_HTB_RATE64,
    272   TCA_HTB_CEIL64,
    273   TCA_HTB_PAD,
    274   __TCA_HTB_MAX,
    275 };
    276 #define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
    277 struct tc_htb_xstats {
    278   __u32 lends;
    279   __u32 borrows;
    280   __u32 giants;
    281   __u32 tokens;
    282   __u32 ctokens;
    283 };
    284 struct tc_hfsc_qopt {
    285   __u16 defcls;
    286 };
    287 struct tc_service_curve {
    288   __u32 m1;
    289   __u32 d;
    290   __u32 m2;
    291 };
    292 struct tc_hfsc_stats {
    293   __u64 work;
    294   __u64 rtwork;
    295   __u32 period;
    296   __u32 level;
    297 };
    298 enum {
    299   TCA_HFSC_UNSPEC,
    300   TCA_HFSC_RSC,
    301   TCA_HFSC_FSC,
    302   TCA_HFSC_USC,
    303   __TCA_HFSC_MAX,
    304 };
    305 #define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
    306 #define TC_CBQ_MAXPRIO 8
    307 #define TC_CBQ_MAXLEVEL 8
    308 #define TC_CBQ_DEF_EWMA 5
    309 struct tc_cbq_lssopt {
    310   unsigned char change;
    311   unsigned char flags;
    312 #define TCF_CBQ_LSS_BOUNDED 1
    313 #define TCF_CBQ_LSS_ISOLATED 2
    314   unsigned char ewma_log;
    315   unsigned char level;
    316 #define TCF_CBQ_LSS_FLAGS 1
    317 #define TCF_CBQ_LSS_EWMA 2
    318 #define TCF_CBQ_LSS_MAXIDLE 4
    319 #define TCF_CBQ_LSS_MINIDLE 8
    320 #define TCF_CBQ_LSS_OFFTIME 0x10
    321 #define TCF_CBQ_LSS_AVPKT 0x20
    322   __u32 maxidle;
    323   __u32 minidle;
    324   __u32 offtime;
    325   __u32 avpkt;
    326 };
    327 struct tc_cbq_wrropt {
    328   unsigned char flags;
    329   unsigned char priority;
    330   unsigned char cpriority;
    331   unsigned char __reserved;
    332   __u32 allot;
    333   __u32 weight;
    334 };
    335 struct tc_cbq_ovl {
    336   unsigned char strategy;
    337 #define TC_CBQ_OVL_CLASSIC 0
    338 #define TC_CBQ_OVL_DELAY 1
    339 #define TC_CBQ_OVL_LOWPRIO 2
    340 #define TC_CBQ_OVL_DROP 3
    341 #define TC_CBQ_OVL_RCLASSIC 4
    342   unsigned char priority2;
    343   __u16 pad;
    344   __u32 penalty;
    345 };
    346 struct tc_cbq_police {
    347   unsigned char police;
    348   unsigned char __res1;
    349   unsigned short __res2;
    350 };
    351 struct tc_cbq_fopt {
    352   __u32 split;
    353   __u32 defmap;
    354   __u32 defchange;
    355 };
    356 struct tc_cbq_xstats {
    357   __u32 borrows;
    358   __u32 overactions;
    359   __s32 avgidle;
    360   __s32 undertime;
    361 };
    362 enum {
    363   TCA_CBQ_UNSPEC,
    364   TCA_CBQ_LSSOPT,
    365   TCA_CBQ_WRROPT,
    366   TCA_CBQ_FOPT,
    367   TCA_CBQ_OVL_STRATEGY,
    368   TCA_CBQ_RATE,
    369   TCA_CBQ_RTAB,
    370   TCA_CBQ_POLICE,
    371   __TCA_CBQ_MAX,
    372 };
    373 #define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
    374 enum {
    375   TCA_DSMARK_UNSPEC,
    376   TCA_DSMARK_INDICES,
    377   TCA_DSMARK_DEFAULT_INDEX,
    378   TCA_DSMARK_SET_TC_INDEX,
    379   TCA_DSMARK_MASK,
    380   TCA_DSMARK_VALUE,
    381   __TCA_DSMARK_MAX,
    382 };
    383 #define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
    384 enum {
    385   TCA_ATM_UNSPEC,
    386   TCA_ATM_FD,
    387   TCA_ATM_PTR,
    388   TCA_ATM_HDR,
    389   TCA_ATM_EXCESS,
    390   TCA_ATM_ADDR,
    391   TCA_ATM_STATE,
    392   __TCA_ATM_MAX,
    393 };
    394 #define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
    395 enum {
    396   TCA_NETEM_UNSPEC,
    397   TCA_NETEM_CORR,
    398   TCA_NETEM_DELAY_DIST,
    399   TCA_NETEM_REORDER,
    400   TCA_NETEM_CORRUPT,
    401   TCA_NETEM_LOSS,
    402   TCA_NETEM_RATE,
    403   TCA_NETEM_ECN,
    404   TCA_NETEM_RATE64,
    405   TCA_NETEM_PAD,
    406   __TCA_NETEM_MAX,
    407 };
    408 #define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
    409 struct tc_netem_qopt {
    410   __u32 latency;
    411   __u32 limit;
    412   __u32 loss;
    413   __u32 gap;
    414   __u32 duplicate;
    415   __u32 jitter;
    416 };
    417 struct tc_netem_corr {
    418   __u32 delay_corr;
    419   __u32 loss_corr;
    420   __u32 dup_corr;
    421 };
    422 struct tc_netem_reorder {
    423   __u32 probability;
    424   __u32 correlation;
    425 };
    426 struct tc_netem_corrupt {
    427   __u32 probability;
    428   __u32 correlation;
    429 };
    430 struct tc_netem_rate {
    431   __u32 rate;
    432   __s32 packet_overhead;
    433   __u32 cell_size;
    434   __s32 cell_overhead;
    435 };
    436 enum {
    437   NETEM_LOSS_UNSPEC,
    438   NETEM_LOSS_GI,
    439   NETEM_LOSS_GE,
    440   __NETEM_LOSS_MAX
    441 };
    442 #define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1)
    443 struct tc_netem_gimodel {
    444   __u32 p13;
    445   __u32 p31;
    446   __u32 p32;
    447   __u32 p14;
    448   __u32 p23;
    449 };
    450 struct tc_netem_gemodel {
    451   __u32 p;
    452   __u32 r;
    453   __u32 h;
    454   __u32 k1;
    455 };
    456 #define NETEM_DIST_SCALE 8192
    457 #define NETEM_DIST_MAX 16384
    458 enum {
    459   TCA_DRR_UNSPEC,
    460   TCA_DRR_QUANTUM,
    461   __TCA_DRR_MAX
    462 };
    463 #define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
    464 struct tc_drr_stats {
    465   __u32 deficit;
    466 };
    467 #define TC_QOPT_BITMASK 15
    468 #define TC_QOPT_MAX_QUEUE 16
    469 struct tc_mqprio_qopt {
    470   __u8 num_tc;
    471   __u8 prio_tc_map[TC_QOPT_BITMASK + 1];
    472   __u8 hw;
    473   __u16 count[TC_QOPT_MAX_QUEUE];
    474   __u16 offset[TC_QOPT_MAX_QUEUE];
    475 };
    476 enum {
    477   TCA_SFB_UNSPEC,
    478   TCA_SFB_PARMS,
    479   __TCA_SFB_MAX,
    480 };
    481 #define TCA_SFB_MAX (__TCA_SFB_MAX - 1)
    482 struct tc_sfb_qopt {
    483   __u32 rehash_interval;
    484   __u32 warmup_time;
    485   __u32 max;
    486   __u32 bin_size;
    487   __u32 increment;
    488   __u32 decrement;
    489   __u32 limit;
    490   __u32 penalty_rate;
    491   __u32 penalty_burst;
    492 };
    493 struct tc_sfb_xstats {
    494   __u32 earlydrop;
    495   __u32 penaltydrop;
    496   __u32 bucketdrop;
    497   __u32 queuedrop;
    498   __u32 childdrop;
    499   __u32 marked;
    500   __u32 maxqlen;
    501   __u32 maxprob;
    502   __u32 avgprob;
    503 };
    504 #define SFB_MAX_PROB 0xFFFF
    505 enum {
    506   TCA_QFQ_UNSPEC,
    507   TCA_QFQ_WEIGHT,
    508   TCA_QFQ_LMAX,
    509   __TCA_QFQ_MAX
    510 };
    511 #define TCA_QFQ_MAX (__TCA_QFQ_MAX - 1)
    512 struct tc_qfq_stats {
    513   __u32 weight;
    514   __u32 lmax;
    515 };
    516 enum {
    517   TCA_CODEL_UNSPEC,
    518   TCA_CODEL_TARGET,
    519   TCA_CODEL_LIMIT,
    520   TCA_CODEL_INTERVAL,
    521   TCA_CODEL_ECN,
    522   TCA_CODEL_CE_THRESHOLD,
    523   __TCA_CODEL_MAX
    524 };
    525 #define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1)
    526 struct tc_codel_xstats {
    527   __u32 maxpacket;
    528   __u32 count;
    529   __u32 lastcount;
    530   __u32 ldelay;
    531   __s32 drop_next;
    532   __u32 drop_overlimit;
    533   __u32 ecn_mark;
    534   __u32 dropping;
    535   __u32 ce_mark;
    536 };
    537 enum {
    538   TCA_FQ_CODEL_UNSPEC,
    539   TCA_FQ_CODEL_TARGET,
    540   TCA_FQ_CODEL_LIMIT,
    541   TCA_FQ_CODEL_INTERVAL,
    542   TCA_FQ_CODEL_ECN,
    543   TCA_FQ_CODEL_FLOWS,
    544   TCA_FQ_CODEL_QUANTUM,
    545   TCA_FQ_CODEL_CE_THRESHOLD,
    546   TCA_FQ_CODEL_DROP_BATCH_SIZE,
    547   TCA_FQ_CODEL_MEMORY_LIMIT,
    548   __TCA_FQ_CODEL_MAX
    549 };
    550 #define TCA_FQ_CODEL_MAX (__TCA_FQ_CODEL_MAX - 1)
    551 enum {
    552   TCA_FQ_CODEL_XSTATS_QDISC,
    553   TCA_FQ_CODEL_XSTATS_CLASS,
    554 };
    555 struct tc_fq_codel_qd_stats {
    556   __u32 maxpacket;
    557   __u32 drop_overlimit;
    558   __u32 ecn_mark;
    559   __u32 new_flow_count;
    560   __u32 new_flows_len;
    561   __u32 old_flows_len;
    562   __u32 ce_mark;
    563   __u32 memory_usage;
    564   __u32 drop_overmemory;
    565 };
    566 struct tc_fq_codel_cl_stats {
    567   __s32 deficit;
    568   __u32 ldelay;
    569   __u32 count;
    570   __u32 lastcount;
    571   __u32 dropping;
    572   __s32 drop_next;
    573 };
    574 struct tc_fq_codel_xstats {
    575   __u32 type;
    576   union {
    577     struct tc_fq_codel_qd_stats qdisc_stats;
    578     struct tc_fq_codel_cl_stats class_stats;
    579   };
    580 };
    581 enum {
    582   TCA_FQ_UNSPEC,
    583   TCA_FQ_PLIMIT,
    584   TCA_FQ_FLOW_PLIMIT,
    585   TCA_FQ_QUANTUM,
    586   TCA_FQ_INITIAL_QUANTUM,
    587   TCA_FQ_RATE_ENABLE,
    588   TCA_FQ_FLOW_DEFAULT_RATE,
    589   TCA_FQ_FLOW_MAX_RATE,
    590   TCA_FQ_BUCKETS_LOG,
    591   TCA_FQ_FLOW_REFILL_DELAY,
    592   TCA_FQ_ORPHAN_MASK,
    593   TCA_FQ_LOW_RATE_THRESHOLD,
    594   __TCA_FQ_MAX
    595 };
    596 #define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
    597 struct tc_fq_qd_stats {
    598   __u64 gc_flows;
    599   __u64 highprio_packets;
    600   __u64 tcp_retrans;
    601   __u64 throttled;
    602   __u64 flows_plimit;
    603   __u64 pkts_too_long;
    604   __u64 allocation_errors;
    605   __s64 time_next_delayed_flow;
    606   __u32 flows;
    607   __u32 inactive_flows;
    608   __u32 throttled_flows;
    609   __u32 unthrottle_latency_ns;
    610 };
    611 enum {
    612   TCA_HHF_UNSPEC,
    613   TCA_HHF_BACKLOG_LIMIT,
    614   TCA_HHF_QUANTUM,
    615   TCA_HHF_HH_FLOWS_LIMIT,
    616   TCA_HHF_RESET_TIMEOUT,
    617   TCA_HHF_ADMIT_BYTES,
    618   TCA_HHF_EVICT_TIMEOUT,
    619   TCA_HHF_NON_HH_WEIGHT,
    620   __TCA_HHF_MAX
    621 };
    622 #define TCA_HHF_MAX (__TCA_HHF_MAX - 1)
    623 struct tc_hhf_xstats {
    624   __u32 drop_overlimit;
    625   __u32 hh_overlimit;
    626   __u32 hh_tot_count;
    627   __u32 hh_cur_count;
    628 };
    629 enum {
    630   TCA_PIE_UNSPEC,
    631   TCA_PIE_TARGET,
    632   TCA_PIE_LIMIT,
    633   TCA_PIE_TUPDATE,
    634   TCA_PIE_ALPHA,
    635   TCA_PIE_BETA,
    636   TCA_PIE_ECN,
    637   TCA_PIE_BYTEMODE,
    638   __TCA_PIE_MAX
    639 };
    640 #define TCA_PIE_MAX (__TCA_PIE_MAX - 1)
    641 struct tc_pie_xstats {
    642   __u32 prob;
    643   __u32 delay;
    644   __u32 avg_dq_rate;
    645   __u32 packets_in;
    646   __u32 dropped;
    647   __u32 overlimit;
    648   __u32 maxq;
    649   __u32 ecn_mark;
    650 };
    651 #endif
    652