From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jhs@mojatatu.com, idosch@mellanox.com,
eladr@mellanox.com, ogerlitz@mellanox.com, hadarh@mellanox.com,
amir@vadai.me
Subject: [patch net] sched: cls_flower: remove from hashtable only in case skip sw flag is not set
Date: Mon, 28 Nov 2016 15:40:13 +0100 [thread overview]
Message-ID: <1480344013-4812-1-git-send-email-jiri@resnulli.us> (raw)
From: Jiri Pirko <jiri@mellanox.com>
Be symmetric to hashtable insert and remove filter from hashtable only
in case skip sw flag is not set.
Fixes: e69985c67c33 ("net/sched: cls_flower: Introduce support in SKIP SW flag")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
net/sched/cls_flower.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index f6f40fb..641c44c 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -711,8 +711,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);
}
@@ -739,8 +740,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);
--
2.7.4
next reply other threads:[~2016-11-28 14:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 14:40 Jiri Pirko [this message]
2016-11-28 15:16 ` [patch net] sched: cls_flower: remove from hashtable only in case skip sw flag is not set Amir Vadai"
2016-11-28 21:04 ` Or Gerlitz
2016-11-28 21:23 ` Jiri Pirko
2016-11-30 1:45 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480344013-4812-1-git-send-email-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=amir@vadai.me \
--cc=davem@davemloft.net \
--cc=eladr@mellanox.com \
--cc=hadarh@mellanox.com \
--cc=idosch@mellanox.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).