Thread (56 messages) flat view 56 messages, 6 authors, 2019-08-27

Re: [PATCH 24/38] cls_u32: Convert tc_u_common->handle_idr to XArray

From: Jakub Kicinski <hidden>
Date: 2019-08-21 21:13:15

On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote:
quoted hunk ↗ jump to hunk
@@ -305,8 +306,12 @@ static void *u32_get(struct tcf_proto *tp, u32 handle)
 /* Protected by rtnl lock */
 static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr)
 {
-	int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL);
-	if (id < 0)
+	int err;
+	u32 id;
+
+	err = xa_alloc_cyclic(&tp_c->ht_xa, &id, ptr, XA_LIMIT(0, 0x7ff),
+			&tp_c->ht_next, GFP_KERNEL);
nit: indentation seems off here and a couple of other places.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help