Skip to content

Commit 219e288

Browse files
Vijay Subramaniandavem330
authored andcommitted
net: sched: Cleanup PIE comments
Fix incorrect comment reported by Norbert Kiesel. Edit another comment to add more details. Also add references to algorithm (IETF draft and paper) to top of file. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com> CC: Mythili Prabhu <mysuryan@cisco.com> CC: Norbert Kiesel <nkiesel@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 89e1017 commit 219e288

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

net/sched/sch_pie.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*
1616
* ECN support is added by Naeem Khademi <naeemk@ifi.uio.no>
1717
* 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"
1823
*/
1924

2025
#include <linux/module.h>
@@ -36,7 +41,7 @@ struct pie_params {
3641
psched_time_t target; /* user specified target delay in pschedtime */
3742
u32 tupdate; /* timer frequency (in jiffies) */
3843
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 */
4045
u32 beta; /* and are used for shift relative to 1 */
4146
bool ecn; /* true if ecn is enabled */
4247
bool bytemode; /* to scale drop early prob based on pkt size */
@@ -326,10 +331,16 @@ static void calculate_probability(struct Qdisc *sch)
326331
if (qdelay == 0 && qlen != 0)
327332
update_prob = false;
328333

329-
/* Add ranges for alpha and beta, more aggressive for high dropping
330-
* mode and gentle steps for light dropping mode
331-
* In light dropping mode, take gentle steps; in medium dropping mode,
332-
* take medium steps; in high dropping mode, take big steps.
334+
/* In the algorithm, alpha and beta are between 0 and 2 with typical
335+
* value for alpha as 0.125. In this implementation, we use values 0-32
336+
* passed from user space to represent this. Also, alpha and beta have
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.
333344
*/
334345
if (q->vars.prob < MAX_PROB / 100) {
335346
alpha =

0 commit comments

Comments
 (0)