From: Vivien Didelot <vivien.didelot@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
jiri@mellanox.com, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next 3/5] net: dsa: mv88e6xxx: global2: Expose ATU stats register
Date: Tue, 5 Nov 2019 23:37:24 -0500 [thread overview]
Message-ID: <20191105233724.GD799546@t480s.localdomain> (raw)
In-Reply-To: <20191105233241.GB799546@t480s.localdomain>
Hi Andrew,
On Tue, 5 Nov 2019 23:32:41 -0500, Vivien Didelot <vivien.didelot@gmail.com> wrote:
> > +int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip)
> > +{
> > + int err;
> > + u16 val;
> > +
> > + err = mv88e6xxx_g2_read(chip, MV88E6XXX_G2_ATU_STATS, &val);
> > + if (err)
> > + return err;
> > +
> > + return val & MV88E6XXX_G2_ATU_STATS_MASK;
> > +}
>
> I would use the logic commonly used in the mv88e6xxx driver for
> functions that may fail, returning only an error code and taking a
> pointer to the correct type as argument, so that we do as usual:
>
> err = mv88e6xxx_g2_atu_stats_get(chip, &val);
> if (err)
> return err;
>
> > +
> > /* Offset 0x0F: Priority Override Table */
> >
> > static int mv88e6xxx_g2_pot_write(struct mv88e6xxx_chip *chip, int pointer,
> > diff --git a/drivers/net/dsa/mv88e6xxx/global2.h b/drivers/net/dsa/mv88e6xxx/global2.h
> > index 42da4bca73e8..a308ca7a7da6 100644
> > --- a/drivers/net/dsa/mv88e6xxx/global2.h
> > +++ b/drivers/net/dsa/mv88e6xxx/global2.h
> > @@ -113,7 +113,16 @@
> > #define MV88E6XXX_G2_SWITCH_MAC_DATA_MASK 0x00ff
> >
> > /* Offset 0x0E: ATU Stats Register */
> > -#define MV88E6XXX_G2_ATU_STATS 0x0e
> > +#define MV88E6XXX_G2_ATU_STATS 0x0e
> > +#define MV88E6XXX_G2_ATU_STATS_BIN_0 (0x0 << 14)
> > +#define MV88E6XXX_G2_ATU_STATS_BIN_1 (0x1 << 14)
> > +#define MV88E6XXX_G2_ATU_STATS_BIN_2 (0x2 << 14)
> > +#define MV88E6XXX_G2_ATU_STATS_BIN_3 (0x3 << 14)
> > +#define MV88E6XXX_G2_ATU_STATS_MODE_ALL (0x0 << 12)
> > +#define MV88E6XXX_G2_ATU_STATS_MODE_ALL_DYNAMIC (0x1 << 12)
> > +#define MV88E6XXX_G2_ATU_STATS_MODE_FID_ALL (0x2 << 12)
> > +#define MV88E6XXX_G2_ATU_STATS_MODE_FID_ALL_DYNAMIC (0x3 << 12)
> > +#define MV88E6XXX_G2_ATU_STATS_MASK 0x0fff
>
> Please use the 0x1234 format for these 16-bit registers.
Oops the series has already been applied. Andrew please consider
these comments for your future series, they always apply...
Thank a lot,
Vivien
next prev parent reply other threads:[~2019-11-06 4:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 0:12 [PATCH net-next 0/5] mv88e6xxx ATU occupancy as devlink resource Andrew Lunn
2019-11-05 0:12 ` [PATCH net-next 1/5] net: dsa: Add support for devlink resources Andrew Lunn
2019-11-05 8:47 ` Jiri Pirko
2019-11-05 0:12 ` [PATCH net-next 2/5] net: dsa: mv88e6xxx: Add number of MACs in the ATU Andrew Lunn
2019-11-05 0:12 ` [PATCH net-next 3/5] net: dsa: mv88e6xxx: global2: Expose ATU stats register Andrew Lunn
2019-11-06 4:32 ` Vivien Didelot
2019-11-06 4:37 ` Vivien Didelot [this message]
2019-11-07 0:12 ` Andrew Lunn
2019-11-05 0:13 ` [PATCH net-next 4/5] net: dsa: mv88e6xxx: global1_atu: Add helper for get next Andrew Lunn
2019-11-05 0:13 ` [PATCH net-next 5/5] net: dsa: mv88e6xxx: Add ATU occupancy via devlink resources Andrew Lunn
2019-11-05 8:47 ` Jiri Pirko
2019-11-06 2:10 ` [PATCH net-next 0/5] mv88e6xxx ATU occupancy as devlink resource David Miller
2019-11-06 13:55 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191105233724.GD799546@t480s.localdomain \
--to=vivien.didelot@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox