diff -Naur linux-2.6.24.2-old/include/linux/pkt_sched.h linux-2.6.24.2-new/include/linux/pkt_sched.h --- linux-2.6.24.2-old/include/linux/pkt_sched.h 2008-02-11 03:51:11.000000000 -0200 +++ linux-2.6.24.2-new/include/linux/pkt_sched.h 2008-02-24 11:48:13.000000000 -0200 @@ -452,6 +452,7 @@ __u32 gap; /* re-ordering gap (0 for none) */ __u32 duplicate; /* random packet dup (0=none ~0=100%) */ __u32 jitter; /* random jitter in latency (us) */ + __u32 fixed_latency; /* fixed latency form netem */ }; struct tc_netem_corr diff -Naur linux-2.6.24.2-old/net/sched/sch_netem.c linux-2.6.24.2-new/net/sched/sch_netem.c --- linux-2.6.24.2-old/net/sched/sch_netem.c 2008-02-11 03:51:11.000000000 -0200 +++ linux-2.6.24.2-new/net/sched/sch_netem.c 2008-02-24 11:47:40.000000000 -0200 @@ -23,7 +23,7 @@ #include #include -#define VERSION "1.2" +#define VERSION "1.2.1" /* Network Emulation Queuing algorithm. ==================================== @@ -65,6 +65,7 @@ u32 duplicate; u32 reorder; u32 corrupt; + u32 fixed_latency; /* handle fixed delay */ struct crndstate { u32 last; @@ -215,6 +216,13 @@ delay = tabledist(q->latency, q->jitter, &q->delay_cor, q->delay_dist); + /* + * Add fixed delay + */ + if(q->fixed_latency > 0) { + delay += tabledist(q->fixed_latency, 0, &q->delay_cor, q->delay_dist); + } + now = psched_get_time(); cb->time_to_send = now + delay; ++q->counter; @@ -225,6 +233,18 @@ * of the queue. */ cb->time_to_send = psched_get_time(); + + /* + * Add fixed delay + */ + if(q->fixed_latency > 0) { + psched_time_t now; + psched_tdiff_t fixed_delay; + fixed_delay = tabledist(q->fixed_latency, 0, &q->delay_cor, q->delay_dist); + now = psched_get_time(); + cb->time_to_send = now + fixed_delay; + } + q->counter = 0; ret = q->qdisc->ops->requeue(skb, q->qdisc); } @@ -427,6 +447,7 @@ q->counter = 0; q->loss = qopt->loss; q->duplicate = qopt->duplicate; + q->fixed_latency = qopt->fixed_latency; /* for compatibility with earlier versions. * if gap is set, need to assume 100% probability @@ -607,6 +628,7 @@ qopt.loss = q->loss; qopt.gap = q->gap; qopt.duplicate = q->duplicate; + qopt.fixed_latency = q->fixed_latency; RTA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt); cor.delay_corr = q->delay_cor.rho;