Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"@driver=sparx5-switch": {
"comment": "LAN969x switch ports; the gate control list memory is shared by all ports",
"qos-trust-order": ["pcp", "dscp", "dscp-pcp"],
"qos-ets-table": true,
"qos-priority-counters": ["tx_port_green_p", "tx_port_yellow_p"],
"qos-offload": ["classification", "remarking", "transmission-selection", "egress-shaper", "credit-based-shaper", "time-aware-shaper"],
"qos-root-qdisc": ["ets", "mqprio", "taprio"],
"sched-supported-list-max": 3000,
Expand Down
11 changes: 10 additions & 1 deletion board/common/rootfs/etc/interface-quirks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"lar-needs-scan": true
},
"@driver=mv88e6085": {
"comment": "Marvell LinkStreet switch ports; the fabric encodes PCP from the priority itself, so remarking PCP changes nothing",
"comment": "Marvell LinkStreet switch ports; a cascade of chips carries only the priority between them",
"qos-trust-order": ["pcp", "dscp", "pcp-dscp", "dscp-pcp"],
"qos-ets-table": true,
"qos-pcp-encoded": true,
"qos-queue-counters": "out_queue_",
"qos-offload": ["classification", "remarking", "transmission-selection", "egress-shaper"],
"qos-root-qdisc": ["ets"]
},
Expand All @@ -15,5 +17,12 @@
"qos-trust-order": ["pcp", "dscp", "dscp-pcp"],
"qos-offload": ["classification", "remarking", "transmission-selection", "egress-shaper"],
"qos-root-qdisc": ["ets"]
},
"@driver=pasw-saline": {
"comment": "Packet Architects FlexSwitch ports on Saline; strict priority only, shapers and gates per queue",
"qos-trust-order": ["pcp", "dscp-pcp"],
"qos-class-at-ingress": true,
"qos-offload": ["classification", "transmission-selection", "credit-based-shaper", "time-aware-shaper"],
"qos-root-qdisc": ["mqprio", "taprio"]
}
}
7 changes: 7 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ All notable changes to the project are documented in this file.
[v26.12.0][UNRELEASED]
-------------------------

### Changes

- New `get-statistics` action on the `qos` container of a port, reads the
frames each traffic class has sent. `show interface NAME` lists them

### Fixes

- Fix Wi-Fi station roaming on Raspberry Pi
- Fix #1611: background traffic prioritized above best effort on devices
with more than one switch chip

[v26.11.0][] - 2026-11-30
-------------------------
Expand Down
78 changes: 53 additions & 25 deletions doc/qos.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ admin@example:/config/interface/…/qos/> <b>set egress remark pcp from-priority
admin@example:/config/interface/…/qos/> <b>leave</b>
</code></pre>

**Let ordinary and background traffic share an uplink.** On a port
with eight traffic classes, ordinary traffic, priority 0, is in class 1
and background traffic, priority 1, in class 0. With weights of 80 and
20 percent, background traffic keeps a fifth of a busy port and
ordinary traffic the rest. The classes above stay strict:
**Let ordinary and background traffic share an uplink.** Background
traffic, priority 1, is meant to yield to ordinary traffic, priority 0,
so on a port with eight traffic classes it waits in the lowest class, 0,
and ordinary traffic in class 1, see [Defaults](#defaults). With
weights of 80 and 20 percent, background traffic keeps a fifth of a busy
port and ordinary traffic the rest. The classes above stay strict:

<pre class="cli"><code>admin@example:/config/> <b>edit interface e10 qos egress</b>
admin@example:/config/interface/…/egress/> <b>set traffic-class 1 algorithm enhanced-transmission-selection</b>
Expand Down Expand Up @@ -221,14 +222,28 @@ Configured under `qos egress`:
Traffic class settings.
///

The first two live under `traffic-class-table`. The number of classes
is not configuration: a port has one class per transmit queue, at most
eight, and a single-queue port has no queue structure to respect and gets
all eight. The count is reported as `max-traffic-classes` and picks the
column of the preset. The mapping is a preset, `ieee` for an ordinary
bridge or `ieee-sr` for ports carrying reserved streams, both described
below, or a custom table where an unset priority falls back to the `ieee`
value. The algorithm is `strict-priority` (default) or
A traffic class is a queue on the port a frame leaves by. The
`traffic-class-table` says which class a frame of each priority waits
in, and the `traffic-class` list how the port chooses the class to send
from next. The table only decides the queue: the frame keeps its
priority, and with it the PCP and DSCP it leaves with.

The first two settings live under `traffic-class-table`. The number of
classes is not configuration: a port has one class per transmit queue,
at most eight, and a single-queue port has no queue structure to respect
and gets all eight. The count is reported as `max-traffic-classes` and
picks the column of the preset. The mapping is a preset, `ieee` for an
ordinary bridge or `ieee-sr` for ports carrying reserved streams, both
described below, or a custom table where an unset priority falls back to
the `ieee` value. With eight classes the `ieee` preset puts every
priority in the class of its own number, except that priorities 0 and 1
trade places.

The table is set per port, but most switches hold one for all their
ports, see [Hardware Offload](#hardware-offload). Give the ports of a
switch the same table, e.g. with a [profile](#profiles).

The algorithm is `strict-priority` (default) or
`enhanced-transmission-selection`, the latter sharing what the strict
classes leave in proportion to `bandwidth`, a percentage the weighted
classes of a port sum to 100 with. The scheduler is work-conserving, so
Expand Down Expand Up @@ -526,6 +541,13 @@ available offload : egress-shaper, credit-based-shaper, time-aware-shaper
0 1 strict-priority
</code></pre>

On a port that keeps counters per traffic class the table has a `SENT`
column as well, the frames each class has sent, and a `DROPPED` column
where the port counts those. They are read from the port when the
command runs. The `get-statistics` action under the port's `qos`
returns the same counters over [RESTCONF](scripting-restconf.md) and
NETCONF.

Everything shown is read back from the port, from the switch hardware
where it does the work and from the kernel elsewhere. It is what the
port runs, which for a port on a profile is the profile's settings.
Expand Down Expand Up @@ -639,6 +661,13 @@ has taken with the current configuration. A supported stage missing
from `offload` fell back to the kernel, e.g. a traffic class table the
fabric cannot carry; a stage not supported always runs there.

A switch chooses the queue of a frame when the frame arrives, from the
priority it has just classified, before the frame reaches the port it
leaves by. Most switches therefore keep one traffic class table for
all their ports, and a port whose own table differs from it is not
offloaded. Only a switch that looks the queue up again per egress port,
like the LAN969x below, honours a table of its own on each port.

Each feature maps to one Linux mechanism, and whether it reaches the
hardware depends on the driver implementing the matching hook:

Expand Down Expand Up @@ -705,6 +734,9 @@ orders are accepted. Three hardware details show through:
- Frames the CPU itself sends, routed or locally originated, are injected
past the tables, so their DSCP is remarked by the kernel instead and
their PCP comes from the VLAN interface settings described below.
An untagged frame waits in the traffic class of its priority. A
tagged frame waits in the queue with the number of its PCP, whatever
the `traffic-class-table` says.

The `traffic-class-table` and the `traffic-class` list apply to hardware
forwarded frames as well: each priority is queued in its traffic class,
Expand All @@ -713,23 +745,19 @@ rest by Weighted Round Robin (WRR)[^11] with the `bandwidth` shares as
weights. The `egress-shaper` is the port's own shaper. Four
hardware details show through:

- A frame's output queue is chosen where it enters the switch, by the
ingress port's tables, so the `traffic-class-table` is one per switch
chip, not per port. The port configured most recently defines it,
and every port whose own table differs is no longer offloaded: its
`offload` list under `capabilities` leaves out
`transmission-selection`. Give every port the same table.
- The `traffic-class-table` is one per switch chip. The port
configured most recently defines it, and every port whose own table
differs is no longer offloaded: its `offload` list under
`capabilities` leaves out `transmission-selection`.
- The WRR weights are one set per switch chip as well, defined the
same way by the port configured most recently for each weighted
class. Give every port with weighted classes the same shares.
- A frame crossing from one chip to another inside a device carries its
priority between them, as it would between two switches in a network,
and the far chip queues it in the class of that priority. This is the
general rule of QoS in a network: classification at the first ingress
decides the priority, and every hop after it trusts and queues by that
priority. Steer traffic with the ingress `dscp-map` and `pcp-map`;
a `traffic-class-table` other than the identity holds for frames that
enter and leave on the same chip.
and the far chip queues it by its own `traffic-class-table`. This is
the general rule of QoS in a network: classification at the first
ingress decides the priority, and every hop after it trusts that
priority and queues by its own table.
- The WRR counts frames where `bandwidth` speaks of bytes, so the shares
hold for traffic of similar frame sizes.

Expand Down
Loading