net: sched: Introduce helpers for qevent blocks
authorPetr Machata <petrm@mellanox.com>
Fri, 26 Jun 2020 22:45:26 +0000 (01:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2020 00:08:28 +0000 (17:08 -0700)
commit3625750f05ecce21a0fce429c1ff85acfffb461b
tree70e057c139e1f1261377f3641f143b6b72f82868
parentaebe4426ccaa4838f36ea805cdf7d76503e65117
net: sched: Introduce helpers for qevent blocks

Qevents are attach points for TC blocks, where filters can be put that are
executed when "interesting events" take place in a qdisc. The data to keep
and the functions to invoke to maintain a qevent will be largely the same
between qevents. Therefore introduce sched-wide helpers for qevent
management.

Currently, similarly to ingress and egress blocks of clsact pseudo-qdisc,
blocks attachment cannot be changed after the qdisc is created. To that
end, add a helper tcf_qevent_validate_change(), which verifies whether
block index attribute is not attached, or if it is, whether its value
matches the current one (i.e. there is no material change).

The function tcf_qevent_handle() should be invoked when qdisc hits the
"interesting event" corresponding to a block. This function releases root
lock for the duration of executing the attached filters, to allow packets
generated through user actions (notably mirred) to be reinserted to the
same qdisc tree.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_api.c