diff mbox series

net: ieee802154: at86rf230: convert to use maple tree register cache

Message ID 20240202064512.39259-1-liubo03@inspur.com (mailing list archive)
State Accepted
Headers show
Series net: ieee802154: at86rf230: convert to use maple tree register cache | expand

Commit Message

Bo Liu Feb. 2, 2024, 6:45 a.m. UTC
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(-)

Comments

Miquel Raynal Feb. 2, 2024, 7:55 a.m. UTC | #1
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
Alexander Aring Feb. 5, 2024, 7:42 p.m. UTC | #2
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
Miquel Raynal Feb. 6, 2024, 9:25 a.m. UTC | #3
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
Miquel Raynal Feb. 20, 2024, 10:04 a.m. UTC | #4
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
Stefan Schmidt Feb. 26, 2024, 8:48 p.m. UTC | #5
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
diff mbox series

Patch

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,