[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bde59012-8394-d31b-24c4-018cbfe0ed57@bang-olufsen.dk>
Date: Wed, 13 Oct 2021 08:33:36 +0000
From: Alvin Šipraga <ALSI@...g-olufsen.dk>
To: Jakub Kicinski <kuba@...nel.org>,
Alvin Šipraga <alvin@...s.dk>
CC: Linus Walleij <linus.walleij@...aro.org>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Rob Herring <robh+dt@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Michael Rasmussen <MIR@...g-olufsen.dk>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 5/6] net: dsa: realtek-smi: add rtl8365mb
subdriver for RTL8365MB-VC
On 10/12/21 5:27 PM, Jakub Kicinski wrote:
> On Tue, 12 Oct 2021 14:35:54 +0200 Alvin Šipraga wrote:
>> + { 0, 4, 2, "dot3StatsFCSErrors" },
>> + { 0, 6, 2, "dot3StatsSymbolErrors" },
>> + { 0, 8, 2, "dot3InPauseFrames" },
>> + { 0, 10, 2, "dot3ControlInUnknownOpcodes" },
> ...
>
> You must expose counters via existing standard APIs.
>
> You should implement these ethtool ops:
I implement the dsa_switch_ops callback .get_ethtool_stats, using an
existing function rtl8366_get_ethtool_stats in the switch helper library
rtl8366.c. It was my understanding that this is the correct way to
expose counters within the DSA framework - please correct me if that is
wrong.
The structure you highlight is just some internal glue to sort out the
internal register mapping. I borrowed the approach from the existing
rtl8366rb.c Realtek SMI subdriver.
>
> void (*get_eth_phy_stats)(struct net_device *dev,
> struct ethtool_eth_phy_stats *phy_stats);
> void (*get_eth_mac_stats)(struct net_device *dev,
> struct ethtool_eth_mac_stats *mac_stats);
> void (*get_eth_ctrl_stats)(struct net_device *dev,
> struct ethtool_eth_ctrl_stats *ctrl_stats);
> void (*get_rmon_stats)(struct net_device *dev,
> struct ethtool_rmon_stats *rmon_stats,
> const struct ethtool_rmon_hist_range **ranges);
>
>> +static int rtl8365mb_setup(struct dsa_switch *ds)
>> +{
>> + struct realtek_smi *smi = ds->priv;
>> + struct rtl8365mb *mb;
>> + int ret;
>> + int i;
>> +
>> + mb = smi->chip_data;
>
> drivers/net/dsa/rtl8365mb.c:1428:20: warning: variable ‘mb’ set but not used [-Wunused-but-set-variable]
> 1428 | struct rtl8365mb *mb;
> | ^~
>
Woops, I will fix this in v2. Thanks.
Powered by blists - more mailing lists