cls_flower: propagate extack to delete callback
Propagate extack on removal of offloaded filter. Don't pass extack from error paths. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ea2059409c
commit
1b0f80375c
|
@ -218,12 +218,13 @@ static void fl_destroy_filter(struct rcu_head *head)
|
||||||
tcf_queue_work(&f->work);
|
tcf_queue_work(&f->work);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f)
|
static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f,
|
||||||
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct tc_cls_flower_offload cls_flower = {};
|
struct tc_cls_flower_offload cls_flower = {};
|
||||||
struct tcf_block *block = tp->chain->block;
|
struct tcf_block *block = tp->chain->block;
|
||||||
|
|
||||||
tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, NULL);
|
tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, extack);
|
||||||
cls_flower.command = TC_CLSFLOWER_DESTROY;
|
cls_flower.command = TC_CLSFLOWER_DESTROY;
|
||||||
cls_flower.cookie = (unsigned long) f;
|
cls_flower.cookie = (unsigned long) f;
|
||||||
|
|
||||||
|
@ -255,7 +256,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
|
||||||
err = tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER,
|
err = tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER,
|
||||||
&cls_flower, skip_sw);
|
&cls_flower, skip_sw);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
fl_hw_destroy_filter(tp, f);
|
fl_hw_destroy_filter(tp, f, NULL);
|
||||||
return err;
|
return err;
|
||||||
} else if (err > 0) {
|
} else if (err > 0) {
|
||||||
tcf_block_offload_inc(block, &f->flags);
|
tcf_block_offload_inc(block, &f->flags);
|
||||||
|
@ -282,14 +283,15 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
|
||||||
&cls_flower, false);
|
&cls_flower, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
|
static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f,
|
||||||
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct cls_fl_head *head = rtnl_dereference(tp->root);
|
struct cls_fl_head *head = rtnl_dereference(tp->root);
|
||||||
|
|
||||||
idr_remove_ext(&head->handle_idr, f->handle);
|
idr_remove_ext(&head->handle_idr, f->handle);
|
||||||
list_del_rcu(&f->list);
|
list_del_rcu(&f->list);
|
||||||
if (!tc_skip_hw(f->flags))
|
if (!tc_skip_hw(f->flags))
|
||||||
fl_hw_destroy_filter(tp, f);
|
fl_hw_destroy_filter(tp, f, extack);
|
||||||
tcf_unbind_filter(tp, &f->res);
|
tcf_unbind_filter(tp, &f->res);
|
||||||
if (tcf_exts_get_net(&f->exts))
|
if (tcf_exts_get_net(&f->exts))
|
||||||
call_rcu(&f->rcu, fl_destroy_filter);
|
call_rcu(&f->rcu, fl_destroy_filter);
|
||||||
|
@ -321,7 +323,7 @@ static void fl_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
|
||||||
struct cls_fl_filter *f, *next;
|
struct cls_fl_filter *f, *next;
|
||||||
|
|
||||||
list_for_each_entry_safe(f, next, &head->filters, list)
|
list_for_each_entry_safe(f, next, &head->filters, list)
|
||||||
__fl_delete(tp, f);
|
__fl_delete(tp, f, extack);
|
||||||
idr_destroy(&head->handle_idr);
|
idr_destroy(&head->handle_idr);
|
||||||
|
|
||||||
__module_get(THIS_MODULE);
|
__module_get(THIS_MODULE);
|
||||||
|
@ -958,7 +960,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
|
||||||
rhashtable_remove_fast(&head->ht, &fold->ht_node,
|
rhashtable_remove_fast(&head->ht, &fold->ht_node,
|
||||||
head->ht_params);
|
head->ht_params);
|
||||||
if (!tc_skip_hw(fold->flags))
|
if (!tc_skip_hw(fold->flags))
|
||||||
fl_hw_destroy_filter(tp, fold);
|
fl_hw_destroy_filter(tp, fold, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
*arg = fnew;
|
*arg = fnew;
|
||||||
|
@ -997,7 +999,7 @@ static int fl_delete(struct tcf_proto *tp, void *arg, bool *last,
|
||||||
if (!tc_skip_sw(f->flags))
|
if (!tc_skip_sw(f->flags))
|
||||||
rhashtable_remove_fast(&head->ht, &f->ht_node,
|
rhashtable_remove_fast(&head->ht, &f->ht_node,
|
||||||
head->ht_params);
|
head->ht_params);
|
||||||
__fl_delete(tp, f);
|
__fl_delete(tp, f, extack);
|
||||||
*last = list_empty(&head->filters);
|
*last = list_empty(&head->filters);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue