Re: [PATCH net-next v2 2/5] net: rnpgbe: Report link settings through ethtool
From: Andrew Lunn
Date: Sun Nov 15 2026 - 23:19:57 EST
> +static int rnpgbe_get_link_ksettings(struct net_device *netdev,
> + struct ethtool_link_ksettings *cmd)
> +{
> + struct mucse *mucse = netdev_priv(netdev);
> + struct mucse_hw *hw = &mucse->hw;
> + u32 supported, advertising;
> + unsigned long flags;
> + u16 status;
> + int mode;
> +
> + status = hw->link_config.status;
> + supported = hw->link_config.supported;
> + advertising = hw->link_config.advertising;
These are accessed without a lock,
> + ethtool_link_ksettings_zero_link_mode(cmd, supported);
> + ethtool_link_ksettings_zero_link_mode(cmd, advertising);
> + ethtool_link_ksettings_zero_link_mode(cmd, lp_advertising);
> + cmd->base.autoneg = AUTONEG_DISABLE;
> + cmd->base.speed = SPEED_UNKNOWN;
> + cmd->base.duplex = DUPLEX_UNKNOWN;
> + cmd->base.eth_tp_mdix = ETH_TP_MDI_INVALID;
> + spin_lock_irqsave(&mucse->link_lock, flags);
> + if (netif_carrier_ok(netdev) && hw->link) {
> + cmd->base.speed = hw->speed;
> + cmd->base.duplex = hw->duplex ?
> + DUPLEX_FULL : DUPLEX_HALF;
> + if (status & MUCSE_LINK_TP)
> + cmd->base.eth_tp_mdix = hw->mdix;
Yet these need a lock?
> + }
> + spin_unlock_irqrestore(&mucse->link_lock, flags);
> +
> + if (status & MUCSE_LINK_TP) {
> + rnpgbe_link_modes(cmd->link_modes.supported, supported);
> + rnpgbe_link_modes(cmd->link_modes.advertising, advertising);
> + ethtool_link_ksettings_add_link_mode(cmd, supported, TP);
> + ethtool_link_ksettings_add_link_mode(cmd, advertising, TP);
Advertising TP? Can you point to some part of 802.3 to support
advertising TP to the link partner.
Andrew