diff options
author | David S. Miller | 2016-11-02 15:00:48 -0400 |
---|---|---|
committer | David S. Miller | 2016-11-02 15:00:48 -0400 |
commit | 92901827538f87bd7e1ec41a7a1c3ebe22bb78f5 (patch) | |
tree | 58f04b917ae0035f60b09a3deb788ca372c98a96 | |
parent | 4cb551a100bcd7cbe810c57ae551bf89312bc0d3 (diff) | |
parent | 13fa876ebd03e90cd528c387410a9eb0b9c8de3f (diff) |
Merge branch 'cls_flower-misc'
Roi Dayan says:
====================
misc TC/flower changes
This series includes two small changes to the TC flower classifier.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/cls_flower.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index f6f40fba599b..a8fb1ca03b3e 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -269,6 +269,14 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f) dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, &tc); } +static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f) +{ + list_del_rcu(&f->list); + fl_hw_destroy_filter(tp, (unsigned long)f); + tcf_unbind_filter(tp, &f->res); + call_rcu(&f->rcu, fl_destroy_filter); +} + static bool fl_destroy(struct tcf_proto *tp, bool force) { struct cls_fl_head *head = rtnl_dereference(tp->root); @@ -277,11 +285,8 @@ static bool fl_destroy(struct tcf_proto *tp, bool force) if (!force && !list_empty(&head->filters)) return false; - list_for_each_entry_safe(f, next, &head->filters, list) { - fl_hw_destroy_filter(tp, (unsigned long)f); - list_del_rcu(&f->list); - call_rcu(&f->rcu, fl_destroy_filter); - } + list_for_each_entry_safe(f, next, &head->filters, list) + __fl_delete(tp, f); RCU_INIT_POINTER(tp->root, NULL); if (head->mask_assigned) rhashtable_destroy(&head->ht); @@ -741,10 +746,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg) rhashtable_remove_fast(&head->ht, &f->ht_node, head->ht_params); - list_del_rcu(&f->list); - fl_hw_destroy_filter(tp, (unsigned long)f); - tcf_unbind_filter(tp, &f->res); - call_rcu(&f->rcu, fl_destroy_filter); + __fl_delete(tp, f); return 0; } |