mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority
@ 2026-11-30 13:23 Oleksij Rempel
  2026-11-30 13:23 ` [PATCH net-next v2 1/2] net: dsa: realtek: rtl8365mb: default the egress scheduler to WFQ Oleksij Rempel
  2026-11-30 13:23 ` [PATCH net-next v2 2/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling Oleksij Rempel
  0 siblings, 2 replies; 4+ messages in thread
From: Oleksij Rempel @ 2026-11-30 13:23 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Linus Walleij, Luiz Angelo Daros de Luca, Andrew Lunn,
	Vladimir Oltean
  Cc: Alvin Šipraga, Simon Horman, netdev, linux-kernel, kernel,
	Oleksij Rempel

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>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-01 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 13:23 [PATCH net-next v2 0/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority Oleksij Rempel
2026-11-30 13:23 ` [PATCH net-next v2 1/2] net: dsa: realtek: rtl8365mb: default the egress scheduler to WFQ Oleksij Rempel
2026-11-30 13:23 ` [PATCH net-next v2 2/2] net: dsa: realtek: rtl8365mb: offload ETS strict priority scheduling Oleksij Rempel
2026-12-01 13:26   ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®