iproute2/tc
Vinicius Costa Gomes 602fae856d 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>
2019-05-04 09:22:15 -07:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
e_bpf.c bpf: make tc's bpf loader generic and move into lib 2016-11-29 12:35:32 -08:00
em_canid.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_cmp.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_ipset.c Include bsd/string.h only in include/utils.h 2018-11-05 08:38:32 -08:00
em_ipt.c tc: Fix compilation error with old iptables 2018-03-27 06:38:52 -07:00
em_meta.c tc/meta: make meta_table static and const 2018-11-19 11:42:44 -08:00
em_nbyte.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
em_u32.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
emp_ematch.l tc/lexer: let quotes actually start strings 2018-01-24 08:49:10 -08:00
emp_ematch.y tc/ematch: fix deprecated yacc warning 2019-04-24 15:10:22 -07:00
f_basic.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
f_bpf.c tc: full JSON support for 'bpf' actions 2019-02-03 09:10:10 -08:00
f_cgroup.c tc actions: Improved batching and time filtered dumping 2017-08-04 13:16:51 -07:00
f_flow.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_flower.c f_flower: fix build with musl libc 2019-01-25 09:20:03 +13:00
f_fw.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_matchall.c tc: add hit counter for matchall 2019-01-21 08:30:07 -08:00
f_route.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_rsvp.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_tcindex.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
f_u32.c tc: f_u32: allow skip_hw and skip_sw flags to be last 2018-11-09 08:12:29 -08:00
m_action.c tc: replace left side comparison 2019-01-28 08:51:03 -08:00
m_bpf.c tc: full JSON support for 'bpf' actions 2019-02-03 09:10:10 -08:00
m_connmark.c tc: m_connmark: fix action error messages 2019-03-19 09:49:07 -07:00
m_csum.c tc: add 'kind' property to 'csum' action 2019-02-03 09:10:38 -08:00
m_ematch.c tc/ematch: make local functions static 2018-11-19 11:42:44 -08:00
m_ematch.h tc/ematch: make local functions static 2018-11-19 11:42:44 -08:00
m_estimator.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
m_gact.c Merge branch 'iproute2-master' into iproute2-next 2018-03-13 17:48:10 -07:00
m_ife.c fix print_0xhex on 32 bit 2018-12-10 14:20:32 -08:00
m_ipt.c tc: replace left side comparison 2019-01-28 08:51:03 -08:00
m_mirred.c Merge branch 'iproute2-master' into iproute2-next 2018-03-13 17:48:10 -07:00
m_nat.c tc: jsonify nat action 2018-06-20 10:20:34 -07:00
m_pedit.c tc/pedit: make functions static 2018-11-19 11:42:44 -08:00
m_pedit.h tc/pedit: make functions static 2018-11-19 11:42:44 -08:00
m_police.c tc/police: make print_police static 2018-11-19 11:42:44 -08:00
m_sample.c tc: jsonify sample action 2018-04-01 08:44:31 -07:00
m_simple.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
m_skbedit.c net:sched: add action inheritdsfield to skbedit 2018-07-19 09:17:56 -07:00
m_skbmod.c Merge branch 'iproute2-master' into iproute2-next 2018-03-13 17:48:10 -07:00
m_tunnel_key.c tc: m_tunnel_key: Allow key-less tunnels 2019-01-22 16:04:07 +13:00
m_vlan.c Merge branch 'iproute2-master' into iproute2-next 2018-03-13 17:48:10 -07:00
m_xt_old.c tc: replace left side comparison 2019-01-28 08:51:03 -08:00
m_xt.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
Makefile tc: add support for plug qdisc 2019-05-04 09:22:14 -07:00
p_eth.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_icmp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_ip6.c tc/pedit: Fix wrong pedit ipv6 structure id 2019-03-01 11:05:00 -08:00
p_ip.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_tcp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
p_udp.c tc/pedit: use structure initialization 2018-11-19 11:42:44 -08:00
q_atm.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_cake.c q_cake: Add support for setting the fwmark option 2019-04-05 15:01:31 -07:00
q_cbq.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_cbs.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_choke.c tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
q_clsact.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
q_codel.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_drr.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_dsmark.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_etf.c tc: Add support for the ETF Qdisc 2018-07-11 17:50:10 -07:00
q_fifo.c tc: jsonify output of q_fifo 2018-10-08 09:22:22 -07:00
q_fq_codel.c tc: Add JSON output of fq_codel stats 2018-03-13 18:05:40 -07:00
q_fq.c tc: fq: support ce_threshold attribute 2018-11-24 07:30:24 -08:00
q_gred.c tc: gred: allow controlling and dumping per-DP RED flags 2018-11-24 07:11:40 -08:00
q_hfsc.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_hhf.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_htb.c fix print_0xhex on 32 bit 2018-12-10 14:20:32 -08:00
q_ingress.c ingress: Don't break JSON output 2018-04-25 11:08:39 -07:00
q_mqprio.c tc/mqprio: Print extra info on invalid args. 2018-09-10 12:14:00 -07:00
q_multiq.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_netem.c q_netem: slotting with non-uniform distribution 2018-08-30 11:08:19 -07:00
q_pie.c tc: pie: change maximum integer value of tc_pie_xstats->prob 2019-03-29 14:26:00 -07:00
q_plug.c tc: add support for plug qdisc 2019-05-04 09:22:14 -07:00
q_prio.c tc: prio: JSON-ify prio output 2018-01-26 13:00:18 -08:00
q_qfq.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_red.c tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
q_rr.c tc: B.W limits can now be specified in %. 2017-11-24 11:22:13 -08:00
q_sfb.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
q_sfq.c tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
q_skbprio.c Add SKB Priority qdisc support in tc(8) 2018-08-14 07:06:43 -07:00
q_taprio.c taprio: Add support for changing schedules 2019-05-04 09:22:15 -07:00
q_tbf.c treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes 2018-02-02 15:01:09 -08:00
static-syms.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_cbq.c tc: support conversions to or from 64 bit nanosecond-based time 2018-08-30 11:04:38 -07:00
tc_cbq.h SPDX license identifiers 2017-11-24 12:21:35 -08:00
tc_class.c tc/class: make filter variables static 2018-11-19 11:42:44 -08:00
tc_common.h Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
tc_core.c tc: support conversions to or from 64 bit nanosecond-based time 2018-08-30 11:04:38 -07:00
tc_core.h tc: support conversions to or from 64 bit nanosecond-based time 2018-08-30 11:04:38 -07:00
tc_estimator.c tc: support conversions to or from 64 bit nanosecond-based time 2018-08-30 11:04:38 -07:00
tc_exec.c tc: replace magic constant 16 with #define 2017-11-24 11:19:18 -08:00
tc_filter.c Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
tc_monitor.c Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
tc_qdisc.c Tree wide: Drop sockaddr_nl arg 2018-10-22 09:43:48 -07:00
tc_red.c tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
tc_red.h tc: move RED flag printing to helper 2018-11-24 07:10:58 -08:00
tc_stab.c drop unneeded include of syslog.h 2017-11-12 16:22:36 -08:00
tc_util.c Merge branch 'iproute2-master' into next 2019-02-22 18:50:39 -08:00
tc_util.h tc/util: make local functions static 2018-11-19 11:42:44 -08:00
tc.c tc: Remove pointless assignments in batch() 2018-10-22 10:05:43 -07:00