Skip to content

Commit

Permalink
sched: cls_flower: remove from hashtable only in case skip sw flag is…
Browse files Browse the repository at this point in the history
… not set

Be symmetric to hashtable insert and remove filter from hashtable only
in case skip sw flag is not set.

Fixes: e69985c ("net/sched: cls_flower: Introduce support in SKIP SW flag")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Amir Vadai <amir@vadai.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 30, 2016
1 parent 648f0c2 commit 725cbb6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions net/sched/cls_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,9 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
goto errout;

if (fold) {
rhashtable_remove_fast(&head->ht, &fold->ht_node,
head->ht_params);
if (!tc_skip_sw(fold->flags))
rhashtable_remove_fast(&head->ht, &fold->ht_node,
head->ht_params);
fl_hw_destroy_filter(tp, (unsigned long)fold);
}

Expand All @@ -760,8 +761,9 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
struct cls_fl_head *head = rtnl_dereference(tp->root);
struct cls_fl_filter *f = (struct cls_fl_filter *) arg;

rhashtable_remove_fast(&head->ht, &f->ht_node,
head->ht_params);
if (!tc_skip_sw(f->flags))
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);
Expand Down

0 comments on commit 725cbb6

Please sign in to comment.