Skip to content

net/sched: avoid walk() while deleting filters that still use rtnl_lock

Davide Caratti netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Revert "net/sched: cls_u32: fix refcount leak in the error path of u32_change()"net/sched/cls_u32.c+0 -250 replies
2/2net/sched: add delete_empty() to filters and use it in cls_flowerinclude/net/sch_generic.h net/sched/cls_api.c net/sched/cls_flower.c+29 -253 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] net/sched: avoid walk() while deleting filters that still use rtnl_lock

we don't need to use walk() on deletion of TC filters, at least for those implementations that don't have TCF_PROTO_OPS_DOIT_UNLOCKED.

- patch 1/2 restores walk() semantic in cls_u32, that was recently changed to fix semi-configured filters in the error path of u32_change().
- patch 2/2 moves the delete_empty() logic to cls_flower, the only filter that currently needs to guard against concurrent insert/delete. For flower, the current delete_empty() still [ab,]uses walk(), to preserve the bugfixes introduced by [1] and [2]: a follow-up commit in the future can implement a proper delete_empty() that avoids calls to fl_walk().

(tested with tdc "concurrency", "matchall", "basic" and "u32")

[1] 6676d5e416ee ("net: sched: set dedicated tcf_walker flag when tp is empty")
[2] 8b64678e0af8 ("net: sched: refactor tp insert/delete for concurrent execution")

Davide Caratti (2):
Revert "net/sched: cls_u32: fix refcount leak in the error path of

    u32_change()"

net/sched: add delete_empty() to filters and use it in cls_flower

 include/net/sch_generic.h |  2 ++
 net/sched/cls_api.c       | 29 ++++-------------------------
 net/sched/cls_flower.c    | 23 +++++++++++++++++++++++
 net/sched/cls_u32.c       | 25 -------------------------
 4 files changed, 29 insertions(+), 50 deletions(-)
Signature · 1 line
2.24.1