提交 725cbb62 编写于 作者: J Jiri Pirko 提交者: David S. Miller

sched: cls_flower: remove from hashtable only in case skip sw flag is not set

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

Fixes: e69985c6 ("net/sched: cls_flower: Introduce support in SKIP SW flag")
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Reviewed-by: NAmir Vadai <amir@vadai.me>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 648f0c28
...@@ -732,8 +732,9 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, ...@@ -732,8 +732,9 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
goto errout; goto errout;
if (fold) { if (fold) {
rhashtable_remove_fast(&head->ht, &fold->ht_node, if (!tc_skip_sw(fold->flags))
head->ht_params); rhashtable_remove_fast(&head->ht, &fold->ht_node,
head->ht_params);
fl_hw_destroy_filter(tp, (unsigned long)fold); fl_hw_destroy_filter(tp, (unsigned long)fold);
} }
...@@ -760,8 +761,9 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg) ...@@ -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_head *head = rtnl_dereference(tp->root);
struct cls_fl_filter *f = (struct cls_fl_filter *) arg; struct cls_fl_filter *f = (struct cls_fl_filter *) arg;
rhashtable_remove_fast(&head->ht, &f->ht_node, if (!tc_skip_sw(f->flags))
head->ht_params); rhashtable_remove_fast(&head->ht, &f->ht_node,
head->ht_params);
list_del_rcu(&f->list); list_del_rcu(&f->list);
fl_hw_destroy_filter(tp, (unsigned long)f); fl_hw_destroy_filter(tp, (unsigned long)f);
tcf_unbind_filter(tp, &f->res); tcf_unbind_filter(tp, &f->res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册