[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190820223259.22348-31-willy@infradead.org>
Date: Tue, 20 Aug 2019 15:32:51 -0700
From: Matthew Wilcox <willy@...radead.org>
To: netdev@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Subject: [PATCH 30/38] cls_flower: Use XArray list of filters in fl_walk
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Instead of iterating over every filter attached to every mark, just
iterate over each filter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
net/sched/cls_flower.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 54026c9e9b05..2a1999d2b507 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -575,18 +575,15 @@ static void fl_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack)
{
struct cls_fl_head *head = fl_head_dereference(tp);
- struct fl_flow_mask *mask, *next_mask;
- struct cls_fl_filter *f, *next;
+ struct cls_fl_filter *f;
+ unsigned long handle;
bool last;
- list_for_each_entry_safe(mask, next_mask, &head->masks, list) {
- list_for_each_entry_safe(f, next, &mask->filters, list) {
- __fl_delete(tp, f, &last, rtnl_held, extack);
- if (last)
- break;
- }
+ xa_for_each(&head->filters, handle, f) {
+ __fl_delete(tp, f, &last, rtnl_held, extack);
+ if (last)
+ break;
}
- xa_destroy(&head->filters);
__module_get(THIS_MODULE);
tcf_queue_work(&head->rwork, fl_destroy_sleepable);
--
2.23.0.rc1
Powered by blists - more mailing lists