@@ -269,6 +269,14 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
269
269
dev -> netdev_ops -> ndo_setup_tc (dev , tp -> q -> handle , tp -> protocol , & tc );
270
270
}
271
271
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
+
272
280
static bool fl_destroy (struct tcf_proto * tp , bool force )
273
281
{
274
282
struct cls_fl_head * head = rtnl_dereference (tp -> root );
@@ -277,12 +285,8 @@ static bool fl_destroy(struct tcf_proto *tp, bool force)
277
285
if (!force && !list_empty (& head -> filters ))
278
286
return false;
279
287
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
- tcf_unbind_filter (tp , & f -> res );
284
- call_rcu (& f -> rcu , fl_destroy_filter );
285
- }
288
+ list_for_each_entry_safe (f , next , & head -> filters , list )
289
+ __fl_delete (tp , f );
286
290
RCU_INIT_POINTER (tp -> root , NULL );
287
291
if (head -> mask_assigned )
288
292
rhashtable_destroy (& head -> ht );
@@ -742,10 +746,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
742
746
743
747
rhashtable_remove_fast (& head -> ht , & f -> ht_node ,
744
748
head -> ht_params );
745
- list_del_rcu (& f -> list );
746
- fl_hw_destroy_filter (tp , (unsigned long )f );
747
- tcf_unbind_filter (tp , & f -> res );
748
- call_rcu (& f -> rcu , fl_destroy_filter );
749
+ __fl_delete (tp , f );
749
750
return 0 ;
750
751
}
751
752
0 commit comments