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

2019-08-21 Thread Jakub Kicinski
On Wed, 21 Aug 2019 14:25:42 -0700, Matthew Wilcox wrote: > On Wed, Aug 21, 2019 at 02:13:08PM -0700, Jakub Kicinski wrote: > > On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > > > @@ -305,8 +306,12 @@ static void *u32_get(struct tcf_proto *tp, u32 > > > handle) > > > /* Protected by

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

2019-08-21 Thread Matthew Wilcox
On Wed, Aug 21, 2019 at 02:13:08PM -0700, Jakub Kicinski wrote: > On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > > @@ -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

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

2019-08-21 Thread Jakub Kicinski
On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > @@ -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_i

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

2019-08-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" There are two structures called 'handle_idr' in this module, which is most confusing. Rename this one to ht_xa. Leave the existing locking alone, which means that we're covered by both the rtnl lock and the XArray spinlock when accessing this XArray. Signed-off-