]> git.ipfire.org Git - thirdparty/iproute2.git/commit
Merge branch 'tc-qevent-block' into next
authorDavid Ahern <dsahern@kernel.org>
Mon, 20 Jul 2020 16:36:41 +0000 (16:36 +0000)
committerDavid Ahern <dsahern@kernel.org>
Mon, 20 Jul 2020 16:36:41 +0000 (16:36 +0000)
commit7b6361bf61205e06ffca36cc6356e3b80c83212b
treed2908ce1116b117eed246542f081342372ccca6c
parent9c3be2c0eee01be7832b7900a8be798a19c659a5
parent02dce2fdcec14161807b25a4cf25c91dd454c8b7
Merge branch 'tc-qevent-block' into next

Petr Machata  says:

====================

When a list of filters at a given block is requested, tc first validates
that the block exists before doing the filter query. Currently the
validation routine checks ingress and egress blocks. But now that blocks
can be bound to qevents as well, qevent blocks should be looked for as
well:

    # ip link add up type dummy
    # tc qdisc add dev dummy1 root handle 1: \
         red min 30000 max 60000 avpkt 1000 qevent early_drop block 100
    # tc filter add block 100 pref 1234 handle 102 matchall action drop
    # tc filter show block 100
    Cannot find block "100"

This patchset fixes this issue:

    # tc filter show block 100
    filter protocol all pref 1234 matchall chain 0
    filter protocol all pref 1234 matchall chain 0 handle 0x66
      not_in_hw
            action order 1: gact action drop
             random type none pass val 0
             index 2 ref 1 bind 1

In patch #1, the helpers and necessary infrastructure is introduced,
including a new qdisc_util callback that implements sniffing out bound
blocks in a given qdisc.

In patch #2, RED implements the new callback.

v3:
- Patch #1:
    - Do not pass &ctx->found directly to has_block. Do it through a
      helper variable, so that the callee does not overwrite the result
      already stored in ctx->found.

v2:
- Patch #1:
    - In tc_qdisc_block_exists_cb(), do not initialize 'q'.
    - Propagate upwards errors from q->has_block.

====================

Signed-off-by: David Ahern <dsahern@kernel.org>