]> git.pld-linux.org Git - packages/linux-libc-headers.git/blob - linux-libc-headers-wrr.patch
- updated
[packages/linux-libc-headers.git] / linux-libc-headers-wrr.patch
1 diff -urN linux-libc-headers-2.6.8.0.org/include/linux/pkt_sched.h linux-libc-headers-2.6.8.0/include/linux/pkt_sched.h
2 --- linux-libc-headers-2.6.8.0.org/include/linux/pkt_sched.h    2004-08-19 21:26:04.663364128 +0200
3 +++ linux-libc-headers-2.6.8.0/include/linux/pkt_sched.h        2004-08-19 21:28:02.623431472 +0200
4 @@ -2,7 +2,8 @@
5  #define __LINUX_PKT_SCHED_H
6  
7  #include <asm/types.h>
8 -
9 +#include <sys/time.h>
10 +#include <linux/if_ether.h>
11  
12  /* Logical priority bands not depending on specific packet scheduler.
13     Every scheduler will map them to real traffic classes, if it has
14 @@ -424,4 +425,114 @@
15         __u32   duplicate;      /* random packet dup  (0=none ~0=100%) */
16         __u32   jitter;         /* random jitter in latency (us) */
17  };
18 +
19 +/* WRR section */
20 +
21 +// A sub weight and of a class
22 +// All numbers are represented as parts of (2^64-1).
23 +struct tc_wrr_class_weight {
24 +  __u64 val;  // Current value                        (0 is not valid)
25 +  __u64 decr; // Value pr bytes                       (2^64-1 is not valid)
26 +  __u64 incr; // Value pr seconds                     (2^64-1 is not valid)
27 +  __u64 min;  // Minimal value                        (0 is not valid)
28 +  __u64 max;  // Minimal value                        (0 is not valid)
29 +
30 +  // The time where the above information was correct:
31 +  time_t tim;
32 +};
33 +
34 +// Pakcet send when modifying a class:
35 +struct tc_wrr_class_modf {
36 +  // Not-valid values are ignored.
37 +  struct tc_wrr_class_weight weight1;
38 +  struct tc_wrr_class_weight weight2;
39 +};
40 +
41 +// Packet returned when quering a class:
42 +struct tc_wrr_class_stats {
43 +  char used; // If this is false the information below is invalid
44 +
45 +  struct tc_wrr_class_modf class_modf;
46 +
47 +  unsigned char addr[ETH_ALEN];
48 +  char usemac;    // True if addr is a MAC address, else it is an IP address
49 +                  // (this value is only for convience, it is always the same
50 +                 //  value as in the qdisc)
51 +  int heappos;    // Current heap position or 0 if not in heap  
52 +  __u64 penal_ls; // Penalty value in heap (ls)
53 +  __u64 penal_ms; // Penalty value in heap (ms)
54 +};
55 +
56 +// Qdisc-wide penalty information (boolean values - 2 not valid)
57 +struct tc_wrr_qdisc_weight {
58 +  char weight_mode; // 0=No automatic change to weight
59 +                    // 1=Decrease normally
60 +                   // 2=Also multiply with number of machines
61 +                   // 3=Instead multiply with priority divided
62 +                   //   with priority of the other.
63 +                   // -1=no change
64 +};
65 +
66 +// Packet send when modifing a qdisc:
67 +struct tc_wrr_qdisc_modf {
68 +  // Not-valid values are ignored:
69 +  struct tc_wrr_qdisc_weight weight1;
70 +  struct tc_wrr_qdisc_weight weight2;
71 +};
72 +
73 +// Packet send when creating a qdisc:
74 +struct tc_wrr_qdisc_crt {
75 +  struct tc_wrr_qdisc_modf qdisc_modf;
76 +  
77 +  char srcaddr;      // 1=lookup source, 0=lookup destination
78 +  char usemac;       // 1=Classify on MAC addresses, 0=classify on IP
79 +  char usemasq;      // 1=Classify based on masqgrading - only valid
80 +                     //   if usemac is zero
81 +  int bands_max;     // Maximal number of bands (i.e.: classes)  
82 +  int proxy_maxconn; // If differnt from 0 then we support proxy remapping
83 +                     // of packets. And this is the number of maximal
84 +                    // concurrent proxy connections.
85 +};
86 +
87 +// Packet returned when quering a qdisc:
88 +struct tc_wrr_qdisc_stats {
89 +  struct tc_wrr_qdisc_crt qdisc_crt;
90 +  int proxy_curconn;                
91 +  int nodes_in_heap;  // Current number of bands wanting to send something
92 +  int bands_cur;      // Current number of bands used (i.e.: MAC/IP addresses seen)
93 +  int bands_reused;   // Number of times this band has been reused.
94 +  int packets_requed; // Number of times packets have been requeued.
95 +  __u64 priosum;      // Sum of priorities in heap where 1 is 2^32
96 +};
97 +
98 +struct tc_wrr_qdisc_modf_std {
99 +  // This indicates which of the tc_wrr_qdisc_modf structers this is:
100 +  char proxy; // 0=This struct
101 +
102 +  // Should we also change a class?
103 +  char change_class;
104 +
105 +  // Only valid if change_class is false
106 +  struct tc_wrr_qdisc_modf qdisc_modf;
107 +
108 +  // Only valid if change_class is true:
109 +  unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0)
110 +  struct tc_wrr_class_modf class_modf; // The change    
111 +};
112 +
113 +// Used for proxyrempping:
114 +struct tc_wrr_qdisc_modf_proxy {
115 +  // This indicates which of the tc_wrr_qdisc_modf structers this is:
116 +  char proxy; // 1=This struct
117 +  
118 +  // This is 1 if the proxyremap information should be reset
119 +  char reset;
120 +  
121 +  // changec is the number of elements in changes.
122 +  int changec; 
123 +  
124 +  // This is an array of type ProxyRemapBlock:
125 +  long changes[0];  
126 +};
127 +
128  #endif
129 diff -urN linux-libc-headers-2.6.8.0.org/include/linux/pkt_sched.h.orig linux-libc-headers-2.6.8.0/include/linux/pkt_sched.h.orig
130 --- linux-libc-headers-2.6.8.0.org/include/linux/pkt_sched.h.orig       2004-08-19 21:25:38.160393192 +0200
131 +++ linux-libc-headers-2.6.8.0/include/linux/pkt_sched.h.orig   1970-01-01 01:00:00.000000000 +0100
132 @@ -1,417 +0,0 @@
133 -#ifndef __LINUX_PKT_SCHED_H
134 -#define __LINUX_PKT_SCHED_H
135 -
136 -#include <asm/types.h>
137 -
138 -
139 -/* Logical priority bands not depending on specific packet scheduler.
140 -   Every scheduler will map them to real traffic classes, if it has
141 -   no more precise mechanism to classify packets.
142 -
143 -   These numbers have no special meaning, though their coincidence
144 -   with obsolete IPv6 values is not occasional :-). New IPv6 drafts
145 -   preferred full anarchy inspired by diffserv group.
146 -
147 -   Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
148 -   class, actually, as rule it will be handled with more care than
149 -   filler or even bulk.
150 - */
151 -
152 -#define TC_PRIO_BESTEFFORT             0
153 -#define TC_PRIO_FILLER                 1
154 -#define TC_PRIO_BULK                   2
155 -#define TC_PRIO_INTERACTIVE_BULK       4
156 -#define TC_PRIO_INTERACTIVE            6
157 -#define TC_PRIO_CONTROL                        7
158 -
159 -#define TC_PRIO_MAX                    15
160 -
161 -/* Generic queue statistics, available for all the elements.
162 -   Particular schedulers may have also their private records.
163 - */
164 -
165 -struct tc_stats
166 -{
167 -       __u64   bytes;                  /* NUmber of enqueues bytes */
168 -       __u32   packets;                /* Number of enqueued packets   */
169 -       __u32   drops;                  /* Packets dropped because of lack of resources */
170 -       __u32   overlimits;             /* Number of throttle events when this
171 -                                        * flow goes out of allocated bandwidth */
172 -       __u32   bps;                    /* Current flow byte rate */
173 -       __u32   pps;                    /* Current flow packet rate */
174 -       __u32   qlen;
175 -       __u32   backlog;
176 -};
177 -
178 -struct tc_estimator
179 -{
180 -       signed char     interval;
181 -       unsigned char   ewma_log;
182 -};
183 -
184 -/* "Handles"
185 -   ---------
186 -
187 -    All the traffic control objects have 32bit identifiers, or "handles".
188 -
189 -    They can be considered as opaque numbers from user API viewpoint,
190 -    but actually they always consist of two fields: major and
191 -    minor numbers, which are interpreted by kernel specially,
192 -    that may be used by applications, though not recommended.
193 -
194 -    F.e. qdisc handles always have minor number equal to zero,
195 -    classes (or flows) have major equal to parent qdisc major, and
196 -    minor uniquely identifying class inside qdisc.
197 -
198 -    Macros to manipulate handles:
199 - */
200 -
201 -#define TC_H_MAJ_MASK (0xFFFF0000U)
202 -#define TC_H_MIN_MASK (0x0000FFFFU)
203 -#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
204 -#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
205 -#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
206 -
207 -#define TC_H_UNSPEC    (0U)
208 -#define TC_H_ROOT      (0xFFFFFFFFU)
209 -#define TC_H_INGRESS    (0xFFFFFFF1U)
210 -
211 -struct tc_ratespec
212 -{
213 -       unsigned char   cell_log;
214 -       unsigned char   __reserved;
215 -       unsigned short  feature;
216 -       short           addend;
217 -       unsigned short  mpu;
218 -       __u32           rate;
219 -};
220 -
221 -/* FIFO section */
222 -
223 -struct tc_fifo_qopt
224 -{
225 -       __u32   limit;  /* Queue length: bytes for bfifo, packets for pfifo */
226 -};
227 -
228 -/* PRIO section */
229 -
230 -#define TCQ_PRIO_BANDS 16
231 -
232 -struct tc_prio_qopt
233 -{
234 -       int     bands;                  /* Number of bands */
235 -       __u8    priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
236 -};
237 -
238 -/* TBF section */
239 -
240 -struct tc_tbf_qopt
241 -{
242 -       struct tc_ratespec rate;
243 -       struct tc_ratespec peakrate;
244 -       __u32           limit;
245 -       __u32           buffer;
246 -       __u32           mtu;
247 -};
248 -
249 -enum
250 -{
251 -       TCA_TBF_UNSPEC,
252 -       TCA_TBF_PARMS,
253 -       TCA_TBF_RTAB,
254 -       TCA_TBF_PTAB,
255 -};
256 -
257 -
258 -/* TEQL section */
259 -
260 -/* TEQL does not require any parameters */
261 -
262 -/* SFQ section */
263 -
264 -struct tc_sfq_qopt
265 -{
266 -       unsigned        quantum;        /* Bytes per round allocated to flow */
267 -       int             perturb_period; /* Period of hash perturbation */
268 -       __u32           limit;          /* Maximal packets in queue */
269 -       unsigned        divisor;        /* Hash divisor  */
270 -       unsigned        flows;          /* Maximal number of flows  */
271 -};
272 -
273 -/*
274 - *  NOTE: limit, divisor and flows are hardwired to code at the moment.
275 - *
276 - *     limit=flows=128, divisor=1024;
277 - *
278 - *     The only reason for this is efficiency, it is possible
279 - *     to change these parameters in compile time.
280 - */
281 -
282 -/* RED section */
283 -
284 -enum
285 -{
286 -       TCA_RED_UNSPEC,
287 -       TCA_RED_PARMS,
288 -       TCA_RED_STAB,
289 -};
290 -
291 -struct tc_red_qopt
292 -{
293 -       __u32           limit;          /* HARD maximal queue length (bytes)    */
294 -       __u32           qth_min;        /* Min average length threshold (bytes) */
295 -       __u32           qth_max;        /* Max average length threshold (bytes) */
296 -       unsigned char   Wlog;           /* log(W)               */
297 -       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */
298 -       unsigned char   Scell_log;      /* cell size for idle damping */
299 -       unsigned char   flags;
300 -#define TC_RED_ECN     1
301 -};
302 -
303 -struct tc_red_xstats
304 -{
305 -       __u32           early;          /* Early drops */
306 -       __u32           pdrop;          /* Drops due to queue limits */
307 -       __u32           other;          /* Drops due to drop() calls */
308 -       __u32           marked;         /* Marked packets */
309 -};
310 -
311 -/* GRED section */
312 -
313 -#define MAX_DPs 16
314 -
315 -enum
316 -{
317 -       TCA_GRED_UNSPEC,
318 -       TCA_GRED_PARMS,
319 -       TCA_GRED_STAB,
320 -       TCA_GRED_DPS,
321 -};
322 -
323 -#define TCA_SET_OFF TCA_GRED_PARMS
324 -struct tc_gred_qopt
325 -{
326 -       __u32           limit;          /* HARD maximal queue length (bytes)    
327 -*/
328 -       __u32           qth_min;        /* Min average length threshold (bytes) 
329 -*/
330 -       __u32           qth_max;        /* Max average length threshold (bytes) 
331 -*/
332 -       __u32           DP;             /* upto 2^32 DPs */
333 -       __u32           backlog;        
334 -       __u32           qave;   
335 -       __u32           forced; 
336 -       __u32           early;  
337 -       __u32           other;  
338 -       __u32           pdrop;  
339 -
340 -       unsigned char   Wlog;           /* log(W)               */
341 -       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */
342 -       unsigned char   Scell_log;      /* cell size for idle damping */
343 -       __u8            prio;           /* prio of this VQ */
344 -       __u32   packets;
345 -       __u32   bytesin;
346 -};
347 -/* gred setup */
348 -struct tc_gred_sopt
349 -{
350 -       __u32           DPs;
351 -       __u32           def_DP;
352 -       __u8            grio;
353 -};
354 -
355 -/* HTB section */
356 -#define TC_HTB_NUMPRIO         8
357 -#define TC_HTB_MAXDEPTH                8
358 -#define TC_HTB_PROTOVER                3 /* the same as HTB and TC's major */
359 -
360 -struct tc_htb_opt
361 -{
362 -       struct tc_ratespec      rate;
363 -       struct tc_ratespec      ceil;
364 -       __u32   buffer;
365 -       __u32   cbuffer;
366 -       __u32   quantum;
367 -       __u32   level;          /* out only */
368 -       __u32   prio;
369 -};
370 -struct tc_htb_glob
371 -{
372 -       __u32 version;          /* to match HTB/TC */
373 -       __u32 rate2quantum;     /* bps->quantum divisor */
374 -       __u32 defcls;           /* default class number */
375 -       __u32 debug;            /* debug flags */
376 -
377 -       /* stats */
378 -       __u32 direct_pkts; /* count of non shapped packets */
379 -};
380 -enum
381 -{
382 -       TCA_HTB_UNSPEC,
383 -       TCA_HTB_PARMS,
384 -       TCA_HTB_INIT,
385 -       TCA_HTB_CTAB,
386 -       TCA_HTB_RTAB,
387 -};
388 -struct tc_htb_xstats
389 -{
390 -       __u32 lends;
391 -       __u32 borrows;
392 -       __u32 giants;   /* too big packets (rate will not be accurate) */
393 -       __u32 tokens;
394 -       __u32 ctokens;
395 -};
396 -
397 -/* HFSC section */
398 -
399 -struct tc_hfsc_qopt
400 -{
401 -       __u16   defcls;         /* default class */
402 -};
403 -
404 -struct tc_service_curve
405 -{
406 -       __u32   m1;             /* slope of the first segment in bps */
407 -       __u32   d;              /* x-projection of the first segment in us */
408 -       __u32   m2;             /* slope of the second segment in bps */
409 -};
410 -
411 -struct tc_hfsc_stats
412 -{
413 -       __u64   work;           /* total work done */
414 -       __u64   rtwork;         /* work done by real-time criteria */
415 -       __u32   period;         /* current period */
416 -       __u32   level;          /* class level in hierarchy */
417 -};
418 -
419 -enum
420 -{
421 -       TCA_HFSC_UNSPEC,
422 -       TCA_HFSC_RSC,
423 -       TCA_HFSC_FSC,
424 -       TCA_HFSC_USC,
425 -       TCA_HFSC_MAX = TCA_HFSC_USC
426 -};
427 -
428 -/* CBQ section */
429 -
430 -#define TC_CBQ_MAXPRIO         8
431 -#define TC_CBQ_MAXLEVEL                8
432 -#define TC_CBQ_DEF_EWMA                5
433 -
434 -struct tc_cbq_lssopt
435 -{
436 -       unsigned char   change;
437 -       unsigned char   flags;
438 -#define TCF_CBQ_LSS_BOUNDED    1
439 -#define TCF_CBQ_LSS_ISOLATED   2
440 -       unsigned char   ewma_log;
441 -       unsigned char   level;
442 -#define TCF_CBQ_LSS_FLAGS      1
443 -#define TCF_CBQ_LSS_EWMA       2
444 -#define TCF_CBQ_LSS_MAXIDLE    4
445 -#define TCF_CBQ_LSS_MINIDLE    8
446 -#define TCF_CBQ_LSS_OFFTIME    0x10
447 -#define TCF_CBQ_LSS_AVPKT      0x20
448 -       __u32           maxidle;
449 -       __u32           minidle;
450 -       __u32           offtime;
451 -       __u32           avpkt;
452 -};
453 -
454 -struct tc_cbq_wrropt
455 -{
456 -       unsigned char   flags;
457 -       unsigned char   priority;
458 -       unsigned char   cpriority;
459 -       unsigned char   __reserved;
460 -       __u32           allot;
461 -       __u32           weight;
462 -};
463 -
464 -struct tc_cbq_ovl
465 -{
466 -       unsigned char   strategy;
467 -#define        TC_CBQ_OVL_CLASSIC      0
468 -#define        TC_CBQ_OVL_DELAY        1
469 -#define        TC_CBQ_OVL_LOWPRIO      2
470 -#define        TC_CBQ_OVL_DROP         3
471 -#define        TC_CBQ_OVL_RCLASSIC     4
472 -       unsigned char   priority2;
473 -       __u32           penalty;
474 -};
475 -
476 -struct tc_cbq_police
477 -{
478 -       unsigned char   police;
479 -       unsigned char   __res1;
480 -       unsigned short  __res2;
481 -};
482 -
483 -struct tc_cbq_fopt
484 -{
485 -       __u32           split;
486 -       __u32           defmap;
487 -       __u32           defchange;
488 -};
489 -
490 -struct tc_cbq_xstats
491 -{
492 -       __u32           borrows;
493 -       __u32           overactions;
494 -       __s32           avgidle;
495 -       __s32           undertime;
496 -};
497 -
498 -enum
499 -{
500 -       TCA_CBQ_UNSPEC,
501 -       TCA_CBQ_LSSOPT,
502 -       TCA_CBQ_WRROPT,
503 -       TCA_CBQ_FOPT,
504 -       TCA_CBQ_OVL_STRATEGY,
505 -       TCA_CBQ_RATE,
506 -       TCA_CBQ_RTAB,
507 -       TCA_CBQ_POLICE,
508 -};
509 -
510 -#define TCA_CBQ_MAX    TCA_CBQ_POLICE
511 -
512 -/* dsmark section */
513 -
514 -enum {
515 -       TCA_DSMARK_UNSPEC,
516 -       TCA_DSMARK_INDICES,
517 -       TCA_DSMARK_DEFAULT_INDEX,
518 -       TCA_DSMARK_SET_TC_INDEX,
519 -       TCA_DSMARK_MASK,
520 -       TCA_DSMARK_VALUE
521 -};
522 -
523 -#define TCA_DSMARK_MAX TCA_DSMARK_VALUE
524 -
525 -/* ATM  section */
526 -
527 -enum {
528 -       TCA_ATM_UNSPEC,
529 -       TCA_ATM_FD,             /* file/socket descriptor */
530 -       TCA_ATM_PTR,            /* pointer to descriptor - later */
531 -       TCA_ATM_HDR,            /* LL header */
532 -       TCA_ATM_EXCESS,         /* excess traffic class (0 for CLP)  */
533 -       TCA_ATM_ADDR,           /* PVC address (for output only) */
534 -       TCA_ATM_STATE           /* VC state (ATM_VS_*; for output only) */
535 -};
536 -
537 -#define TCA_ATM_MAX    TCA_ATM_STATE
538 -
539 -/* Network emulator */
540 -struct tc_netem_qopt
541 -{
542 -       __u32   latency;        /* added delay (us) */
543 -       __u32   limit;          /* fifo limit (packets) */
544 -       __u32   loss;           /* random packet loss (0=none ~0=100%) */
545 -       __u32   gap;            /* re-ordering gap (0 for delay all) */
546 -       __u32   duplicate;      /* random packet dup  (0=none ~0=100%) */
547 -       __u32   jitter;         /* random jitter in latency (us) */
548 -};
549 -#endif
This page took 0.091982 seconds and 4 git commands to generate.