Skip to content

Commit 9290182

Browse files
committed
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 <[email protected]>
2 parents 4cb551a + 13fa876 commit 9290182

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

net/sched/cls_flower.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
269269
dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, &tc);
270270
}
271271

272+
static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
273+
{
274+
list_del_rcu(&f->list);
275+
fl_hw_destroy_filter(tp, (unsigned long)f);
276+
tcf_unbind_filter(tp, &f->res);
277+
call_rcu(&f->rcu, fl_destroy_filter);
278+
}
279+
272280
static bool fl_destroy(struct tcf_proto *tp, bool force)
273281
{
274282
struct cls_fl_head *head = rtnl_dereference(tp->root);
@@ -277,11 +285,8 @@ static bool fl_destroy(struct tcf_proto *tp, bool force)
277285
if (!force && !list_empty(&head->filters))
278286
return false;
279287

280-
list_for_each_entry_safe(f, next, &head->filters, list) {
281-
fl_hw_destroy_filter(tp, (unsigned long)f);
282-
list_del_rcu(&f->list);
283-
call_rcu(&f->rcu, fl_destroy_filter);
284-
}
288+
list_for_each_entry_safe(f, next, &head->filters, list)
289+
__fl_delete(tp, f);
285290
RCU_INIT_POINTER(tp->root, NULL);
286291
if (head->mask_assigned)
287292
rhashtable_destroy(&head->ht);
@@ -741,10 +746,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
741746

742747
rhashtable_remove_fast(&head->ht, &f->ht_node,
743748
head->ht_params);
744-
list_del_rcu(&f->list);
745-
fl_hw_destroy_filter(tp, (unsigned long)f);
746-
tcf_unbind_filter(tp, &f->res);
747-
call_rcu(&f->rcu, fl_destroy_filter);
749+
__fl_delete(tp, f);
748750
return 0;
749751
}
750752

0 commit comments

Comments
 (0)