linux-stable/net/sched
Md. Islam 043e337f55 sch_netem: Bug fixing in calculating Netem interval
In Kernel 4.15.0+, Netem does not work properly.

Netem setup:

tc qdisc add dev h1-eth0 root handle 1: netem delay 10ms 2ms

Result:

PING 172.16.101.2 (172.16.101.2) 56(84) bytes of data.
64 bytes from 172.16.101.2: icmp_seq=1 ttl=64 time=22.8 ms
64 bytes from 172.16.101.2: icmp_seq=2 ttl=64 time=10.9 ms
64 bytes from 172.16.101.2: icmp_seq=3 ttl=64 time=10.9 ms
64 bytes from 172.16.101.2: icmp_seq=5 ttl=64 time=11.4 ms
64 bytes from 172.16.101.2: icmp_seq=6 ttl=64 time=11.8 ms
64 bytes from 172.16.101.2: icmp_seq=4 ttl=64 time=4303 ms
64 bytes from 172.16.101.2: icmp_seq=10 ttl=64 time=11.2 ms
64 bytes from 172.16.101.2: icmp_seq=11 ttl=64 time=10.3 ms
64 bytes from 172.16.101.2: icmp_seq=7 ttl=64 time=4304 ms
64 bytes from 172.16.101.2: icmp_seq=8 ttl=64 time=4303 ms

Patch:

(rnd % (2 * sigma)) - sigma was overflowing s32. After applying the
patch, I found following output which is desirable.

PING 172.16.101.2 (172.16.101.2) 56(84) bytes of data.
64 bytes from 172.16.101.2: icmp_seq=1 ttl=64 time=21.1 ms
64 bytes from 172.16.101.2: icmp_seq=2 ttl=64 time=8.46 ms
64 bytes from 172.16.101.2: icmp_seq=3 ttl=64 time=9.00 ms
64 bytes from 172.16.101.2: icmp_seq=4 ttl=64 time=11.8 ms
64 bytes from 172.16.101.2: icmp_seq=5 ttl=64 time=8.36 ms
64 bytes from 172.16.101.2: icmp_seq=6 ttl=64 time=11.8 ms
64 bytes from 172.16.101.2: icmp_seq=7 ttl=64 time=8.11 ms
64 bytes from 172.16.101.2: icmp_seq=8 ttl=64 time=10.0 ms
64 bytes from 172.16.101.2: icmp_seq=9 ttl=64 time=11.3 ms
64 bytes from 172.16.101.2: icmp_seq=10 ttl=64 time=11.5 ms
64 bytes from 172.16.101.2: icmp_seq=11 ttl=64 time=10.2 ms

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-07 21:59:12 -05:00
..
act_api.c net_sched: remove unused parameter from act cleanup ops 2017-12-05 18:07:58 -05:00
act_bpf.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_connmark.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_csum.c net/sched: act_csum: don't use spinlock in the fast path 2018-01-23 19:51:46 -05:00
act_gact.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-09 10:37:00 -05:00
act_ife.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_ipt.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_meta_mark.c net: remove duplicate includes 2017-12-13 13:18:46 -05:00
act_meta_skbprio.c net sched actions: change IFE modules alias names 2017-10-12 22:13:20 -07:00
act_meta_skbtcindex.c net: remove duplicate includes 2017-12-13 13:18:46 -05:00
act_mirred.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-09 10:37:00 -05:00
act_nat.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_pedit.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_police.c net: sch: api: add extack support in qdisc_get_rtab 2017-12-21 12:32:50 -05:00
act_sample.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_simple.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_skbedit.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_skbmod.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_tunnel_key.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
act_vlan.c net_sched: switch to exit_batch for action pernet ops 2017-12-13 13:58:41 -05:00
cls_api.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_basic.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_bpf.c cls_bpf: propagate extack to offload delete callback 2018-01-24 16:01:10 -05:00
cls_cgroup.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_flow.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_flower.c cls_flower: propagate extack to delete callback 2018-01-24 16:01:10 -05:00
cls_fw.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_matchall.c cls_matchall: propagate extack to delete callback 2018-01-24 16:01:10 -05:00
cls_route.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_rsvp.c
cls_rsvp.h net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_rsvp6.c
cls_tcindex.c net: sched: propagate extack to cls->destroy callbacks 2018-01-24 16:01:09 -05:00
cls_u32.c cls_u32: fix use after free in u32_destroy_key() 2018-02-06 11:25:54 -05:00
em_canid.c
em_cmp.c
em_ipset.c netfilter: x_tables: move hook state into xt_action_param structure 2016-11-03 10:56:21 +01:00
em_meta.c net: convert sock.sk_refcnt from atomic_t to refcount_t 2017-07-01 07:39:08 -07:00
em_nbyte.c net: sched: em_nbyte: don't add the data offset twice 2018-01-24 14:52:40 -05:00
em_text.c
em_u32.c
ematch.c net: sched: ematch: obtain net pointer from blocks 2017-10-16 21:00:40 +01:00
Kconfig net/sched: kconfig: Remove blank help texts 2018-01-31 10:26:30 -05:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
sch_api.c net: sched: introduce ingress/egress block index attributes for qdisc 2018-01-17 14:53:57 -05:00
sch_atm.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_blackhole.c net_sched: drop packets after root qdisc lock is released 2016-06-25 12:19:35 -04:00
sch_cbq.c net: sch: sch_cbq: add extack support 2017-12-21 12:32:51 -05:00
sch_cbs.c net: sch: sch_cbs: add extack support 2017-12-21 12:32:51 -05:00
sch_choke.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_codel.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_drr.c net: sch: sch_drr: add extack support 2017-12-21 12:32:51 -05:00
sch_dsmark.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_fifo.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_fq.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_fq_codel.c net: sch: api: add extack support in tcf_block_get 2017-12-21 12:32:51 -05:00
sch_generic.c net_sched: implement ->change_tx_queue_len() for pfifo_fast 2018-01-29 12:42:15 -05:00
sch_gred.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_hfsc.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_hhf.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_htb.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_ingress.c net: sched: allow ingress and clsact qdiscs to share filter blocks 2018-01-17 14:53:57 -05:00
sch_mq.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_mqprio.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_multiq.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_netem.c sch_netem: Bug fixing in calculating Netem interval 2018-02-07 21:59:12 -05:00
sch_pie.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_plug.c net: sched: sch: add extack for change qdisc ops 2017-12-21 12:32:50 -05:00
sch_prio.c net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues 2018-01-18 21:11:31 -05:00
sch_qfq.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_red.c net: sched: red: don't reset the backlog on every stat dump 2018-01-17 14:29:32 -05:00
sch_sfb.c net: sch: api: add extack support in qdisc_create_dflt 2017-12-21 12:32:51 -05:00
sch_sfq.c net: sch: api: add extack support in tcf_block_get 2017-12-21 12:32:51 -05:00
sch_tbf.c net: create skb_gso_validate_mac_len() 2018-02-01 09:36:03 -05:00
sch_teql.c net: sched: sch: add extack for init callback 2017-12-21 12:32:50 -05:00