diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-01-24 15:54:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-24 16:01:10 -0500 |
commit | 1b0f80375c683a3baa0bba9b6f6d89cfb180f3dc (patch) | |
tree | 6c021d2ccc87460c217d9c25db2ad3cccd07212a | |
parent | ea2059409ca1eac35607d194905cf2c6969b3921 (diff) |
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>
-rw-r--r-- | net/sched/cls_flower.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 79aa5049f028..dc9acaafc0a8 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c | |||
@@ -218,12 +218,13 @@ static void fl_destroy_filter(struct rcu_head *head) | |||
218 | tcf_queue_work(&f->work); | 218 | tcf_queue_work(&f->work); |
219 | } | 219 | } |
220 | 220 | ||
221 | static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f) | 221 | static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f, |
222 | struct netlink_ext_ack *extack) | ||
222 | { | 223 | { |
223 | struct tc_cls_flower_offload cls_flower = {}; | 224 | struct tc_cls_flower_offload cls_flower = {}; |
224 | struct tcf_block *block = tp->chain->block; | 225 | struct tcf_block *block = tp->chain->block; |
225 | 226 | ||
226 | tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, NULL); | 227 | tc_cls_common_offload_init(&cls_flower.common, tp, f->flags, extack); |
227 | cls_flower.command = TC_CLSFLOWER_DESTROY; | 228 | cls_flower.command = TC_CLSFLOWER_DESTROY; |
228 | cls_flower.cookie = (unsigned long) f; | 229 | cls_flower.cookie = (unsigned long) f; |
229 | 230 | ||
@@ -255,7 +256,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, | |||
255 | err = tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER, | 256 | err = tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER, |
256 | &cls_flower, skip_sw); | 257 | &cls_flower, skip_sw); |
257 | if (err < 0) { | 258 | if (err < 0) { |
258 | fl_hw_destroy_filter(tp, f); | 259 | fl_hw_destroy_filter(tp, f, NULL); |
259 | return err; | 260 | return err; |
260 | } else if (err > 0) { | 261 | } else if (err > 0) { |
261 | tcf_block_offload_inc(block, &f->flags); | 262 | 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) | |||
282 | &cls_flower, false); | 283 | &cls_flower, false); |
283 | } | 284 | } |
284 | 285 | ||
285 | static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f) | 286 | static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f, |
287 | struct netlink_ext_ack *extack) | ||
286 | { | 288 | { |
287 | struct cls_fl_head *head = rtnl_dereference(tp->root); | 289 | struct cls_fl_head *head = rtnl_dereference(tp->root); |
288 | 290 | ||
289 | idr_remove_ext(&head->handle_idr, f->handle); | 291 | idr_remove_ext(&head->handle_idr, f->handle); |
290 | list_del_rcu(&f->list); | 292 | list_del_rcu(&f->list); |
291 | if (!tc_skip_hw(f->flags)) | 293 | if (!tc_skip_hw(f->flags)) |
292 | fl_hw_destroy_filter(tp, f); | 294 | fl_hw_destroy_filter(tp, f, extack); |
293 | tcf_unbind_filter(tp, &f->res); | 295 | tcf_unbind_filter(tp, &f->res); |
294 | if (tcf_exts_get_net(&f->exts)) | 296 | if (tcf_exts_get_net(&f->exts)) |
295 | call_rcu(&f->rcu, fl_destroy_filter); | 297 | call_rcu(&f->rcu, fl_destroy_filter); |
@@ -321,7 +323,7 @@ static void fl_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack) | |||
321 | struct cls_fl_filter *f, *next; | 323 | struct cls_fl_filter *f, *next; |
322 | 324 | ||
323 | list_for_each_entry_safe(f, next, &head->filters, list) | 325 | list_for_each_entry_safe(f, next, &head->filters, list) |
324 | __fl_delete(tp, f); | 326 | __fl_delete(tp, f, extack); |
325 | idr_destroy(&head->handle_idr); | 327 | idr_destroy(&head->handle_idr); |
326 | 328 | ||
327 | __module_get(THIS_MODULE); | 329 | __module_get(THIS_MODULE); |
@@ -958,7 +960,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, | |||
958 | rhashtable_remove_fast(&head->ht, &fold->ht_node, | 960 | rhashtable_remove_fast(&head->ht, &fold->ht_node, |
959 | head->ht_params); | 961 | head->ht_params); |
960 | if (!tc_skip_hw(fold->flags)) | 962 | if (!tc_skip_hw(fold->flags)) |
961 | fl_hw_destroy_filter(tp, fold); | 963 | fl_hw_destroy_filter(tp, fold, NULL); |
962 | } | 964 | } |
963 | 965 | ||
964 | *arg = fnew; | 966 | *arg = fnew; |
@@ -997,7 +999,7 @@ static int fl_delete(struct tcf_proto *tp, void *arg, bool *last, | |||
997 | if (!tc_skip_sw(f->flags)) | 999 | if (!tc_skip_sw(f->flags)) |
998 | rhashtable_remove_fast(&head->ht, &f->ht_node, | 1000 | rhashtable_remove_fast(&head->ht, &f->ht_node, |
999 | head->ht_params); | 1001 | head->ht_params); |
1000 | __fl_delete(tp, f); | 1002 | __fl_delete(tp, f, extack); |
1001 | *last = list_empty(&head->filters); | 1003 | *last = list_empty(&head->filters); |
1002 | return 0; | 1004 | return 0; |
1003 | } | 1005 | } |