Re: [PATCH net-next v5 2/5] net: spacemit: Add K1 Ethernet MAC
From: Vivian Wang
Date: Tue Aug 12 2025 - 06:58:55 EST
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