๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17173

Re: [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe the ports of each chip

#17173
From: Oleksij Rempel
Date: Mon, 16 Nov 2026 13:36
60 lines
12844 bytes
On Thu, Nov 12, 2026 at 04:08:47PM +0100, Alvin ล ipraga wrote:
> On Thu, Nov 12, 2026 at 09:37:48AM +0100, Oleksij Rempel wrote:
> > Record which ports each chip has, report one more than its highest
> > port to DSA as the port count, and reject a devicetree port the chip
> > does not have. Lower the family maximum to 8 to match.
> >
> > Commit ca5ecd4246d4 ("net: dsa: realtek: rtl8365mb: correct the max
> > number of ports") raised the port count of all chips to 11, but no
> > supported chip has a port above 7.
> >
> > Since commit 51a4a22301b0 ("net: dsa: realtek: rtl8365mb: use dsa
> > helpers for port iteration"), setup also programs unused ports, so
> > every probe writes per-port registers of ports 8..10. Their learn-limit
> > writes go to 0x0A28..0x0A2A, above the learn-limit registers of ports
> > 0..7. We have not seen a visible effect from these writes.
>
> I'm not quite sure what the point of the patch is (sorry, maybe it's
> clear later in the series, but I didn't get that far yet). Was the setup
> of nonexistent ports clobbering some other registers?

Not that I could see. I saw no effect from the writes to ports 8..10.

The reason is the rest of the series. The QoS code in the later
patches handles ports 0..7 only. With 11 ports, DSA accepts a
devicetree port 8..10, and the QoS code would then write a register
that does not hold that port's field. With the per-chip port mask, the
driver no longer accepts a port the chip does not have. I reworded the
commit message to say this.

> Also in the blamed commit there was:
>
> -/* RTL8370MB and RTL8310SR, possibly suportable by this driver, have 10 ports */
> -#define RTL8365MB_MAX_NUM_PORTS                10
> +#define RTL8365MB_MAX_NUM_PORTS                11
>
> So maybe it needs bumping in the future if support is added for those
> chips. That's why I'm wondering if you saw something off?

Good point. v3 drops that.

> >  	dsa_switch_for_each_port(dp, ds) {
> > +		if (dsa_port_is_unused(dp))
> > +			continue;
>
> You can use dsa_switch_for_each_available_port() here.

Done in v3.

> > +
> > +		if (!(mb->chip_info->port_mask & BIT(dp->index))) {
> > +			dev_err(priv->dev, "port %d does not exist on %s\n",
> > +				dp->index, mb->chip_info->name);
> > +			ret = -EINVAL;
> > +			goto out_teardown_irq;
> > +		}
> > +

Thanks,
Oleksij
Technical Details
Message-ID: <avsG3JcrIQgzxUzN@pengutronix.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364342-linux-kernel-netdev=dewy.ru
References: <20261112-rtl8365mb-dcb-ingress-v2-0-f8e6fbdf8c99@pengutronix.de> <20261112-rtl8365mb-dcb-ingress-v2-5-f8e6fbdf8c99@pengutronix.de> <avXUEaiSnKsO705y@analog.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364342-linux-kernel-netdev=dewy.ru
From: o.rempel@pengutronix.de (Oleksij Rempel)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 05/10] net: dsa: realtek: rtl8365mb: describe
 the ports of each chip
Date: Mon, 16 Nov 2026 14:36:28 +0100
Organization: Usenet Network
Message-ID: <avsG3JcrIQgzxUzN@pengutronix.de>
References: <20261112-rtl8365mb-dcb-ingress-v2-0-f8e6fbdf8c99@pengutronix.de>
 <20261112-rtl8365mb-dcb-ingress-v2-5-f8e6fbdf8c99@pengutronix.de>
 <avXUEaiSnKsO705y@analog.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2072981"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HlawzKOvIWMo2BiegL6oPTmrALg= sha256:1iCZmAF49ErFHLC0sSlzj4YSA+vnQI7E8b/RoxIQluI=
	sha1:3NBj2pjrAYdfJG1BwmzRY1da1uE= sha256:IYBETxzufUS3fqisYlEpYVmQ64jwPtWJSXki4uMJ9Us=
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 46119114C24; Mon, 16 Nov 2026 16:36:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 (2048-bit key)
	header.d=pengutronix.de
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 fGLy09iyiID9;
	Mon, 16 Nov 2026 16:36:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364342-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id EC7BF114C25; Mon, 16 Nov 2026 16:36:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5823A2C24A; Mon, 16 Nov 2026 13:36:37 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794836197;
	b=NhwzA746iYvwcu6UR7ZwD2WznOdhMrAVCWshNbAjzhh8V1MwMXUSuS7EZIyFn6/uJVax
	 rhmOG9at/GVgDHe+f7CO2YhPlO4hrYcvKCkvQf5n3VEMhiOs9A0NgA77ero9vD0u9Tecd
	 4JtsAw+bamxXbIi0HCxBjZogXuuxWrOOKT2r5G/i9kcgTxXcYYyTEiNK+a5ll5qYlmpuX
	 76m/EvGTz6njexqRQ7OKSRjLdbdqCKHwpeTw9epPmkf25/MikBb9Cbyee3ZF8eb0046LX
	 CXPAxyF7UXLUziwBO5nE2im46tTfjnc+FfegOAfEo0UX0XngQZIdVqJt2ATatDO5Xew==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794836197;
	h=X-Original-To:Received:DMARC-Filter:Received: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:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=E1FmOO35ppM3Ivasl9eUa5xC86mN03xH8CsNCWcOq5s=;
	b=OKBURnNHcRMOyG8m0pyq3LRRFvG8P7++FrVeMV7nGT4j/vEMSU39nzdSE+SuBfoodmED
	 nM9+Yi0uPLdGNU4hWV0pBoLTJy7Nj7qB5IfIDhI1sn8RbiQl0RKVRIPE+3UUVyxDl8OrS
	 35Q2UzNVXG1loCTqnRCrzH1mCsnThKevKeIGdvG1L0iFxuqfTmvsBy8Ir3uN0vPqvBGWM
	 2LdSDuSQk7NAXtZTbmwnSD4+PuPQ+5WIV8Gw8052/H3AvpHwzly895EVRRAzCq0UIUfkQ
	 VZ9DwLLN4qfGi5E7tew9tLg/lgnY4pxLpwLHoYcjYHSGi06bmgi1G/GLVLuNURKeklA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GpeEMUfT;
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	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 29D9F606A329;
	Mon, 16 Nov 2026 13:36:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GpeEMUfT
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794836191;
	b=0/CAbBOUpSZa80Zn2/1rUvwXlwijRe1BDt1I8EsXB6GOI0k9OchVqUJlWTeWRZNmINq6
	 NnGy+N9VIYJCW1b9NumM3o8uwObunMcQaoCzUquKO9x4c6OjtJF/ilaW8+i5hRRRigyB3
	 eLt+a1kI4AuwkM58Sktw/XFSitLSom3Rk9j5qU8tvnmrN1OM3ZCnsFuaPco2LA4xEP/Kc
	 jIRibIVxlJm5W7BE7ga7qCUvcGPkkU6EYLVRLwvcMQBwUjv/trOyyTlkF1tILihzIrH+H
	 R8899clHdmaO/ipWZSxc+yMHzaZF+OMiaicPl32OdLlnBBI1eIMUgDYFVT76SYImsig==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794836191;
	h=DMARC-Filter:Received:DKIM-Signature:Received:Date:From:To:Cc:
	 Subject:Message-ID:References:MIME-Version:Content-Type:
	 Content-Disposition:Content-Transfer-Encoding:In-Reply-To;
	bh=E1FmOO35ppM3Ivasl9eUa5xC86mN03xH8CsNCWcOq5s=;
	b=cXGker4+WhnwII4XvG/4+dcsmCjHrmBWOZlbDCfCXX73BI+DYVP4ABxs6VMHUOrLmiuH
	 nS973ylERecyLz6jP3Lu2V4Yk2ul+6ZgBuWYNc2I7FV+bkYYwWQ+8/Y2Uuxcb25h2fhaH
	 EHRSSE2vjsWV7vupUJNdhfThf9C3ZWKzs3UzgQy6968ya+2P8LVW150UZTlQxyUfOqA6s
	 uTdAZnY/yQxDspDlh1yrDVnX8aZWWzZRKEPnkF48FWG0PiJulJbo5crltKYRuhsB0b209
	 RB7VnN1eSVysw2kCIb/sLJEImqxgS4q6zPCORX9oQ3EYiYCM1W0OJXf2zkZnsUsyLow==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=GpeEMUfT;
	arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13])
	(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 2C16F606A323;
	Mon, 16 Nov 2026 13:36:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2C16F606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de
X-Received: from ptx.office.stw.pengutronix.de (ptx.office.stw.pengutronix.de [IPv6:2a0a:edc0:0:900:1d::109])
	(Authenticated sender: relay-from-ptx.office.stw.pengutronix.de)
	by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 2B069201763;
	Mon, 16 Nov 2026 14:36:28 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794836188;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=E1FmOO35ppM3Ivasl9eUa5xC86mN03xH8CsNCWcOq5s=;
	b=GpeEMUfTT7TzqmpugiF+R85BIqQWH8ZbJ63W/bYZQfGNCAIf1s69LZbU/mPIen6t1u8DP6
	1/TnLyhKA8NLdbE9qak9QAeMs36oYnGM47ml4g1/KNxLvd7leDAhQrAGsKV8jjQ/Kbe224
	qacFadow5n+VENpqxfzg9OToEIne+APHQdUr68ltk84pYBYljPXMDzDMdlcrFCSVqiC9Jf
	uW+r/vy8j33SxnWiwOTHnH8X1IuouT2EP316ZmsNADOxf0ZrBjDBdsUCFPX95jb67UePqQ
	x1dU/jw4QuM6v08PyuL06ZBUypq6wQxSWqL8UeqyhlSvfqC7JX6SeJHzno0Uug==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794836188;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=E1FmOO35ppM3Ivasl9eUa5xC86mN03xH8CsNCWcOq5s=;
	b=c6ve2O4CJkkevWbMfviz19pzREpTNZ+7mMFtZruVJ+qqV3a2diPtdcP4XGjZoNsvBb8TmS
	rimuAyDo1D67OfuVIZhBXD+MuDqvB3WfNfXkFzZOFERDjz3MHeUqNFJ+unGLqUHRqMHqPi
	jl93Ul7PpPfX0EpSWares9WQSobIUxPZDOJIpnpO3P5rDsl91WhPJTEQIuDMRO6NGTU/Dk
	KzLD8vZPx95at2aYFtNihu9TqkGMTF9JUy+qdB1yp4ORtYqhneSMFQWZpwaqoXVjv071CM
	3HuodWG0dDHU97YyJEVJoiIpzd16zspJ0goxqaT5ByGwDXMnpBCUUjjTvDTrow==
X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1794836188; a=rsa-sha256;
	cv=none;
	b=HBu3jC5kkuOdBfokVVij0GJCdZyjPxmRPqziwqMK3yfm7XldHroohfLRIe/UUpTEFpReX4
	OZ7tspN62l14WSAeowcR5UWVgCKsooNY9rusngXX5ALzJNfRetfSGqLh5EJJQ3OiCTUJQO
	LiFuIWEejn6wzhkZMvmjPq0nCc++AZ9nTcERmLs9XOkePxjnp0ZJacHxE84ao6DHJOXAMc
	22Ti0/Jkjpfsz37spz7kQ4TZinN/it1DtgNeJu7aLNS297CMU01s+Eyg2B9ZxypZ8j8VS3
	a7AJ4NxxdkVHNnfPjwkoVz4OSmvqGJvOmXF1ETSlG6yCDYC0/gyhP73UKBgVJQ==
X-ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=relay-from-ptx.office.stw.pengutronix.de smtp.mailfrom=ore@pengutronix.de
X-Received: by ptx.office.stw.pengutronix.de (Postfix, from userid 1058)
	id 184C31BFABC; Mon, 16 Nov 2026 14:36:28 +0100 (CET)
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Linus Walleij <linusw@kernel.org>,
	Luiz Angelo Daros de Luca <luizluca@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de
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: <avXUEaiSnKsO705y@analog.com>