🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24246

Re: [PATCH net-next v16 14/15] net: dsa: realtek: rtl8365mb: use PCP numbering on family D

#24246
From: Linus Walleij
Date: Sun, 29 Nov 2026 22:52
54 lines
11709 bytes
On Sun, Nov 29, 2026 at 4:12 PM Mieczyslaw Nalewaj <namiltd@yahoo.com> wrote:

> Family C has separate per-port registers for the 802.1p PCP given to
> untagged frames (0x0851-0x0852) and for the port's default internal
> priority (0x0877-0x0878). The shared QoS layer hands the backend internal
> priorities that are 802.1Q traffic types (Best Effort is 1, Background is
> 0) and writes the untagged PCP separately.
>
> Family D has no 0x0851-0x0852 registers: its per-port PVID register at
> 0x0700 + port holds only the 12-bit VID, and
> dal_rtl8367d_vlan_portPvid_set() rejects any priority != 0. On an
> RTL8367S-VB the PCP of a newly inserted 802.1Q tag follows the frame's
> internal priority, so writing the traffic type as is made untagged
> frames leave an egress-tagged port with PCP 1 (Background) instead of
> PCP 0 (Best Effort).
>
> The vendor API numbers family D internal priorities like PCP values:
> dal_rtl8367d_qos_init() maps each PCP to the same internal priority, sets
> the port priority to 0 and keeps 1p remarking disabled. Do the same.
> On family D, convert between traffic types and the chip's numbering at
> the register boundary: for the port priority, the PCP-to-priority and
> DSCP-to-priority tables, and the priority-to-queue table. The PCP of a
> newly inserted tag then matches the traffic type whichever source
> classified the frame, and each traffic type still lands in the same
> queue as before.
>
> Add the family D implementations of the qos_iprio_to_hw and
> qos_hw_to_iprio hooks introduced by the previous patch. Make the
> qos_set_untag_pcp hook optional and leave it unset on family D, which
> cannot assign a configurable PCP to untagged ingress frames. Use the
> absence of that capability to reject PCP trust, while keeping port-based
> default priority and DSCP trust supported. The family D hooks are wired
> up by the patch that adds the first family D chip, so this patch changes
> no behaviour yet.
>
> Gustavo Foletto Mora, who reported the issue, confirmed on a TP-Link
> EX511 v2 with the baseline QoS configuration (no CONFIG_DCB) that
> untagged frames leave tagged with PCP 0, tagged frames keep their PCP,
> and the QoS registers read back in PCP numbering. Neither the rejection
> of PCP trust nor DSCP trust was exercised on hardware, as both need
> CONFIG_DCB.
>
> Reported-by: Gustavo Foletto Mora <gusfmora@gmail.com>
> Closes: https://github.com/openwrt/openwrt/pull/19644#issuecomment-7067296792
> Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>

Looks like a reasonable fix.
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij
Technical Details
Message-ID: <CAD++jLkF=4bHOSvMNU=-rm33Cx3r_TUGAH6ANbiTvT4_gZ1aQA@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373689-linux-kernel-netdev=dewy.ru
References: <aebcc7f6-d5f8-4157-b63a-e2e707d9859b@yahoo.com> <f8403d48-39c9-45c8-977f-f029c04b3f02@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373689-linux-kernel-netdev=dewy.ru
From: linusw@kernel.org (Linus Walleij)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v16 14/15] net: dsa: realtek: rtl8365mb: use PCP
 numbering on family D
Date: Sun, 29 Nov 2026 23:52:40 +0100
Organization: Usenet Network
Message-ID: <CAD++jLkF=4bHOSvMNU=-rm33Cx3r_TUGAH6ANbiTvT4_gZ1aQA@mail.gmail.com>
References: <aebcc7f6-d5f8-4157-b63a-e2e707d9859b@yahoo.com> <f8403d48-39c9-45c8-977f-f029c04b3f02@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1278925"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/gDsCy8PTfJzhncTLBFRHnPWwUI= sha256:MxT/L4sXGX6YO/lCGyBFlL7Xycr4QwTgXKMbeDkPHyI=
	sha1:R7PEqKtLgrcvvRMkndRGmy9R2A8= sha256:aMtIhtQ/K+oG5m7FwRmBz3KKdgGSGE5aQTaRzBd6aIE=
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 8B443125FB0; Mon, 30 Nov 2026 01:53:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 a-soAWNMJk7D;
	Mon, 30 Nov 2026 01:53:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373689-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id AD424125F08; Mon, 30 Nov 2026 01:53:01 +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 DD7E0289B2; Sun, 29 Nov 2026 22:52:55 +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=1795992774;
	b=iyBpLwLXUl0BSe5bY/OSqqCPSigPh/+IxA5t+cXH2Que6mtIljH4utj0imuy1rWiypP8
	 1hvcSgMlR19f4fSoWXwxOGobJ6OlW5FCDF1AjlHaHqv6e75OL+QxbpQEvfW/40I6oRXRq
	 MzyqVJeOBqaxJTbzhCGwqfMSy0xPldMy2iq5Lsd//esQy22HkD+mvAiPFaxEukDWCvPmi
	 /whhAfsoRbmEiLSVyNc1nctMhTlVAXfihnZpZaY3wzuFus3gM8b81gODixOSIsoEq9+FY
	 UwC+QVpYglJQmZKzYJL//BMVxZnbR9NS88ImQyjs8f0r5iNX04CcQn4A/pk8SDKg0PA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795992774;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=nmGDtLDDNy3yOCpRv+PSVq47dJ3S2Stvm/3yLS5Qiwc=;
	b=EMToKX4lbb9RYHnv8FNPnS93x6L7Midn5gi4ylFZmJRF/viGMdRpIywdI9VvDRHPZk7v
	 rPPDY2Qph9mgN/Xo3F6EmhJ2aZPYOwJWVbIXjOPPIav8JZLHUvK4BkEkaFRtNoqETIOVh
	 yyS7Xra3Fnrp+cDTedk53pqqQI8yvmP/rQxpSe9xKdaDxMTGIowPnbMczeusEUPWDNH4R
	 Q/xnBYHKcCdlE6vLcTYpxLFdM2S9bg4URtBKGnxK+TczqF9wkKwUFrVBBllJtPvYXvAhQ
	 ldkAndC3ddKs3kwvDFZXMV6aoRjV3dB8eJkzwzknaf4vbvu9emazmu5KheIkn5LEBug==
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=Vc+IVm8J;
	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 B128F606A335;
	Sun, 29 Nov 2026 22:52:54 +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=Vc+IVm8J
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=1795992773;
	b=Etvwd4ugJWxEDDLi9/yc2s4AyCIYu9s9Gzj2y01kfgZW6x/n06u8JZMIpxgx8cZVrfJ0
	 Hhw/ofzbogiT//VhQuE7j5twJaWffRjLGLci7E7bYz/yg33Iu93P8qfgtmMSJr/mu3OtH
	 hnAz4dMqgAaj06cTOmjJYkUC+8y1Llg+JheRNE5YCE88UCDX3WW5ytOhJj5sSbA4llyHR
	 NNOhYV8PA96/AHOmq0x3X350nDDsr/rIotEn9Pakcv+d3C54B2PNO6Iy4fBrnnN7fPwTo
	 UQ4O/1ToIb14pPI/G7j7Bu0OkjIBVtvZNSwMx2PsQwOkEu2h/BHcmmoKrrUwmEKP7EQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795992773;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=nmGDtLDDNy3yOCpRv+PSVq47dJ3S2Stvm/3yLS5Qiwc=;
	b=H2I1EB/0i3C0y6htuMlzi09ODAXT9W8M7hcrDdTVrkLlFHusjZE68xiSU3AV2vY+YLQs
	 +hF2YSNvAB0oKKYgOjdIf3B/xycWIkOhhLqqfLDooGCOSIpIG2ciRTdbTxilIxnhdwslD
	 nlOEMM13wTyfFv2eDJPGAXhYoHiFWiR5jNru6moC+fEB+/5siqJhWWYflKQ2AdOH4XPSm
	 tAthcnsxcbFnc2KM4kR71pxF94gbDysT2tXSeni48Q5wQKA40QQvIN934FwRleh8sNNKN
	 W8N3o6BEDWZZdawE7Ob4LkVVDrjyA/MurHqnt7fXC4QeQc6UC0ml3NSDJxdBq87Vp0g==
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=Vc+IVm8J;
	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 CCBD8606A327
	for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 22:52:53 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E8ED1F0089A
	for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 22:52:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795992773;
	bh=nmGDtLDDNy3yOCpRv+PSVq47dJ3S2Stvm/3yLS5Qiwc=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=Vc+IVm8J26NYNio5tTZ0gBtPZg0XdjPrgb/M8dzvJLxQKTEK8B/+RxMKoHqWuLmP1
	 KL/Or67SMKa/83kf60cMIyNL0PZUTXzCjtCTsmB68dYZciTNONbKfPzXkBBFUkNcJS
	 LgIFdnYf+ZLlj/lTvHPgHMy0SgP7/FeL5TnbIxrxuWPhm0d2qnxttFgjMVEQ8YlooS
	 LXOsx2lNqJ/oRi1pEPym6ILfkMpgacmfdA8v+8/V4MXM7vJY5Sw7jdMFaanvgvciM4
	 AgWEyG7DHPo6OSAKZMPIBWd9SfjJY3vzDmHd7a9EAr4i6+9H4hzRvPTsZtTSQ8RoDo
	 6i2FsSgdG6GnQ==
X-Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5c148d4dbfbso8102353e87.3
        for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 14:52:53 -0800 (PST)
X-Forwarded-Encrypted: i=1; AL+hErFqSkqPeUdWoQNzWgRyQUH8UXcxLx/h5jAeBJu93Mqp/BMzkxQuRIqbJcGzYlwHDAbvLF1vBIk=@vger.kernel.org
X-Gm-Message-State: APuU4Z89fybgrjcfxNth2XCVwxEReHDJ4b2w8y8XHZ8Ez8fJYsAFFQkK
	XObrUjHW53ub4sEZuBFwDkD1PpkbwCvQ5OClOSb7v5CPej1RNnSrM1LQuGlxZnmkQtD6JpSTyGj
	eRp70njXJm17+xjaM84F1uzdf37M3NR4=
X-Received: by 2002:a05:6512:3f03:b0:5c1:4a5d:6ae1 with SMTP id
 2adb3069b0e04-5c1bc7c3479mr11424318e87.14.1795992772042; Sun, 29 Nov 2026
 14:52:52 -0800 (PST)
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: <f8403d48-39c9-45c8-977f-f029c04b3f02@yahoo.com>
X-Gmail-Original-Message-ID: <CAD++jLkF=4bHOSvMNU=-rm33Cx3r_TUGAH6ANbiTvT4_gZ1aQA@mail.gmail.com>
X-Gm-Features: Aa3M54o8oUK09nl4FJYks_sT7kiA3ryPO5yN6L2GZLgY2avEiy01F4PXvsrahes
X-Cc: andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net, 
	edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, 
	luizluca@gmail.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, 
	linux-kernel@vger.kernel.org, alvin.sipraga@analog.com, gusfmora@gmail.com, 
	kuncy7@gmail.com, fabianotassotti@gmail.com, gabonpivovich@gmail.com, 
	contact@c127.dev, o.rempel@pengutronix.de