mbox series

[net,v3,0/2] net: sched: Undo tcf_bind_filter in case of errors in set callbacks

Message ID 20230709161350.347064-1-victor@mojatatu.com (mailing list archive)
Headers show
Series net: sched: Undo tcf_bind_filter in case of errors in set callbacks | expand

Message

Victor Nogueira July 9, 2023, 4:13 p.m. UTC
BPF and flower classifier are calling tcf_bind_filter in their set
callbacks, but aren't undoing it by calling tcf_unbind_filter if their
was an error after binding.

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

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

v2 -> v3:
* Inlined functions cls_bpf_set_parms and fl_set_parms to avoid adding
  yet another parameter (and a return value at it) to them.
* Removed 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.

Victor Nogueira (2):
  net: sched: cls_bpf: Undo tcf_bind_filter in case of an error
  net: sched: cls_flower: Undo tcf_bind_filter if fl_set_key fails

 net/sched/cls_bpf.c    | 99 ++++++++++++++++++++----------------------
 net/sched/cls_flower.c | 99 ++++++++++++++++++++----------------------
 2 files changed, 94 insertions(+), 104 deletions(-)

Comments

Victor Nogueira July 10, 2023, 7:24 p.m. UTC | #1
Please ignore this patchset, I'll send a V4 soon with the approach we
discussed at the monthly tc meetup

cheers,
Victor


On 09/07/2023 13:13, Victor Nogueira wrote:
> BPF and flower classifier are calling tcf_bind_filter in their set
> callbacks, but aren't undoing it by calling tcf_unbind_filter if their
> was an error after binding.
> 
> This patch set fixes this by calling tcf_unbind_filter in such cases.
> 
> v1 -> v2:
> * Remove blank line after fixes tag
> * Fix reverse xmas tree issues pointed out by Simon
> 
> v2 -> v3:
> * Inlined functions cls_bpf_set_parms and fl_set_parms to avoid adding
>    yet another parameter (and a return value at it) to them.
> * Removed 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.
> 
> Victor Nogueira (2):
>    net: sched: cls_bpf: Undo tcf_bind_filter in case of an error
>    net: sched: cls_flower: Undo tcf_bind_filter if fl_set_key fails
> 
>   net/sched/cls_bpf.c    | 99 ++++++++++++++++++++----------------------
>   net/sched/cls_flower.c | 99 ++++++++++++++++++++----------------------
>   2 files changed, 94 insertions(+), 104 deletions(-)
>