[PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache

Bo Liu posted 1 patch 1 year, 10 months ago
drivers/net/ieee802154/at86rf230.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Bo Liu 1 year, 10 months ago
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 164c7f605af5..6212164ffb36 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -316,7 +316,7 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
 	.val_bits = 8,
 	.write_flag_mask = CMD_REG | CMD_WRITE,
 	.read_flag_mask = CMD_REG,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.max_register = AT86RF2XX_NUMREGS,
 	.writeable_reg = at86rf230_reg_writeable,
 	.readable_reg = at86rf230_reg_readable,
-- 
2.31.1
Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Stefan Schmidt 1 year, 10 months ago
Hello,

On 02.02.24 07:45, Bo Liu wrote:
> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably
> more appropriate for modern systems than those made by the rbtree cache.
> 
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---
>   drivers/net/ieee802154/at86rf230.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> index 164c7f605af5..6212164ffb36 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -316,7 +316,7 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
>   	.val_bits = 8,
>   	.write_flag_mask = CMD_REG | CMD_WRITE,
>   	.read_flag_mask = CMD_REG,
> -	.cache_type = REGCACHE_RBTREE,
> +	.cache_type = REGCACHE_MAPLE,
>   	.max_register = AT86RF2XX_NUMREGS,
>   	.writeable_reg = at86rf230_reg_writeable,
>   	.readable_reg = at86rf230_reg_readable,

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt
Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Miquel Raynal 1 year, 10 months ago
Hi Bo,

liubo03@inspur.com wrote on Fri, 2 Feb 2024 01:45:12 -0500:

> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably
> more appropriate for modern systems than those made by the rbtree cache.

What are the real intended benefits? Shall we expect any drawbacks?

> Signed-off-by: Bo Liu <liubo03@inspur.com>

Thanks,
Miquèl
Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Alexander Aring 1 year, 10 months ago
Hi,

On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Bo,
>
> liubo03@inspur.com wrote on Fri, 2 Feb 2024 01:45:12 -0500:
>
> > The maple tree register cache is based on a much more modern data structure
> > than the rbtree cache and makes optimisation choices which are probably
> > more appropriate for modern systems than those made by the rbtree cache.
>
> What are the real intended benefits? Shall we expect any drawbacks?
>

I doubt it has really any benefits, only the slowpath is using regmap
to set some registers. Maybe if you change phy setting frequently it
might have an impact, but this isn't even a path considered to run
fast.

- Alex
Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Miquel Raynal 1 year, 10 months ago
Hi,

aahringo@redhat.com wrote on Mon, 5 Feb 2024 14:42:09 -0500:

> Hi,
> 
> On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Bo,
> >
> > liubo03@inspur.com wrote on Fri, 2 Feb 2024 01:45:12 -0500:
> >  
> > > The maple tree register cache is based on a much more modern data structure
> > > than the rbtree cache and makes optimisation choices which are probably
> > > more appropriate for modern systems than those made by the rbtree cache.  
> >
> > What are the real intended benefits? Shall we expect any drawbacks?
> >  
> 
> I doubt it has really any benefits, only the slowpath is using regmap
> to set some registers. Maybe if you change phy setting frequently it
> might have an impact, but this isn't even a path considered to run
> fast.

Ok, then let's take the series I guess. For the three patches:

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl
Re: [PATCH] net: ieee802154: at86rf230: convert to use maple tree register cache
Posted by Miquel Raynal 1 year, 10 months ago
Hi,

aahringo@redhat.com wrote on Mon, 5 Feb 2024 14:42:09 -0500:

> Hi,
> 
> On Fri, Feb 2, 2024 at 2:56 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Bo,
> >
> > liubo03@inspur.com wrote on Fri, 2 Feb 2024 01:45:12 -0500:
> >  
> > > The maple tree register cache is based on a much more modern data structure
> > > than the rbtree cache and makes optimisation choices which are probably
> > > more appropriate for modern systems than those made by the rbtree cache.  
> >
> > What are the real intended benefits? Shall we expect any drawbacks?
> >  
> 
> I doubt it has really any benefits, only the slowpath is using regmap
> to set some registers. Maybe if you change phy setting frequently it
> might have an impact, but this isn't even a path considered to run
> fast.

Ok, thanks Alex for the info; in this case I'm fine:

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl