[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZQHQ9hLeb0qvhxzS@casper.infradead.org>
Date: Wed, 13 Sep 2023 16:10:46 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Edward Cree <ecree.xilinx@...il.com>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>, edward.cree@....com,
linux-net-drivers@....com, davem@...emloft.net, kuba@...nel.org,
edumazet@...gle.com, pabeni@...hat.com, netdev@...r.kernel.org,
habetsm.xilinx@...il.com, sudheer.mogilappagari@...el.com,
jdamato@...tly.com, andrew@...n.ch, mw@...ihalf.com,
sgoutham@...vell.com, gakula@...vell.com, sbhatta@...vell.com,
hkelam@...vell.com, saeedm@...dia.com, leon@...nel.org
Subject: Re: [RFC PATCH v3 net-next 2/7] net: ethtool: attach an IDR of
custom RSS contexts to a netdevice
On Wed, Sep 13, 2023 at 12:22:03PM +0100, Edward Cree wrote:
> On 12/09/2023 17:36, Russell King (Oracle) wrote:
> > On Tue, Sep 12, 2023 at 03:21:37PM +0100, edward.cree@....com wrote:
> >> + struct idr rss_ctx;
> >
> > https://docs.kernel.org/core-api/idr.html
> >
> > "The IDR interface is deprecated; please use the XArray instead."
>
> IDR is a wrapper around XArray these days, right?
Yes, but a bad one.
> When I looked into the equivalent to use XArray directly it looked much
> more complicated for flexibility that really isn't needed here.
No, it's no more complex to use. There are a lot of _other_ things
you can do with it, but every IDR call has an equivalent XArray call.
And as a bonus you get a spinlock protecting you!
> Is there an explanation you can point me at of why this extremely
> convenient wrapper is deprecated?
Because why have two APIs for the same thing? One day, I will be finished
with important projects and then I'll go back to eradicating the users
of the IDR.
Powered by blists - more mailing lists