diff options
Diffstat (limited to 'net/sched/sch_pie.c')
-rw-r--r-- | net/sched/sch_pie.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c index a255d0200a59..fefeeb73f15f 100644 --- a/net/sched/sch_pie.c +++ b/net/sched/sch_pie.c | |||
@@ -15,6 +15,11 @@ | |||
15 | * | 15 | * |
16 | * ECN support is added by Naeem Khademi <naeemk@ifi.uio.no> | 16 | * ECN support is added by Naeem Khademi <naeemk@ifi.uio.no> |
17 | * University of Oslo, Norway. | 17 | * University of Oslo, Norway. |
18 | * | ||
19 | * References: | ||
20 | * IETF draft submission: http://tools.ietf.org/html/draft-pan-aqm-pie-00 | ||
21 | * IEEE Conference on High Performance Switching and Routing 2013 : | ||
22 | * "PIE: A * Lightweight Control Scheme to Address the Bufferbloat Problem" | ||
18 | */ | 23 | */ |
19 | 24 | ||
20 | #include <linux/module.h> | 25 | #include <linux/module.h> |
@@ -36,7 +41,7 @@ struct pie_params { | |||
36 | psched_time_t target; /* user specified target delay in pschedtime */ | 41 | psched_time_t target; /* user specified target delay in pschedtime */ |
37 | u32 tupdate; /* timer frequency (in jiffies) */ | 42 | u32 tupdate; /* timer frequency (in jiffies) */ |
38 | u32 limit; /* number of packets that can be enqueued */ | 43 | u32 limit; /* number of packets that can be enqueued */ |
39 | u32 alpha; /* alpha and beta are between -4 and 4 */ | 44 | u32 alpha; /* alpha and beta are between 0 and 32 */ |
40 | u32 beta; /* and are used for shift relative to 1 */ | 45 | u32 beta; /* and are used for shift relative to 1 */ |
41 | bool ecn; /* true if ecn is enabled */ | 46 | bool ecn; /* true if ecn is enabled */ |
42 | bool bytemode; /* to scale drop early prob based on pkt size */ | 47 | bool bytemode; /* to scale drop early prob based on pkt size */ |
@@ -326,10 +331,16 @@ static void calculate_probability(struct Qdisc *sch) | |||
326 | if (qdelay == 0 && qlen != 0) | 331 | if (qdelay == 0 && qlen != 0) |
327 | update_prob = false; | 332 | update_prob = false; |
328 | 333 | ||
329 | /* Add ranges for alpha and beta, more aggressive for high dropping | 334 | /* In the algorithm, alpha and beta are between 0 and 2 with typical |
330 | * mode and gentle steps for light dropping mode | 335 | * value for alpha as 0.125. In this implementation, we use values 0-32 |
331 | * In light dropping mode, take gentle steps; in medium dropping mode, | 336 | * passed from user space to represent this. Also, alpha and beta have |
332 | * take medium steps; in high dropping mode, take big steps. | 337 | * unit of HZ and need to be scaled before they can used to update |
338 | * probability. alpha/beta are updated locally below by 1) scaling them | ||
339 | * appropriately 2) scaling down by 16 to come to 0-2 range. | ||
340 | * Please see paper for details. | ||
341 | * | ||
342 | * We scale alpha and beta differently depending on whether we are in | ||
343 | * light, medium or high dropping mode. | ||
333 | */ | 344 | */ |
334 | if (q->vars.prob < MAX_PROB / 100) { | 345 | if (q->vars.prob < MAX_PROB / 100) { |
335 | alpha = | 346 | alpha = |