jikos:~ # tc qdisc show
    qdisc tbf 10: dev eth0 root refcnt 2 rate 800Mbit burst 131000b lat 1.0ms 
    jikos:~ # ping -c 1 nix.cz | head -2
    PING nix.cz (195.47.235.3) 56(84) bytes of data.
    64 bytes from info.nix.cz (195.47.235.3): icmp_seq=1 ttl=89 time=1.59 ms

    jikos:~ # tc qdisc add dev eth0 parent 10:1 sfq
    jikos:~ # tc qdisc show
    qdisc tbf 10: dev eth0 root refcnt 2 rate 800Mbit burst 131000b lat 1.0ms 
    qdisc sfq 8008: dev eth0 parent 10:1 limit 127p quantum 1514b depth 127 divisor 1024 

    jikos:~ # ping -c 1 nix.cz | head -2
    PING nix.cz (195.47.235.3) 56(84) bytes of data.
    64 bytes from info.nix.cz (195.47.235.3): icmp_seq=1 ttl=89 time=1.67 ms

    jikos:~ # tc qdisc del dev eth0 parent 10:1 sfq
    jikos:~ # tc qdisc show
    qdisc tbf 10: dev eth0 root refcnt 2 rate 800Mbit burst 131000b lat 1.0ms 
    jikos:~ # ping -c 1 nix.cz | head -2
    PING nix.cz (195.47.235.3) 56(84) bytes of data.
    [ ... nothing happens ... ]
    ^C
    jikos:~ # tc qdisc add dev eth0 parent 10:1 sfq
    jikos:~ # ping -c 1 nix.cz | head -2
    PING nix.cz (195.47.235.3) 56(84) bytes of data.
    64 bytes from info.nix.cz (195.47.235.3): icmp_seq=1 ttl=89 time=1.66 ms

This boils down to the problem of some qdiscs being "hidden" from user, so even though 'tc qdisc show' displays two identical configurations, they are actually not identical (one of them causes dysfunctional networking).

IOW, this works:

    jikos:~ # tc qdisc show
    qdisc tbf 10: dev eth0 root refcnt 2 rate 800Mbit burst 131000b lat 1.0ms 

and this (after performing add/delete operation) doesn't:

    jikos:~ # tc qdisc show
    qdisc tbf 10: dev eth0 root refcnt 2 rate 800Mbit burst 131000b lat 1.0ms 

Some of the qdiscs are hidden because qdisc_match_from_root() function would have to scan hundreds of entries. This problem could be mitigated by converting this data structure to hashtable; that'd allow us to avoid hiding qdiscs, and hence making 'tc qdisc show' to actually display real state of the affairs.

On top of that, complete determinism will be achieved when the initial qdisc (for TBF) is stored separately, so that it can be restored during delete.

Reference thread: http://marc.info/?t=146064520100007&r=1

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 14 Hack Week 15

Activity

  • over 8 years ago: david_chang liked this project.
  • over 8 years ago: mkubecek liked this project.
  • over 8 years ago: ndas liked this project.
  • over 8 years ago: jkosina started this project.
  • over 8 years ago: jkosina originated this project.

  • Comments

    • jkosina
      almost 8 years ago by jkosina | Reply

      I added basic prerequisities during Hackweek 14:

      http://git.kernel.org/linus/59cc1f61f09c26ce82c308e24b76141e1efe99f8 http://git.kernel.org/linus/69012ae425d76ecacc573ecdbd2c360bd8c2b842 http://git.kernel.org/linus/ea3274695353127d12155d45be1f2d62ab19c897

      The plan during hackweek 15 is to implement conditional dumping of invisible qdiscs, selectable by a dedicate netlink attribute as discussed in

      http://lkml.kernel.org/r/20161021.105935.1907696543877061916.davem@davemloft.net

      The development is being performed in (rebasing)

      https://git.kernel.org/cgit/linux/kernel/git/jikos/jikos.git/log/?h=might-rebase/net-sched-qdiscs

    Similar Projects

    This project is one of its kind!