mbox series

[net,v5,0/5] net: sched: Fixes for classifiers

Message ID 20230713180514.592812-1-victor@mojatatu.com (mailing list archive)
Headers show
Series net: sched: Fixes for classifiers | expand

Message

Victor Nogueira July 13, 2023, 6:05 p.m. UTC
Four different classifiers (bpf, u32, matchall, and flower) are
calling tcf_bind_filter in their callbacks, but arent't undoing it by
calling tcf_unbind_filter if their was an error after binding.

This patch set fixes all this by calling tcf_unbind_filter in such
cases.

This set also undoes a refcount decrement in cls_u32 when an update
fails under specific conditions which are described in patch #3.

v1 -> v2:
* Remove blank line after fixes tag
* Fix reverse xmas tree issues pointed out by Simon

v2 -> v3:
* Inline functions cls_bpf_set_parms and fl_set_parms to avoid adding
  yet another parameter (and a return value at it) to them.
* Remove similar fixes for u32 and matchall, which will be sent soon,
  once we find a way to do the fixes without adding a return parameter
  to their set_parms functions.

v3 -> v4:
* Inline mall_set_parms to avoid adding yet another parameter.
* Remove set_flags parameter from u32_set_parms and create a separate
  function for calling tcf_bind_filter and tcf_unbind_filter in case of
  failure.
* Change cover letter title to also encompass refcnt fix for u32

v4 -> v5:
* Change back tag to net

Victor Nogueira (5):
  net: sched: cls_matchall: Undo tcf_bind_filter in case of failure
    after mall_set_parms
  net: sched: cls_u32: Undo tcf_bind_filter if u32_replace_hw_knode
  net: sched: cls_u32: Undo refcount decrement in case update failed
  net: sched: cls_bpf: Undo tcf_bind_filter in case of an error
  net: sched: cls_flower: Undo tcf_bind_filter in case of an error

 net/sched/cls_bpf.c      | 99 +++++++++++++++++++---------------------
 net/sched/cls_flower.c   | 99 +++++++++++++++++++---------------------
 net/sched/cls_matchall.c | 35 +++++---------
 net/sched/cls_u32.c      | 48 ++++++++++++++-----
 4 files changed, 143 insertions(+), 138 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 17, 2023, 6:40 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 13 Jul 2023 15:05:09 -0300 you wrote:
> Four different classifiers (bpf, u32, matchall, and flower) are
> calling tcf_bind_filter in their callbacks, but arent't undoing it by
> calling tcf_unbind_filter if their was an error after binding.
> 
> This patch set fixes all this by calling tcf_unbind_filter in such
> cases.
> 
> [...]

Here is the summary with links:
  - [net,v5,1/5] net: sched: cls_matchall: Undo tcf_bind_filter in case of failure after mall_set_parms
    https://git.kernel.org/netdev/net/c/b3d0e0489430
  - [net,v5,2/5] net: sched: cls_u32: Undo tcf_bind_filter if u32_replace_hw_knode
    https://git.kernel.org/netdev/net/c/9cb36faedeaf
  - [net,v5,3/5] net: sched: cls_u32: Undo refcount decrement in case update failed
    https://git.kernel.org/netdev/net/c/e8d3d78c19be
  - [net,v5,4/5] net: sched: cls_bpf: Undo tcf_bind_filter in case of an error
    https://git.kernel.org/netdev/net/c/26a22194927e
  - [net,v5,5/5] net: sched: cls_flower: Undo tcf_bind_filter in case of an error
    https://git.kernel.org/netdev/net/c/ac177a330077

You are awesome, thank you!