cls_u32: Reinstate cyclic allocation

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/ffdc2d9e1afd20e9f9d205115661481e984542d6
Commit:     ffdc2d9e1afd20e9f9d205115661481e984542d6
Parent:     85bd0438a249e7a7a0622e0b0b6663595fadcc27
Refname:    refs/heads/master
Author:     Matthew Wilcox <[email protected]>
AuthorDate: Tue Nov 28 12:05:54 2017 -0500
Committer:  Matthew Wilcox <[email protected]>
CommitDate: Tue Feb 6 16:41:27 2018 -0500

    cls_u32: Reinstate cyclic allocation
    
    Commit e7614370d6f0 ("net_sched: use idr to allocate u32 filter handles)
    converted htid allocation to use the IDR.  The ID allocated by this
    scheme changes; it used to be cyclic, but now always allocates the
    lowest available.  The IDR supports cyclic allocation, so just use
    the right function.
    
    Signed-off-by: Matthew Wilcox <[email protected]>
---
 net/sched/cls_u32.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 5b256da985b1..d2805f24ddd3 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -316,19 +316,13 @@ static void *u32_get(struct tcf_proto *tp, u32 handle)
 	return u32_lookup_key(ht, handle);
 }
 
+/* Protected by rtnl lock */
 static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr)
 {
-	unsigned long idr_index;
-	int err;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.