[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c894603-08dc-4dcd-a866-0a1d121cdb89@iscas.ac.cn>
Date: Tue, 12 Aug 2025 18:57:42 +0800
From: Vivian Wang <wangruikang@...as.ac.cn>
To: Andrew Lunn <andrew@...n.ch>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Philipp Zabel <p.zabel@...gutronix.de>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>, Vivian Wang <uwu@...m.page>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Junhui Liu <junhui.liu@...moral.tech>, Simon Horman <horms@...nel.org>,
Maxime Chevallier <maxime.chevallier@...tlin.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v5 2/5] net: spacemit: Add K1 Ethernet MAC
On 8/12/25 11:45, Andrew Lunn wrote:
>> +static void emac_get_pause_stats(struct net_device *dev,
>> + struct ethtool_pause_stats *pause_stats)
>> +{
>> + struct emac_priv *priv = netdev_priv(dev);
>> + struct emac_hw_tx_stats *tx_stats;
>> + struct emac_hw_rx_stats *rx_stats;
>> +
>> + tx_stats = &priv->tx_stats;
>> + rx_stats = &priv->rx_stats;
>> +
>> + scoped_guard(spinlock_irqsave, &priv->stats_lock) {
>> + emac_stats_update(priv);
>> +
>> + pause_stats->tx_pause_frames = tx_stats->tx_pause_pkts;
>> + pause_stats->rx_pause_frames = rx_stats->rx_pause_pkts;
>> + }
>> +}
> You have pause statistics, but not actual configuration of pause.
>
>> +static void emac_adjust_link(struct net_device *dev)
>> +{
>> + struct emac_priv *priv = netdev_priv(dev);
>> + struct phy_device *phydev = dev->phydev;
>> + u32 ctrl;
> Normally the adjust_link callback you configure the hardware with the
> result of pause negotiation.
Thanks for the tip, I will fix emac_adjust_link next version.
>> +/* Called when net interface is brought up. */
>> +static int emac_open(struct net_device *ndev)
>> +{
>> + struct emac_priv *priv = netdev_priv(ndev);
>> + struct device *dev = &priv->pdev->dev;
>> +
>> + int ret;
> Extra blank line.
Oops. I will fix next version.
Thanks,
Vivian "dramforever" Wang
>
> Andrew
>
> ---
> pw-bot: cr
Powered by blists - more mailing lists