linux-stable/net/sched
Petr Machata 14bc175d9c net: sched: Allow extending set of supported RED flags
The qdiscs RED, GRED, SFQ and CHOKE use different subsets of the same pool
of global RED flags. These are passed in tc_red_qopt.flags. However none of
these qdiscs validate the flag field, and just copy it over wholesale to
internal structures, and later dump it back. (An exception is GRED, which
does validate for VQs -- however not for the main setup.)

A broken userspace can therefore configure a qdisc with arbitrary
unsupported flags, and later expect to see the flags on qdisc dump. The
current ABI therefore allows storage of several bits of custom data to
qdisc instances of the types mentioned above. How many bits, depends on
which flags are meaningful for the qdisc in question. E.g. SFQ recognizes
flags ECN and HARDDROP, and the rest is not interpreted.

If SFQ ever needs to support ADAPTATIVE, it needs another way of doing it,
and at the same time it needs to retain the possibility to store 6 bits of
uninterpreted data. Likewise RED, which adds a new flag later in this
patchset.

To that end, this patch adds a new function, red_get_flags(), to split the
passed flags of RED-like qdiscs to flags and user bits, and
red_validate_flags() to validate the resulting configuration. It further
adds a new attribute, TCA_RED_FLAGS, to pass arbitrary flags.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-14 21:03:46 -07:00
..
act_api.c sched: act: allow user to specify type of HW stats for a filter 2020-03-08 21:07:48 -07:00
act_bpf.c net: sched: update action implementations to support flags 2019-10-30 18:07:51 -07:00
act_connmark.c net: sched: update action implementations to support flags 2019-10-30 18:07:51 -07:00
act_csum.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:42:43 -08:00
act_ct.c net/sched: act_ct: Enable hardware offload of flow table entires 2020-03-12 15:00:39 -07:00
act_ctinfo.c net: sched: act_ctinfo: fix memory leak 2020-01-19 16:02:15 +01:00
act_gact.c net: sched: update action implementations to support flags 2019-10-30 18:07:51 -07:00
act_ife.c net/sched: act_ife: initalize ife->metalist earlier 2020-01-17 10:58:15 +01:00
act_ipt.c net: sched: update action implementations to support flags 2019-10-30 18:07:51 -07:00
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c
act_mirred.c net/sched: act_mirred: Pull mac prior redir to non mac_header_xmit device 2019-12-27 16:35:32 -08:00
act_mpls.c net: Fixed updating of ethertype in skb_mpls_push() 2019-12-04 17:11:25 -08:00
act_nat.c icmp: remove duplicate code 2019-11-05 14:03:11 -08:00
act_pedit.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-22 16:27:24 -08:00
act_police.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:42:43 -08:00
act_sample.c net: sched: lock action when translating it to flow_action infra 2020-02-17 14:17:02 -08:00
act_simple.c net_sched: extend packet counter to 64bit 2019-11-05 18:20:55 -08:00
act_skbedit.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:42:43 -08:00
act_skbmod.c net: sched: update action implementations to support flags 2019-10-30 18:07:51 -07:00
act_tunnel_key.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:42:43 -08:00
act_vlan.c Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-11-26 15:42:43 -08:00
cls_api.c net/sched: act_ct: Enable hardware offload of flow table entires 2020-03-12 15:00:39 -07:00
cls_basic.c net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
cls_bpf.c net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
cls_cgroup.c
cls_flow.c
cls_flower.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-21 13:39:34 -08:00
cls_fw.c net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
cls_matchall.c net: sched: don't take rtnl lock during flow_action setup 2020-02-17 14:17:02 -08:00
cls_route.c net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
cls_rsvp.c
cls_rsvp.h cls_rsvp: fix rsvp_policy 2020-02-01 12:25:06 -08:00
cls_rsvp6.c
cls_tcindex.c net_sched: fix a resource leak in tcindex_set_parms() 2020-02-05 14:11:57 +01:00
cls_u32.c net_sched: fix ops->bind_class() implementations 2020-01-27 10:51:43 +01:00
em_canid.c
em_cmp.c
em_ipset.c
em_ipt.c net: sched: Replace zero-length array with flexible-array member 2020-02-29 21:27:02 -08:00
em_meta.c net: annotate lockless accesses to sk->sk_max_ack_backlog 2019-11-06 16:14:48 -08:00
em_nbyte.c net: sched: Replace zero-length array with flexible-array member 2020-02-29 21:27:02 -08:00
em_text.c
em_u32.c
ematch.c net_sched: ematch: reject invalid TCF_EM_SIMPLE 2020-01-27 10:55:26 +01:00
Kconfig net/sched: act_ct: Create nf flow table per zone 2020-03-03 15:09:12 -08:00
Makefile net: sched: add Flow Queue PIE packet scheduler 2020-01-23 11:38:31 +01:00
sch_api.c net_sched: walk through all child classes in tc_bind_tclass() 2020-01-27 10:52:46 +01:00
sch_atm.c net: sched: Replace zero-length array with flexible-array member 2020-02-29 21:27:02 -08:00
sch_blackhole.c
sch_cake.c net: sched: use skb_list_walk_safe helper for gso segments 2020-01-14 11:48:41 -08:00
sch_cbq.c
sch_cbs.c
sch_choke.c sch_choke: Use kvcalloc 2020-01-29 11:58:10 +01:00
sch_codel.c
sch_drr.c
sch_dsmark.c
sch_etf.c
sch_ets.c net: sch_ets: Make the ETS qdisc offloadable 2019-12-18 13:32:29 -08:00
sch_fifo.c net: sched: Make FIFO Qdisc offloadable 2020-03-05 14:03:31 -08:00
sch_fq.c net: fq: add missing attribute validation for orphan mask 2020-03-03 13:28:48 -08:00
sch_fq_codel.c fq_codel: do not include <linux/jhash.h> 2019-10-22 15:31:42 -07:00
sch_fq_pie.c pie: remove pie_vars->accu_prob_overflows 2020-03-04 13:25:55 -08:00
sch_generic.c Revert "net: sched: make newly activated qdiscs visible" 2020-03-12 11:19:24 -07:00
sch_gred.c
sch_hfsc.c
sch_hhf.c net/flow_dissector: switch to siphash 2019-10-23 20:13:22 -07:00
sch_htb.c
sch_ingress.c net: sched: Pass ingress block to tcf_classify_ingress 2020-02-19 17:49:48 -08:00
sch_mq.c net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues 2019-12-03 11:53:55 -08:00
sch_mqprio.c mqprio: Fix out-of-bounds access in mqprio_dump 2019-12-06 11:58:45 -08:00
sch_multiq.c net: sched: fix tc -s class show no bstats on class with nolock subqueues 2019-11-30 10:38:40 -08:00
sch_netem.c net: sched: Replace zero-length array with flexible-array member 2020-02-29 21:27:02 -08:00
sch_pie.c net: sched: pie: change tc_pie_xstats->prob 2020-03-09 18:05:55 -07:00
sch_plug.c
sch_prio.c net: sch_prio: When ungrafting, replace with FIFO 2020-01-08 12:45:53 -08:00
sch_qfq.c
sch_red.c net: sched: Allow extending set of supported RED flags 2020-03-14 21:03:46 -07:00
sch_sfb.c net/flow_dissector: switch to siphash 2019-10-23 20:13:22 -07:00
sch_sfq.c net/flow_dissector: switch to siphash 2019-10-23 20:13:22 -07:00
sch_skbprio.c
sch_taprio.c taprio: Fix sending packets without dequeueing them 2020-03-12 11:25:08 -07:00
sch_tbf.c net: sched: Make TBF Qdisc offloadable 2020-01-25 10:56:31 +01:00
sch_teql.c