Article View: linux.kernel.netdev
Article #12528Re: [PATCH net-next 2/5] net: rnpgbe: Report link settings through ethtool
From: Andrew Lunn
Date: Sat, 07 Nov 2026 17:57
Date: Sat, 07 Nov 2026 17:57
75 lines
10630 bytes
10630 bytes
> These devices support autonegotiation only on TP ports. Configure TP
> ports with autonegotiation enabled and fibre and backplane ports with
> fixed 1 Gb/s full duplex.
> int rnpgbe_setup_default_link(struct mucse_hw *hw)
> {
> - return mucse_mbx_set_link(hw, RNPGBE_DEFAULT_ADV, true, 0, 0,
> - ETH_TP_MDI_AUTO);
> + u32 advertising = hw->link_config.supported & RNPGBE_DEFAULT_ADV;
> + bool autoneg = hw->link_config.status & MUCSE_LINK_TP;
> + u8 duplex = DUPLEX_UNKNOWN;
> + u32 speed = SPEED_UNKNOWN;
> + int err;
> +
> + if (!autoneg) {
> + advertising &= RNPGBE_FW_ADV_1000_FULL;
> + speed = SPEED_1000;
> + duplex = DUPLEX_FULL;
> + }
> +
> + err = mucse_mbx_set_link(hw, advertising, autoneg,
> + autoneg ? 0 : speed, autoneg ? 0 : duplex,
> + ETH_TP_MDI_AUTO);
This looks odd. If autoneg is off, you expect user space to indicate
how the MAC should be configured. 10, 100, 1G, full or half.
> +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;
> + 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);
Do you have access to the LP advertisement value? It is useful for debugging.
> + } else {
> + if (status & MUCSE_LINK_BACKPLANE) {
> + mode = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT;
> + ethtool_link_ksettings_add_link_mode(cmd, supported,
> + Backplane);
> + ethtool_link_ksettings_add_link_mode(cmd, advertising,
> + Backplane);
Does it actually advertise Backplane?
> + cmd->base.port = PORT_NONE;
> + } else {
> + mode = ETHTOOL_LINK_MODE_1000baseX_Full_BIT;
> + ethtool_link_ksettings_add_link_mode(cmd, supported,
> + FIBRE);
> + ethtool_link_ksettings_add_link_mode(cmd, advertising,
> + FIBRE);
Again, does it advertise fibre? What happens if the LP wants to do TP?
You probably want to look at phylib, it figure out the correct way to
to implement ksetting set/get.
Andrew
---
pw-bot: cr
Technical Details
Message-ID:
<228e8fd8-4f1d-40d7-aca6-fc8a304b9906@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358446-linux-kernel-netdev=dewy.ruReferences:
<FB722C2F25FE9005+20261106112420.43050-1-dong100@mucse.com> <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358446-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 2/5] net: rnpgbe: Report link settings through ethtool Date: Sat, 7 Nov 2026 18:57:45 +0100 Organization: Usenet Network Message-ID: <228e8fd8-4f1d-40d7-aca6-fc8a304b9906@lunn.ch> References: <FB722C2F25FE9005+20261106112420.43050-1-dong100@mucse.com> <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="4157633"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:o2VF1LGrTk7J3rObraAW56upneM= sha256:mOSUS2iuQze6iYW/NOH0Rs/gBBwpCJ/eOFmuVTBa/RA= sha1:ZrS7KEoqh3/V/GFr6RwUjQRlQ0I= sha256:ddh0KLeGTSzLQXvTfMkvC/qLfBgsyuKiM9DAxD3cs5Q= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id C5495113467; Sat, 7 Nov 2026 20:58:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.151 X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sN_nKhzHNrrA; Sat, 7 Nov 2026 20:58:10 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-358446-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 3204F11344A; Sat, 7 Nov 2026 20:57:58 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 0D22962316D; Sat, 7 Nov 2026 17:57:56 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794074274; b=zHQmaxb4ZE696JH+F4xR47R07sr3r+3NMNnOe9xIui/8K77W8rpagSpu1sG4keulbb7d p/WySuB1WqHPVD6ICJzfOy5cy/Nm1Gz+5kcdRTYEJVfFnXRGEMZ8TBFrb/wpZD+1Qt+DD oV/dbp2XipVjub4mtZ+k2onJ7C93x04grdVhdDveYWRPtjsa8zt8qcEbm+Zk6Q12uhxZ0 cyXAJ9c7r7q4k8dx+bDKxdPTJ+qeyD7zmzRh3MFLl9LfkytQctp62qwKqlnoFQqPSz12u SnsMIIvVXEOpWHyM2CTQBwbC5wA3mgEQD6jsAuMIDa38MWK+DEMD4kNH6AskSML1Qlg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794074274; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=jZbkHHYtwIbgU4wy/4KVFGSe2PVc8UG7tdfmC7f5SfE=; b=bS3uQYYlaF5sAOW8CFnBNOY2DJ4HtjsTeNKs7F/qxPSDlPI+DwOrHc6BxCPkwHpzN+Xl y6fGgTJVt1ku01cO9O0hoHCFuvx6CzBqfzpQkOQb8vR3VCt0brdZcrmQ0di9weZzIOk+v q1wJhE6nVgTGAjlow+SLkc+dqnYxJPKIM6c+JZGvKaTnOD/JmvbDrITYDVl8pwGG8tjG9 gdQTFO+iFM2uoq+WZq+a2OCJhe5PAPSrlhOeknZEkVG8Iq369tXAXv8OSEsNPQjYVcaJO ZfMDJqgL5jSHrAD1a5NMD130O6XQYf6FdIQ7TThTH5NiqmiiJVz7RIcUd2+zObrgzCg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ibONHJDp; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 346CE606A33B; Sat, 7 Nov 2026 17:57:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ibONHJDp X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794074273; b=aaw2JA0son/gjaAlbs73uJ8k4xL3bzPuopZV8Az2WLw37zt7sG1zSKmkojsZq6jzo8US nTG+OoD1qiot66C37r6DbrFAdkh9xhWQohiLAEBo5MtSQmO4L6W/1BRvFkcvO6HSIsc2T HIg39ehDzaYKT0vkOmoiMXgMT7KqwN7ZxAJg6mwxnnYkS+7OlrjTYg5G6D6lxw429cIRZ CQowY8W9guTmFd13b96b07WDSQfadOT1KuLtDsSd9oAKYELQWe3UiZe9VytRlLzNkoXu3 V58c5OJ8XnUO0QJNPAjgujHXlASkaVPV7Raj19HM/TLXaK7xQL+LUriOiVmMzXk7t5Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794074273; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=jZbkHHYtwIbgU4wy/4KVFGSe2PVc8UG7tdfmC7f5SfE=; b=pKA1jjhK50lUFgdiIWKarmuFToT8e1HfAirUHaZC+1Mt2csQy/rXS5UC5g9gD9ziwkXR HAewpDJA2txlgfpeLjGVLJ0kHMqK26K86klY/tF1GqPh+3sHYzxBc22/C/aYw+WFWmSNK LhZv5zeEtQDLYgk5S8lxVUmIJfLVGjOIirOVHkNA88/EH3m8FvCkWS9cq8svFrt/iQ6oz h+16hPrYapKKBfQQbXOho61sZxncqGjNPbdAcZoRon7JS/HzTRCLs9f4TMw5M2VybTjJi 6DOn2ZpnjOE9kluPSXM0jPrZScTCgt5CuDzkyETUQ9y058bUNoxaqp1QKDuxqI/yN/g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ibONHJDp; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6413606A32C; Sat, 7 Nov 2026 17:57:52 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6413606A32C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=jZbkHHYtwIbgU4wy/4KVFGSe2PVc8UG7tdfmC7f5SfE=; b=ibONHJDpu+L/WZgSrOL3LszIp0 RRIJ0nBhxH6r6eY6ZJG39oH3frNHO7hpb4hBKvNyc9M2RSDWUenzZdKK835lcj1InI9VTjaPoVAo8 Y3pCNgYkDQBFXuTXA6ogEp0Kcv8oUBgwMoGz4rPJf+sagqeitOVioOJIb0Mjcvq3hrVE=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xPkfh-00EzJ8-BZ; Sat, 07 Nov 2026 18:57:45 +0100 X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, yaojun@mucse.com X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com>