aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pkt_sched.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-04 12:50:58 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-04 12:50:58 -0500
commitd94d9fee9fa4e66a0b91640a694b8b10177075b3 (patch)
tree330b2b19e63c92f1fef3d9dbe0733ddeb0109664 /include/linux/pkt_sched.h
parentb8883a65be2d925ea82b14ca0068ce9a6c8bac1f (diff)
net: cleanup include/linux
This cleanup patch puts struct/union/enum opening braces, in first line to ease grep games. struct something { becomes : struct something { Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pkt_sched.h')
-rw-r--r--include/linux/pkt_sched.h111
1 files changed, 37 insertions, 74 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d51a2b3e221e..2cfa4bc8dea6 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -29,8 +29,7 @@
29 Particular schedulers may have also their private records. 29 Particular schedulers may have also their private records.
30 */ 30 */
31 31
32struct tc_stats 32struct tc_stats {
33{
34 __u64 bytes; /* NUmber of enqueues bytes */ 33 __u64 bytes; /* NUmber of enqueues bytes */
35 __u32 packets; /* Number of enqueued packets */ 34 __u32 packets; /* Number of enqueued packets */
36 __u32 drops; /* Packets dropped because of lack of resources */ 35 __u32 drops; /* Packets dropped because of lack of resources */
@@ -42,8 +41,7 @@ struct tc_stats
42 __u32 backlog; 41 __u32 backlog;
43}; 42};
44 43
45struct tc_estimator 44struct tc_estimator {
46{
47 signed char interval; 45 signed char interval;
48 unsigned char ewma_log; 46 unsigned char ewma_log;
49}; 47};
@@ -75,8 +73,7 @@ struct tc_estimator
75#define TC_H_ROOT (0xFFFFFFFFU) 73#define TC_H_ROOT (0xFFFFFFFFU)
76#define TC_H_INGRESS (0xFFFFFFF1U) 74#define TC_H_INGRESS (0xFFFFFFF1U)
77 75
78struct tc_ratespec 76struct tc_ratespec {
79{
80 unsigned char cell_log; 77 unsigned char cell_log;
81 unsigned char __reserved; 78 unsigned char __reserved;
82 unsigned short overhead; 79 unsigned short overhead;
@@ -109,8 +106,7 @@ enum {
109 106
110/* FIFO section */ 107/* FIFO section */
111 108
112struct tc_fifo_qopt 109struct tc_fifo_qopt {
113{
114 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ 110 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
115}; 111};
116 112
@@ -119,8 +115,7 @@ struct tc_fifo_qopt
119#define TCQ_PRIO_BANDS 16 115#define TCQ_PRIO_BANDS 16
120#define TCQ_MIN_PRIO_BANDS 2 116#define TCQ_MIN_PRIO_BANDS 2
121 117
122struct tc_prio_qopt 118struct tc_prio_qopt {
123{
124 int bands; /* Number of bands */ 119 int bands; /* Number of bands */
125 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 120 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
126}; 121};
@@ -134,8 +129,7 @@ struct tc_multiq_qopt {
134 129
135/* TBF section */ 130/* TBF section */
136 131
137struct tc_tbf_qopt 132struct tc_tbf_qopt {
138{
139 struct tc_ratespec rate; 133 struct tc_ratespec rate;
140 struct tc_ratespec peakrate; 134 struct tc_ratespec peakrate;
141 __u32 limit; 135 __u32 limit;
@@ -143,8 +137,7 @@ struct tc_tbf_qopt
143 __u32 mtu; 137 __u32 mtu;
144}; 138};
145 139
146enum 140enum {
147{
148 TCA_TBF_UNSPEC, 141 TCA_TBF_UNSPEC,
149 TCA_TBF_PARMS, 142 TCA_TBF_PARMS,
150 TCA_TBF_RTAB, 143 TCA_TBF_RTAB,
@@ -161,8 +154,7 @@ enum
161 154
162/* SFQ section */ 155/* SFQ section */
163 156
164struct tc_sfq_qopt 157struct tc_sfq_qopt {
165{
166 unsigned quantum; /* Bytes per round allocated to flow */ 158 unsigned quantum; /* Bytes per round allocated to flow */
167 int perturb_period; /* Period of hash perturbation */ 159 int perturb_period; /* Period of hash perturbation */
168 __u32 limit; /* Maximal packets in queue */ 160 __u32 limit; /* Maximal packets in queue */
@@ -170,8 +162,7 @@ struct tc_sfq_qopt
170 unsigned flows; /* Maximal number of flows */ 162 unsigned flows; /* Maximal number of flows */
171}; 163};
172 164
173struct tc_sfq_xstats 165struct tc_sfq_xstats {
174{
175 __s32 allot; 166 __s32 allot;
176}; 167};
177 168
@@ -186,8 +177,7 @@ struct tc_sfq_xstats
186 177
187/* RED section */ 178/* RED section */
188 179
189enum 180enum {
190{
191 TCA_RED_UNSPEC, 181 TCA_RED_UNSPEC,
192 TCA_RED_PARMS, 182 TCA_RED_PARMS,
193 TCA_RED_STAB, 183 TCA_RED_STAB,
@@ -196,8 +186,7 @@ enum
196 186
197#define TCA_RED_MAX (__TCA_RED_MAX - 1) 187#define TCA_RED_MAX (__TCA_RED_MAX - 1)
198 188
199struct tc_red_qopt 189struct tc_red_qopt {
200{
201 __u32 limit; /* HARD maximal queue length (bytes) */ 190 __u32 limit; /* HARD maximal queue length (bytes) */
202 __u32 qth_min; /* Min average length threshold (bytes) */ 191 __u32 qth_min; /* Min average length threshold (bytes) */
203 __u32 qth_max; /* Max average length threshold (bytes) */ 192 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -209,8 +198,7 @@ struct tc_red_qopt
209#define TC_RED_HARDDROP 2 198#define TC_RED_HARDDROP 2
210}; 199};
211 200
212struct tc_red_xstats 201struct tc_red_xstats {
213{
214 __u32 early; /* Early drops */ 202 __u32 early; /* Early drops */
215 __u32 pdrop; /* Drops due to queue limits */ 203 __u32 pdrop; /* Drops due to queue limits */
216 __u32 other; /* Drops due to drop() calls */ 204 __u32 other; /* Drops due to drop() calls */
@@ -221,8 +209,7 @@ struct tc_red_xstats
221 209
222#define MAX_DPs 16 210#define MAX_DPs 16
223 211
224enum 212enum {
225{
226 TCA_GRED_UNSPEC, 213 TCA_GRED_UNSPEC,
227 TCA_GRED_PARMS, 214 TCA_GRED_PARMS,
228 TCA_GRED_STAB, 215 TCA_GRED_STAB,
@@ -232,8 +219,7 @@ enum
232 219
233#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 220#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
234 221
235struct tc_gred_qopt 222struct tc_gred_qopt {
236{
237 __u32 limit; /* HARD maximal queue length (bytes) */ 223 __u32 limit; /* HARD maximal queue length (bytes) */
238 __u32 qth_min; /* Min average length threshold (bytes) */ 224 __u32 qth_min; /* Min average length threshold (bytes) */
239 __u32 qth_max; /* Max average length threshold (bytes) */ 225 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -253,8 +239,7 @@ struct tc_gred_qopt
253}; 239};
254 240
255/* gred setup */ 241/* gred setup */
256struct tc_gred_sopt 242struct tc_gred_sopt {
257{
258 __u32 DPs; 243 __u32 DPs;
259 __u32 def_DP; 244 __u32 def_DP;
260 __u8 grio; 245 __u8 grio;
@@ -267,8 +252,7 @@ struct tc_gred_sopt
267#define TC_HTB_MAXDEPTH 8 252#define TC_HTB_MAXDEPTH 8
268#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ 253#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
269 254
270struct tc_htb_opt 255struct tc_htb_opt {
271{
272 struct tc_ratespec rate; 256 struct tc_ratespec rate;
273 struct tc_ratespec ceil; 257 struct tc_ratespec ceil;
274 __u32 buffer; 258 __u32 buffer;
@@ -277,8 +261,7 @@ struct tc_htb_opt
277 __u32 level; /* out only */ 261 __u32 level; /* out only */
278 __u32 prio; 262 __u32 prio;
279}; 263};
280struct tc_htb_glob 264struct tc_htb_glob {
281{
282 __u32 version; /* to match HTB/TC */ 265 __u32 version; /* to match HTB/TC */
283 __u32 rate2quantum; /* bps->quantum divisor */ 266 __u32 rate2quantum; /* bps->quantum divisor */
284 __u32 defcls; /* default class number */ 267 __u32 defcls; /* default class number */
@@ -287,8 +270,7 @@ struct tc_htb_glob
287 /* stats */ 270 /* stats */
288 __u32 direct_pkts; /* count of non shapped packets */ 271 __u32 direct_pkts; /* count of non shapped packets */
289}; 272};
290enum 273enum {
291{
292 TCA_HTB_UNSPEC, 274 TCA_HTB_UNSPEC,
293 TCA_HTB_PARMS, 275 TCA_HTB_PARMS,
294 TCA_HTB_INIT, 276 TCA_HTB_INIT,
@@ -299,8 +281,7 @@ enum
299 281
300#define TCA_HTB_MAX (__TCA_HTB_MAX - 1) 282#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
301 283
302struct tc_htb_xstats 284struct tc_htb_xstats {
303{
304 __u32 lends; 285 __u32 lends;
305 __u32 borrows; 286 __u32 borrows;
306 __u32 giants; /* too big packets (rate will not be accurate) */ 287 __u32 giants; /* too big packets (rate will not be accurate) */
@@ -310,28 +291,24 @@ struct tc_htb_xstats
310 291
311/* HFSC section */ 292/* HFSC section */
312 293
313struct tc_hfsc_qopt 294struct tc_hfsc_qopt {
314{
315 __u16 defcls; /* default class */ 295 __u16 defcls; /* default class */
316}; 296};
317 297
318struct tc_service_curve 298struct tc_service_curve {
319{
320 __u32 m1; /* slope of the first segment in bps */ 299 __u32 m1; /* slope of the first segment in bps */
321 __u32 d; /* x-projection of the first segment in us */ 300 __u32 d; /* x-projection of the first segment in us */
322 __u32 m2; /* slope of the second segment in bps */ 301 __u32 m2; /* slope of the second segment in bps */
323}; 302};
324 303
325struct tc_hfsc_stats 304struct tc_hfsc_stats {
326{
327 __u64 work; /* total work done */ 305 __u64 work; /* total work done */
328 __u64 rtwork; /* work done by real-time criteria */ 306 __u64 rtwork; /* work done by real-time criteria */
329 __u32 period; /* current period */ 307 __u32 period; /* current period */
330 __u32 level; /* class level in hierarchy */ 308 __u32 level; /* class level in hierarchy */
331}; 309};
332 310
333enum 311enum {
334{
335 TCA_HFSC_UNSPEC, 312 TCA_HFSC_UNSPEC,
336 TCA_HFSC_RSC, 313 TCA_HFSC_RSC,
337 TCA_HFSC_FSC, 314 TCA_HFSC_FSC,
@@ -348,8 +325,7 @@ enum
348#define TC_CBQ_MAXLEVEL 8 325#define TC_CBQ_MAXLEVEL 8
349#define TC_CBQ_DEF_EWMA 5 326#define TC_CBQ_DEF_EWMA 5
350 327
351struct tc_cbq_lssopt 328struct tc_cbq_lssopt {
352{
353 unsigned char change; 329 unsigned char change;
354 unsigned char flags; 330 unsigned char flags;
355#define TCF_CBQ_LSS_BOUNDED 1 331#define TCF_CBQ_LSS_BOUNDED 1
@@ -368,8 +344,7 @@ struct tc_cbq_lssopt
368 __u32 avpkt; 344 __u32 avpkt;
369}; 345};
370 346
371struct tc_cbq_wrropt 347struct tc_cbq_wrropt {
372{
373 unsigned char flags; 348 unsigned char flags;
374 unsigned char priority; 349 unsigned char priority;
375 unsigned char cpriority; 350 unsigned char cpriority;
@@ -378,8 +353,7 @@ struct tc_cbq_wrropt
378 __u32 weight; 353 __u32 weight;
379}; 354};
380 355
381struct tc_cbq_ovl 356struct tc_cbq_ovl {
382{
383 unsigned char strategy; 357 unsigned char strategy;
384#define TC_CBQ_OVL_CLASSIC 0 358#define TC_CBQ_OVL_CLASSIC 0
385#define TC_CBQ_OVL_DELAY 1 359#define TC_CBQ_OVL_DELAY 1
@@ -391,30 +365,26 @@ struct tc_cbq_ovl
391 __u32 penalty; 365 __u32 penalty;
392}; 366};
393 367
394struct tc_cbq_police 368struct tc_cbq_police {
395{
396 unsigned char police; 369 unsigned char police;
397 unsigned char __res1; 370 unsigned char __res1;
398 unsigned short __res2; 371 unsigned short __res2;
399}; 372};
400 373
401struct tc_cbq_fopt 374struct tc_cbq_fopt {
402{
403 __u32 split; 375 __u32 split;
404 __u32 defmap; 376 __u32 defmap;
405 __u32 defchange; 377 __u32 defchange;
406}; 378};
407 379
408struct tc_cbq_xstats 380struct tc_cbq_xstats {
409{
410 __u32 borrows; 381 __u32 borrows;
411 __u32 overactions; 382 __u32 overactions;
412 __s32 avgidle; 383 __s32 avgidle;
413 __s32 undertime; 384 __s32 undertime;
414}; 385};
415 386
416enum 387enum {
417{
418 TCA_CBQ_UNSPEC, 388 TCA_CBQ_UNSPEC,
419 TCA_CBQ_LSSOPT, 389 TCA_CBQ_LSSOPT,
420 TCA_CBQ_WRROPT, 390 TCA_CBQ_WRROPT,
@@ -459,8 +429,7 @@ enum {
459 429
460/* Network emulator */ 430/* Network emulator */
461 431
462enum 432enum {
463{
464 TCA_NETEM_UNSPEC, 433 TCA_NETEM_UNSPEC,
465 TCA_NETEM_CORR, 434 TCA_NETEM_CORR,
466 TCA_NETEM_DELAY_DIST, 435 TCA_NETEM_DELAY_DIST,
@@ -471,8 +440,7 @@ enum
471 440
472#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) 441#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
473 442
474struct tc_netem_qopt 443struct tc_netem_qopt {
475{
476 __u32 latency; /* added delay (us) */ 444 __u32 latency; /* added delay (us) */
477 __u32 limit; /* fifo limit (packets) */ 445 __u32 limit; /* fifo limit (packets) */
478 __u32 loss; /* random packet loss (0=none ~0=100%) */ 446 __u32 loss; /* random packet loss (0=none ~0=100%) */
@@ -481,21 +449,18 @@ struct tc_netem_qopt
481 __u32 jitter; /* random jitter in latency (us) */ 449 __u32 jitter; /* random jitter in latency (us) */
482}; 450};
483 451
484struct tc_netem_corr 452struct tc_netem_corr {
485{
486 __u32 delay_corr; /* delay correlation */ 453 __u32 delay_corr; /* delay correlation */
487 __u32 loss_corr; /* packet loss correlation */ 454 __u32 loss_corr; /* packet loss correlation */
488 __u32 dup_corr; /* duplicate correlation */ 455 __u32 dup_corr; /* duplicate correlation */
489}; 456};
490 457
491struct tc_netem_reorder 458struct tc_netem_reorder {
492{
493 __u32 probability; 459 __u32 probability;
494 __u32 correlation; 460 __u32 correlation;
495}; 461};
496 462
497struct tc_netem_corrupt 463struct tc_netem_corrupt {
498{
499 __u32 probability; 464 __u32 probability;
500 __u32 correlation; 465 __u32 correlation;
501}; 466};
@@ -504,8 +469,7 @@ struct tc_netem_corrupt
504 469
505/* DRR */ 470/* DRR */
506 471
507enum 472enum {
508{
509 TCA_DRR_UNSPEC, 473 TCA_DRR_UNSPEC,
510 TCA_DRR_QUANTUM, 474 TCA_DRR_QUANTUM,
511 __TCA_DRR_MAX 475 __TCA_DRR_MAX
@@ -513,8 +477,7 @@ enum
513 477
514#define TCA_DRR_MAX (__TCA_DRR_MAX - 1) 478#define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
515 479
516struct tc_drr_stats 480struct tc_drr_stats {
517{
518 __u32 deficit; 481 __u32 deficit;
519}; 482};
520 483