๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14145

Re: [PATCH net-next 2/5] net: rnpgbe: Report link settings through ethtool

#14145
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 16:55
76 lines
10980 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In mucse_mbx_fw_req_handler() (rnpgbe_mbx_fw.c:465-466), the
  patch takes the 2-bit firmware field FIELD_GET(ST_STATUS_MDIX_MASK /*โ€ฆ

--

net: rnpgbe: Report link settings through ethtool

This commit adds get_link_ksettings support to rnpgbe. At probe time it
queries firmware with GET_LANE_STATUS and reports the supported and
advertised link modes, autoneg, port type and PHY address from that
reply. It also caches the MDI-X state from LINK_CHANGE_EVT, and sets
the default link to autoneg on TP ports and to fixed 1000/full on fibre
and backplane ports.

> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> index 4a18937927514..469818b83d70f 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c

[ ... ]

> @@ -435,6 +462,8 @@ static void mucse_mbx_fw_req_handler(struct mucse_hw *hw,
>  
>  		hw->speed = le16_to_cpu(req->link_stat.st.speed);
>  		hw->duplex = req->link_stat.st.flags & DUPLEX_BIT;
> +		hw->mdix = FIELD_GET(ST_STATUS_MDIX_MASK,
> +				     le16_to_cpu(req->link_stat.st.status));

[Severity: Low]
This stores the raw 2-bit firmware field (0..3) in hw->mdix. Is that
value guaranteed to use the ETH_TP_MDI_* encoding?

When the carrier is up on a TP port, rnpgbe_get_link_ksettings() copies
the value straight into the ethtool status field:

	if (status & MUCSE_LINK_TP)
		cmd->base.eth_tp_mdix = hw->mdix;

The ethtool uAPI only allows ETH_TP_MDI_INVALID, ETH_TP_MDI or
ETH_TP_MDI_X in eth_tp_mdix. ETH_TP_MDI_AUTO (3) is only valid for
control. Both linkinfo_fill_reply() and the legacy ioctl path pass the
value to userspace without checking it.

If firmware reports 3, userspace gets an invalid status. If firmware
reports 0 while the link is up, userspace sees "Unknown". If firmware
uses a different encoding, userspace sees the wrong MDI/MDI-X state.

The control path already sends ETH_TP_MDI_* values to firmware in
phy_link_set.tp_mdix_ctrl, so values 1 and 2 may well line up. Nothing
here documents or enforces that, though, and later patches in the
series don't change the parsing or the reporting code.

Could the firmware value be mapped to ETH_TP_MDI_* explicitly, with
anything unexpected reported as ETH_TP_MDI_INVALID?

The patch also adds a second MDI-X field definition, for the
GET_LANE_STATUS status word in rnpgbe_mbx_fw.h, and nothing uses it:

	#define MUCSE_LINK_MDIX		GENMASK(14, 13)

Neither this define nor ST_STATUS_MDIX_MASK documents its value
encoding. Is MUCSE_LINK_MDIX meant to be used, or can it be dropped?

>  		rnpgbe_set_link(hw, mucse_link_is_up(hw, req));
>  		/* update regs to notify link info is received */
>  		mucse_update_link_status_reg(hw, req);

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/FB722C2F25FE9005%2B20261106112420.43050-1-dong100%40mucse.com
Technical Details
Message-ID: <179432970303.994134.1660961190803975260@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360448-linux-kernel-netdev=dewy.ru
References: <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360448-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/5] net: rnpgbe: Report link settings through ethtool
Date: Tue, 10 Nov 2026 16:55:03 +0000
Organization: Usenet Network
Message-ID: <179432970303.994134.1660961190803975260@kernel.org>
References: <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="689177"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:X6233p+eodlzTaSGcs6qMgs65w8= sha256:s/IhLktINoxiOrytbwhUxM7FxTGrWZLfBtcRy3k8nKg=
	sha1:kO7r4rHHMCbpSuOhgIg4bL4LB1k= sha256:D0EofCRcabhCdu+grBzWti8B0m9z5upA3ZhGiHfCYdI=
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 9C066113CFE; Tue, 10 Nov 2026 22:58:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 VIUU_bt8a_5S;
	Tue, 10 Nov 2026 22:58:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-360448-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 3E2D81139FF; Tue, 10 Nov 2026 22:58:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 7992B1C2E9C; Tue, 10 Nov 2026 16:56:19 +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=1794329706;
	b=ZnXkBjpp3JEFrA7URH9wUPCvTFcDMSci5z1WY/2eixTb7iBfaFz6K8/PseaQp7NlOM1U
	 YAm6ZP65E5qEBa4p6WUe2LSfxqv7SF9nR4oSCn4OBw+ucnJ88mRui5FENNwhH7PvJdF7N
	 CGHnF8ev7Q5DC3ob3HVrNWpCMw29pBB/1seAXULDxeufDkeL79YGds96j254ZsNchr51q
	 XfEwNwLOkXOnWzc0U34mdMG+nAGxDQ1iAP7DZE23vjIipN+DOKeAI9U8Yu/Dj/PtJzRaq
	 tVzDwRCCOaoKMHX4czPvskSo8wrIBeolGbn/lYxphjLL9SU1vb7z21MBTnLMTqNfKrg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329706;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=xtlNzexgpyraXnkzb2cGNwRrOc/5l0CGjaw5+9/Uw9c=;
	b=0/GxkaDAZ8YzC9Nuxque5iRCKg3RCzRCp0ImwnF49OfK55LfJdZ8DkECp2iKvne2FZDS
	 8S0tN5JX4NjnIgSCFg89xYuLn0OMiizR1KyhaTnKoshUw+z4oZQ9ZU1N1VC++PgL/R5wB
	 vUalS47GOs0Sp3KqLqiqyMu1di96QbrJ0DtWXzF/f9p9tI6sto3xAyhn15KE4dhwYuGw6
	 YMUZ0nn2SR6nctGH2LVsr49bx4V8RMwYL5Z0WJgMbFYc/HCCgyhhk87M1OwmlMbtcXDDM
	 MostRcG6IE6Wowz+fRlO4Af65nA6YhIGR+xqsl+gK7H8VZks0dhNisbLUsKGZhiTKmg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ckOW86Dv;
	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 AA73560A263B;
	Tue, 10 Nov 2026 16:55:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ckOW86Dv
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794329704;
	b=BYyhIX+C6kXaMgL4gDArDhn7zZI0aWxbhX6MPgsSR2D9byk6pOTmbMgQXM2xWxefjxOA
	 J8aCklapytJOAc07z5wQnvf0qtL1W/C25GPXL+thYyWxnzT0O9FqpnUDaitwjKnGNasiJ
	 pJymQ7E6eV41ZTuMCZbRrwPFIzZQrN3KPDPyY6rF/0p1r8nRkCRoAzgbvxpr7SfnXZMyO
	 aDEzMgHh58naZg+1JqTFFxQ940dtI9JBYgKmJdETEVe81RCD0thOMoeZggd5qnd0qymFq
	 /0SPUbuyiwsW6JzTgNL6egUIXvaKEbXc6qeV2pubnWtrd+9Jp/eACxmXvw2+0kkTqRQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329704;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=xtlNzexgpyraXnkzb2cGNwRrOc/5l0CGjaw5+9/Uw9c=;
	b=YSco4vNVbfvt4mDY2hjmhJ6eJfGaxAj8BWao/yDio0z0ZswJ26zMLW6/LvH+t0Mi4bmE
	 b51jM1NUFR1NcTjphEsnkqkyegnjjr5nR9gYvFpjESfMB9+0gREBvrO2g4O4NM3iVdhMo
	 TnYBTtqFPIA3fgYANmWj/QVgrh2J613/5C47xj9405+sfHz/1YLrZqdBkX16fdzckr7kB
	 YqnB2EGPIWNN9MQqlDFgt6OT6tn+Ke34+kRCb93Rlv0OrZ0BjnN2ei2PYwPtZg6338uR3
	 zbLpaZKlv+MvRfp4yYZrvSprqeu6OTVJ4RhKqMOibGDxZABBwH+ywNSb4y8Cq5ixSLQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ckOW86Dv;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86C83606A334;
	Tue, 10 Nov 2026 16:55:04 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89C881F0089F;
	Tue, 10 Nov 2026 16:55:03 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794329704;
	bh=xtlNzexgpyraXnkzb2cGNwRrOc/5l0CGjaw5+9/Uw9c=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ckOW86Dv7eBrMYpfPpQlv5/Ibg5XMJLvcfywM/egfYsdxWVtKR1vJOr1svAKtBrmg
	 hiyrpW2QLlO2giu15U6nqD3/97ZOHsUnzrwICpO6HfR4Sg5trE3gk5Hc3VgksIWpUQ
	 sVwcFwg62XOi7QIpVoNi9h58auDKR4t4QwAt+ZGj/Dp4gw8HBw1fFrnwklOL6l6yWG
	 RgyjyyqCabNwtLyrnfknW8peaHMSh/S88RWgWZQLWK81CnTAz7tOZ75xnoPpao+aey
	 ik9HUpKKCb2RHR/N6GHEXNpxyIf4wMi4o66l6MIpbgSNjVgETbSpAwlpLAZN79DxmM
	 j1Mv7WXP17kmw==
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-In-Reply-To: <BB3F0BAB3B9947AF+20261106112522.43965-1-dong100@mucse.com>
X-sashiko-severity: Low
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