๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24630

[PATCH net-next v2 0/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority

#24630
From: Oleksij Rempel
Date: Mon, 30 Nov 2026 13:23
103 lines
14587 bytes
This series adds strict priority egress scheduling to the rtl8365mb
switch ports.

It uses the ETS qdisc interface, as ksz9477 does for the same setup.
When ets was chosen there, the priomap problem described below was not
clear. ksz8 uses ets the same way. Solving the priomap problem in
sch_ets later is likely simpler than moving these drivers to another
interface.

By default, the driver sets all queues of a port to weighted fair
queuing (WFQ) with equal weights. No queue is served before another.

To enable strict priority on a port:

  tc qdisc replace dev lan1 root handle 1: ets strict 8

The qdisc must have as many bands as the port has queues, eight on
this switch.

To go back to the default:

  tc qdisc del dev lan1 root

These commands change only the egress scheduling of the port they
name, also for frames that the host sends on it. Frames that the
switch sends to the host leave through the CPU port, which stays on
WFQ.

The ETS priomap is not offloaded. The figure shows how the switch picks
the egress queue of a frame that leaves on lan1:

 lan2 (ingress), forwarded frame          host, frame sent on lan1

 port default    PCP        DSCP          skb->priority (TC_PRIO_*)
 802.1Q prio  (trusted)  (trusted)                 |
     |            |          |                     | priomap
     | pcp_to_tt  |pcp_to_tt | dscp_to_tt          | (TC_PRIO -> band)
     v            v          v                     |
 +------------------------------+          +-------v-------+
 | traffic type (TT)            |          | sch_ets band  |
 | DSCP > PCP > port default    |          | strict: 0 1st |
 +--------------+---------------+          +-------+-------+
                |                                  | software only
                |                                  | DSA tag, no class
                |                          +-------v-------+
                |                          | CPU port      |
                |                          | default -> TT |
                |                          +-------+-------+
                |                                  |
                +----------------+-----------------+
                                 |
                                 v
                     +-----------------------+
                     | TT -> traffic class   |
                     +-----------+-----------+
                                 |
                                 v
                     +-----------------------+
                     | lan1 egress queue     |
                     | strict: highest first |
                     +-----------------------+

The switch and the ets qdisc use different inputs:

- For a forwarded frame, the switch takes a traffic type from the port
  default, the PCP or the DSCP. It then maps the traffic type to a
  traffic class and a queue.
- The ets priomap maps skb->priority values (TC_PRIO_*) to a band.
  Unlike mqprio and taprio, sch_ets does not set the netdev traffic
  classes (prio_tc_map).

The driver therefore does not use the priomap to program the traffic
type to traffic class map of the port. It cannot check the priomap
against that map either, because the two maps have different inputs:
skb->priority values on one side, traffic types on the other. The
driver accepts any priomap and does not offload it.

Tested on an RTL8365MB-VC.

---
Changes in v2:
- Link to v1: https://lore.kernel.org/r/20261124-rtl8365mb-ets-strict-v1-0-6ab01ad545c8@pengutronix.de

---
Oleksij Rempel (2):
      net: dsa: realtek: rtl8365mb: default the egress scheduler to WFQ
      net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling

 drivers/net/dsa/realtek/realtek.h        |  14 ++++
 drivers/net/dsa/realtek/rtl8365mb_main.c |   8 +++
 drivers/net/dsa/realtek/rtl8365mb_qos.c  | 107 ++++++++++++++++++++++++++++++
 drivers/net/dsa/realtek/rtl8365mb_qos.h  |   3 +
 drivers/net/dsa/realtek/rtl83xx-qos.c    | 108 +++++++++++++++++++++++++++++++
 drivers/net/dsa/realtek/rtl83xx-qos.h    |   2 +
 6 files changed, 242 insertions(+)
---
base-commit: 81159a672c331993566a12ad8e07532b38355cba
change-id: 20261123-rtl8365mb-ets-strict-113214ad321a

Best regards,
-- 
Oleksij Rempel <o.rempel@pengutronix.de>
Technical Details
Message-ID: <20261130-rtl8365mb-ets-strict-v2-0-9639f6f40499@pengutronix.de>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374224-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374224-linux-kernel-netdev=dewy.ru
From: o.rempel@pengutronix.de (Oleksij Rempel)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 0/2] net: dsa: realtek: rtl8365mb: offload ETS
 strict priority
Date: Mon, 30 Nov 2026 14:23:13 +0100
Organization: Usenet Network
Message-ID: <20261130-rtl8365mb-ets-strict-v2-0-9639f6f40499@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1432679"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:3FsBDRYfzNKtOGnBsm21IDuU1do= sha256:mWYeTyFvi27gnBZl9l6nLKpRjODHfdaZcXS2+r65O8w=
	sha1:sRjhewsaoE/y14QH4wlRFMucuhc= sha256:ercRAhpmaMiOiZSl+GxVLSwR3Ux+hce+2FI4WnwpVIw=
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 8D30E125FF0; Mon, 30 Nov 2026 16:24:49 +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 rCUkPxYrtVW2;
	Mon, 30 Nov 2026 16:24:45 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374224-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 8CFF0125FEF; Mon, 30 Nov 2026 16:24:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 9182C2789B; Mon, 30 Nov 2026 13:23:38 +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=1796045008;
	b=WicsuIeLQZ6NtH28DBePvNSOZpux+0gJAw6Z/xEUTcYPI3fp3BsYwRnOQzYjDSnEz8s4
	 DStcwJbweFfZEzvvhDMVT0HFTv7p04zQaH7sCa44hIjE1EO4zQVVbvEbDjimLArQcpnGs
	 imEfArWloi3lLBTUPgFDa/RJ59xkEAc6bX1+1LFd9VM4fjZ2GITKKHN/jm+MvjQkpBRTp
	 Hx3egrRo0hY81Tyvfz7lyt6G9cmrv6R3hRZsiVpqgCJiYql/YAu+vUD5K5xP7vDMUGxoO
	 BIG8lq27QRzKppNg1HlSrOEBN2/oL+Zmpma4jVCZaiEPFO/lqQCezsN0Mn29oNrASrQ==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796045008;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received:
	 From:Subject:Date:Message-Id:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking:
	 X-Change-ID:To:Cc:X-Mailer;
	bh=JKROOuCSKKYv9HHmRMukwTHJsgeE2pQhOXX8gPAVzJE=;
	b=Aciw0FHlNJsHIIA+SJltQSK5a2EEDGJLPDj+B50+EDwt5CXTP+SsNrmZ6ZLt8QltimUz
	 EQb2jo9JQuqP4bwZlGYEYty7xWYZzxflV38l0u/SaeJqIStalvjxDjGr03Lqke5/vs3X2
	 msT9puTP7k+0F1x53vxkxzTjFm95HQcJkWEFIlSIKIVSm4evM4fJT75eNrdYZpQi85D+W
	 nq9Jn2+UNFa13mD9AOHbWGv8agf0ymlOdRyML9ESYFtzAkoB+Ftahg3BxwRK9IpcUc457
	 M/G8qVLuy0uG7aah9RRPnEkmCDBqvctqzWwi7tcygpNcK7HvfdGSXDRDGzjeh5+Evfg==
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=EvOeLhTx;
	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 9E31F606A6B0;
	Mon, 30 Nov 2026 13:23:28 +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=EvOeLhTx
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=1796045002;
	b=xYiELl96JcGRQoby4A0PSqxSPVoQJnIL9rd/S66lGhLdmI88N4kLsschtgoHZKPSCChv
	 0ipq2jkSA1zDZTN7OG1D3WfNCFYdPRbwvx4/HrNTzh5gXPDbUfC0mCfpzRx/vW77d+lgm
	 JLk6TEB0/ERgRb97Wq3glLNHtVXWhgOMQ5jFGSeGW0QcPOI6fJk3mKQHViYJ29d7+R2sG
	 6LK19uc25PBc04k0maNcH216m6IwNcPcyBIZ4SRiF/emMjqDqC/xSA+B46PLH1aowO1rK
	 EnXVmAkFSBbU6EePyRv+T38w+QaFat3wcdgxRD0ouq26YcY6YI405inrkqtSb+6Y5iQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796045002;
	h=DMARC-Filter:Received:DKIM-Signature:Received:From:Subject:Date:
	 Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding:
	 X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer;
	bh=JKROOuCSKKYv9HHmRMukwTHJsgeE2pQhOXX8gPAVzJE=;
	b=M1ItTfyJkOuyMhbiJTBeVNl2iBEzmcs/JHWXGBev8HYyjgjXiVmowSWn5CvgMqD3DTjz
	 om77tszv6YTjf9vwGPnXtV/mDdDszVrSpK6sHtqCt6P3OO1d899xIjXfgMahe5SENxlKx
	 N2W//mk05VqySqCQUBXtOEKXqaiudlZM74F2aoJwnaLKkTImGADIL/9VNZTpTYDCPVrRy
	 VCCw5yJaJ1HbCrCz7L5/VCbzq/2css8jRCFpeCr7/BwY15X72RZtHolCkDP8Tv4ypfBDL
	 Ysrmbgg/WY0Z10ElO0YZAntn9iQR+w4V89YBXwpzzMRFc/Lvzyx1B81z5enQ4xiP0pg==
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=EvOeLhTx;
	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 E589B606A325;
	Mon, 30 Nov 2026 13:23:20 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E589B606A325
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 dude04.red.stw.pengutronix.de (dude04.red.stw.pengutronix.de [IPv6:2a0a:edc0:0:1101:1d::ac])
	(Authenticated sender: relay-from-dude04.red.stw.pengutronix.de)
	by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id E267E205BA9;
	Mon, 30 Nov 2026 14:23:18 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1796044998;
	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;
	bh=JKROOuCSKKYv9HHmRMukwTHJsgeE2pQhOXX8gPAVzJE=;
	b=EvOeLhTxxTJy2T/xjW3FLe1axuZs2xT0F73YMxTzg/UCyirqFIVN2l22WGmZb3tStlaaaB
	QLa2rIe91dtKWp1nNjlby8SwPtM2xH3/7PVS2WOgEbDi4HAvN4MhtdV5vNtiZMOWKgrUfg
	xs9FVRl16haoB0I/2NvxAKCXk5N6JApb+BziBqJQTPgyRPH37SFf2G54pmC7H6Eo521tX4
	GN5BQ3hB1n8p4JNph8fIEFxofuABXBspIMFdrYiGJQElEAv7jKnlSkdW7AWMgtCQXiyx/w
	B7rRTNYaAa0oe/2TlzFLhCGQE7ItagyRnmAJHg0kDPBF10grsDkPPJZMc79t6w==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1796044998;
	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;
	bh=JKROOuCSKKYv9HHmRMukwTHJsgeE2pQhOXX8gPAVzJE=;
	b=H31ISi5nKlCRPObq1B9CsYGiNP2aIoG6N6e/Ru+8vy+Kc9KJw/fwbkXEg1e8IbSVArTwvA
	772xczmjLxwi720nK0VZ/s6eTfOb5uFRK+M4C04deAZpcyGCQfhzqJ6g5z/zK6QWrwlojb
	4ldJVXIuBD9hp/HIS43Gz2L2ES8MBS/h1qtD4QQ+ZNpb5or7EAMi4dom3aJ9Z7AKvFl1Yg
	4Y86yf/C/I16CvYBOLFXU3xe+f7NmQSLFZh3XoVe/WCJpbXPA7nMrmEB3ABnxteyq0WD7B
	PNMh2u22pGjhf9gmzUIhpOn1rRXbh8zonkXY+BzMyf0Fp6CerTRohwNqTtmrIw==
X-ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=relay-from-dude04.red.stw.pengutronix.de smtp.mailfrom=ore@pengutronix.de
X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1796044998; a=rsa-sha256;
	cv=none;
	b=JQ3KoAqKa8Gb/cQha4CYTzna1ss675eSCZH99UR7xWq3dJPBZttO7Hpy8bFXflSXwwU/JN
	M0j8xu0GwuJX8UMCc/Lt0EvIJKGRAoa71gU2UX5w5phC5pkCh++kYga+bd9jc/REnNvxEz
	JH6d1qhXrqmaMEhSfH/oMEkTSJkNY3N3WRt+NEfrKSelgFiBwwEYr+hZI6m8VaUbPywFX5
	2nOnnyuI9uFOpxyX6Msb8NWzGDIwFCjDLvzojaYXDQ/d+l6GyjsABdD6RSCH5PmjmTkbCg
	s+2GcNawtpirEprnQX4Z8z6opTuXR2yygcT+Rubtd3BwYhf0ihAc0O+0YCD3wA==
X-Received: by dude04.red.stw.pengutronix.de (Postfix, from userid 1058)
	id C4C8D3807E5; Mon, 30 Nov 2026 14:23:18 +0100 (CET)
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-B4-Tracking: v=1; b=H4sIAMF4DWsC/22OzQqDMBCEX0X23C0m/iA99T2KhyRudaGNsknFI
 r57o7S3XhZmh29mVggkTAEu2QpCMwcefRL6lIEbjO8JuUsadK5rpXSBEh9NUVdPixQDhijsIip
 VaFWaLl0DCZ2E7rwcsTfwFNHTEqFNjjWB0Irxbthjfx7u/50cOMRR3seeWR38t7r8Xz0rzLE2N
 lemq8rKNdeJfP+KMnpezh1Bu23bB9f6AWbnAAAA
X-Change-ID: 20261123-rtl8365mb-ets-strict-113214ad321a
X-Cc: Alvin ล ipraga <alvin.sipraga@analog.com>, 
 Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, kernel@pengutronix.de, 
 Oleksij Rempel <o.rempel@pengutronix.de>
X-Mailer: b4 0.14.2