]> git.proxmox.com Git - mirror_iproute2.git/commit
taprio: Add support for changing schedules
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Mon, 29 Apr 2019 22:52:18 +0000 (15:52 -0700)
committerDavid Ahern <dsahern@gmail.com>
Sat, 4 May 2019 16:22:15 +0000 (09:22 -0700)
commit602fae856d80bbaa365fd0421e3f2c2417ea804f
tree19881f4d61484e1fe8ccc1628b74c30bd3ee4ec4
parentc865c52365f477eeb7286b3387d18184bfbf08c6
taprio: Add support for changing schedules

This allows for a new schedule to be specified during runtime, without
removing the current one.

For that, the semantics of the 'tc qdisc change' operation in the
context of taprio is that if "change" is called and there is a running
schedule, a new schedule is created and the base-time (let's call it
X) of this new schedule is used so at instant X, it becomes the
"current" schedule. So, in short, "change" doesn't change the current
schedule, it creates a new one and sets it up to it becomes the
current one at some point.

In IEEE 802.1Q terms, it means that we have support for the
"Oper" (current and read-only) and "Admin" (future and mutable)
schedules.

Example of creating the first schedule, then adding a new one:

(1)
tc qdisc add dev IFACE parent root handle 100 taprio \
             num_tc 1 \
      map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \
      queues 1@0 \
      sched-entry S 0x1 1000000 \
      sched-entry S 0x0 2000000 \
      sched-entry S 0x1 3000000 \
      sched-entry S 0x0 4000000 \
      base-time 100000000 \
      clockid CLOCK_TAI

(2)
tc qdisc change dev IFACE parent root handle 100 taprio \
      base-time 7500000000000 \
      sched-entry S 0x0 5000000 \
              sched-entry S 0x1 5000000 \

It was necessary to fix a bug, so the clockid doesn't need to be
specified when changing the schedule.

Most of the changes are related to make it easier to reuse the same
function for printing the "admin" and "oper" schedules.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/q_taprio.c