* [PATCH net-next 0/2] misc TC/flower changes
@ 2016-11-01 14:08 Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 1/2] net/sched: cls_flower: add missing unbind call when destroying flows Roi Dayan
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Roi Dayan @ 2016-11-01 14:08 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Jiri Pirko, Roi Dayan
This series includes two small changes to the TC flower classifier.
Thanks,
Roi
Roi Dayan (2):
net/sched: cls_flower: add missing unbind call when destroying flows
net/sched: cls_flower: merge filter delete/destroy common code
net/sched/cls_flower.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/2] net/sched: cls_flower: add missing unbind call when destroying flows
2016-11-01 14:08 [PATCH net-next 0/2] misc TC/flower changes Roi Dayan
@ 2016-11-01 14:08 ` Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code Roi Dayan
2016-11-02 19:01 ` [PATCH net-next 0/2] misc TC/flower changes David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Roi Dayan @ 2016-11-01 14:08 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Jiri Pirko, Roi Dayan
tcf_unbind was called in fl_delete but was missing in fl_destroy when
force deleting flows.
Fixes: 77b9900ef53a ('tc: introduce Flower classifier')
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
---
net/sched/cls_flower.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index f6f40fb..a5f6370 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -280,6 +280,7 @@ static bool fl_destroy(struct tcf_proto *tp, bool force)
list_for_each_entry_safe(f, next, &head->filters, list) {
fl_hw_destroy_filter(tp, (unsigned long)f);
list_del_rcu(&f->list);
+ tcf_unbind_filter(tp, &f->res);
call_rcu(&f->rcu, fl_destroy_filter);
}
RCU_INIT_POINTER(tp->root, NULL);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code
2016-11-01 14:08 [PATCH net-next 0/2] misc TC/flower changes Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 1/2] net/sched: cls_flower: add missing unbind call when destroying flows Roi Dayan
@ 2016-11-01 14:08 ` Roi Dayan
2016-11-01 14:23 ` Jiri Pirko
2016-11-01 16:17 ` Sergei Shtylyov
2016-11-02 19:01 ` [PATCH net-next 0/2] misc TC/flower changes David Miller
2 siblings, 2 replies; 6+ messages in thread
From: Roi Dayan @ 2016-11-01 14:08 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Jiri Pirko, Roi Dayan
Move common code from fl_delete and fl_detroy to __fl_delete.
Signed-off-by: Roi Dayan <roid@mellanox.com>
---
net/sched/cls_flower.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index a5f6370..a8fb1ca 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -269,6 +269,14 @@ static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, &tc);
}
+static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f)
+{
+ list_del_rcu(&f->list);
+ fl_hw_destroy_filter(tp, (unsigned long)f);
+ tcf_unbind_filter(tp, &f->res);
+ call_rcu(&f->rcu, fl_destroy_filter);
+}
+
static bool fl_destroy(struct tcf_proto *tp, bool force)
{
struct cls_fl_head *head = rtnl_dereference(tp->root);
@@ -277,12 +285,8 @@ static bool fl_destroy(struct tcf_proto *tp, bool force)
if (!force && !list_empty(&head->filters))
return false;
- list_for_each_entry_safe(f, next, &head->filters, list) {
- fl_hw_destroy_filter(tp, (unsigned long)f);
- list_del_rcu(&f->list);
- tcf_unbind_filter(tp, &f->res);
- call_rcu(&f->rcu, fl_destroy_filter);
- }
+ list_for_each_entry_safe(f, next, &head->filters, list)
+ __fl_delete(tp, f);
RCU_INIT_POINTER(tp->root, NULL);
if (head->mask_assigned)
rhashtable_destroy(&head->ht);
@@ -742,10 +746,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
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);
- call_rcu(&f->rcu, fl_destroy_filter);
+ __fl_delete(tp, f);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code
2016-11-01 14:08 ` [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code Roi Dayan
@ 2016-11-01 14:23 ` Jiri Pirko
2016-11-01 16:17 ` Sergei Shtylyov
1 sibling, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2016-11-01 14:23 UTC (permalink / raw)
To: Roi Dayan; +Cc: David S. Miller, netdev, Jiri Pirko
Tue, Nov 01, 2016 at 03:08:29PM CET, roid@mellanox.com wrote:
>Move common code from fl_delete and fl_detroy to __fl_delete.
>
>Signed-off-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code
2016-11-01 14:08 ` [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code Roi Dayan
2016-11-01 14:23 ` Jiri Pirko
@ 2016-11-01 16:17 ` Sergei Shtylyov
1 sibling, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2016-11-01 16:17 UTC (permalink / raw)
To: Roi Dayan, David S. Miller; +Cc: netdev, Jiri Pirko
On 11/01/2016 05:08 PM, Roi Dayan wrote:
> Move common code from fl_delete and fl_detroy to __fl_delete.
fl_destroy().
> Signed-off-by: Roi Dayan <roid@mellanox.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] misc TC/flower changes
2016-11-01 14:08 [PATCH net-next 0/2] misc TC/flower changes Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 1/2] net/sched: cls_flower: add missing unbind call when destroying flows Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code Roi Dayan
@ 2016-11-02 19:01 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2016-11-02 19:01 UTC (permalink / raw)
To: roid; +Cc: netdev, jiri
From: Roi Dayan <roid@mellanox.com>
Date: Tue, 1 Nov 2016 16:08:27 +0200
> This series includes two small changes to the TC flower classifier.
Series applied, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-02 19:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 14:08 [PATCH net-next 0/2] misc TC/flower changes Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 1/2] net/sched: cls_flower: add missing unbind call when destroying flows Roi Dayan
2016-11-01 14:08 ` [PATCH net-next 2/2] net/sched: cls_flower: merge filter delete/destroy common code Roi Dayan
2016-11-01 14:23 ` Jiri Pirko
2016-11-01 16:17 ` Sergei Shtylyov
2016-11-02 19:01 ` [PATCH net-next 0/2] misc TC/flower changes David Miller
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).