[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wp0zc62m.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
Date: Wed, 03 Jan 2018 10:31:13 -0500
From: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To: Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc: Florian Fainelli <f.fainelli@...il.com>,
netdev <netdev@...r.kernel.org>,
Russell King <rmk+kernel@....linux.org.uk>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: Get mv88e6352 SERDES statistics
Hi Andrew,
Andrew Lunn <andrew@...n.ch> writes:
> +struct mv88e6xxx_port {
> + u64 serdes_stats[2];
> +};
> +
> struct mv88e6xxx_chip {
> const struct mv88e6xxx_info *info;
>
> @@ -207,6 +211,9 @@ struct mv88e6xxx_chip {
> int irq;
> int device_irq;
> int watchdog_irq;
> +
> + /* Array of port structures. */
> + struct mv88e6xxx_port ports[DSA_MAX_PORTS];
> };
We are trying to get rid of these global DSA limitations for ports and
switches and support dynamic values. It wasn't mentioned but I assume
you couldn't use a zero length array here because we allocate before
detecting the switch model. Please define MV88E6XXX_MAX_PORTS to 16
instead, which is indeed a Marvell limitation for SOHO devices.
>
> struct mv88e6xxx_bus_ops {
> diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c
> index d32522276fea..3b911b80da33 100644
> --- a/drivers/net/dsa/mv88e6xxx/serdes.c
> +++ b/drivers/net/dsa/mv88e6xxx/serdes.c
> @@ -87,6 +87,90 @@ int mv88e6352_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on)
> return 0;
> }
>
> +struct mv88e6352_serdes_hw_stat {
> + char string[ETH_GSTRING_LEN];
> + int sizeof_stat;
You can simply define size_t size.
> + int reg;
> +};
> +
> +static struct mv88e6352_serdes_hw_stat mv88e6352_serdes_hw_stats[] = {
> + { "serdes_fibre_rx_error", 16, 21 },
> + { "serdes_PRBS_error", 32, 24 },
> +};
<...>
> + BUILD_BUG_ON(ARRAY_SIZE(mv88e6352_serdes_hw_stats) >
> + ARRAY_SIZE(mv88e6xxx_port->serdes_stats));
> +
> + for (i = 0; i < ARRAY_SIZE(mv88e6352_serdes_hw_stats); i++) {
> + stat = &mv88e6352_serdes_hw_stats[i];
> + value = mv88e6352_serdes_get_stat(chip, stat);
extra space
> + mv88e6xxx_port->serdes_stats[i] += value;
> + data[i] = mv88e6xxx_port->serdes_stats[i];
> + }
> +}
Powered by blists - more mailing lists