Skip to content

Packet trimming and `lossy-multi-tc`

S3·E4Enable trimming everywhere, next Tuesday · NVIDIA briefing room, joint design review, five days out

S3·E4Analyze~30 minsources checked todayverified against Cumulus Linux 5.18 Packet Trimming and RoCE pages, NVUE 5.x QoS reference; re-fetched 2026-09-07

Builds on: Tuning the lossless edge: PFC headroom, ECN thresholds, watchdog

Before you read: what do you already know?

3 quick questions. Wrong answers are fine and expected; trying first makes the lesson stick.

After this lesson you can

  • Explain what the switch does to a packet it would otherwise drop when trimming is enabled and why that shortens recovery.
  • Determine whether a given traffic type on a given switch is eligible for trimming from the ASIC and traffic-scope rules.
  • Write the full lossy-multi-tc command set for a leaf with host-facing and network-facing port ranges including the DSCP remark profiles.
  • Analyse the cost of trimming - the consumed service port and the counter that does not exist - and state what it means for a customer design.

Episode 4 — Enable trimming everywhere, next Tuesday

The situation · NVIDIA briefing room, joint design review, five days out

The customer’s architect has the blog post printed and a request: enable packet trimming across pod A next Tuesday, in time for acceptance. The Dell SE has already put the date in his spreadsheet, one row under “fabric ready”. The NVIDIA PM is at the end of the table with a roadmap slide and answers exactly one question all evening with the words “not announced”.

You ask four questions in a fixed order, and the first one ends the Tuesday. Which ASIC — Cumulus Linux supports packet trimming on Spectrum-4 and later.[1] Is the RoCE traffic encapsulated — trimming does not support VXLAN packets, and pod A’s tenant traffic rides an overlay on the same leaves.[1] Which traffic classes carry it. And which physical port can they surrender, because enabling trimming consumes one service port on which port security, adaptive routing, QoS, ACLs, PTP and telemetry must not be configured — and every uplink out of pod A runs adaptive routing.[1]

Trimming exists because a drop is expensive in a way that has little to do with the lost bytes. The switch trims and forwards packets that are about to be discarded for want of buffer, so instead of silence the receiver gets an obviously incomplete packet and can ask for the data again immediately.[1] On a collective that runs at the speed of its slowest participant, that is the whole difference.

Trimming is a purchasing decision with a configuration attached. Segment 1 is that third answer to a full buffer.

1A third answer to a full buffer

Lessons 3.2 and 3.3 gave you two responses to a congested queue: pause the upstream port so nothing is lost, or mark CE and let the endpoints slow themselves down. Packet trimming is a third, and it only exists on newer silicon. NVIDIA’s description: “The Spectrum switch implements a packet trimming mechanism, with which the switch trims and forwards packets that are about to be discarded due to unavailable buffer space.”[1]

The trimmed header still arrives. That is the whole idea. A dropped packet is invisible to the receiver until a retransmission timer expires — the receiver cannot distinguish “lost” from “late” and must wait. A truncated packet arrives with an obviously incomplete payload, so the receiver knows now that data was lost and can ask for it again immediately. Recovery moves from timeout scale to roughly one round trip.

That matters most for the traffic this course is about. A collective operation over an AI fabric runs at the speed of its slowest participant; one retransmission timeout on one flow stalls the whole step. NVIDIA’s Spectrum-X framing is that congestion should be absorbed by rerouting first, signalled by ECN second, and that dropping is the outcome to avoid — trimming is what makes a drop cheap when it becomes unavoidable.[8]

Trimming arrived in Cumulus Linux 5.14, in the same release as the lossy-multi-tc RoCE mode that pairs with it.[5][2] They are designed together: trimming is the mechanism, lossy-multi-tc is the RoCE configuration that puts the mechanism in the traffic’s path.

Spectrum-4+ · pairs with packet trimming
trust
1. Classify (trust)RoCEv2 · UDP 4791DSCP 26 · trust l32. Switch prioritynv set qos mappingSP 33. Traffic classnv set qos egress-queue-mappingTC 34. Traffic poolnv set qos traffic-poolroce-lossy5. Egress queuenv set qos egress-schedulerqueue 3 · WRR 50%6. Congestion response — buffer fillingPFC XOFFpause upstream · ingressnot usedECN CE marksignal end to end · egressACTIVEPacket trim → 256 Bforward the header · Spectrum-4+ACTIVEBuffer past threshold: the mechanisms marked ACTIVE are what this mode does about it.nv show qos roce · nv show interface swp16 qos roce statusmode lossy-multi-tc · state must be enabled (default: disabled)
stage 6 / 6
DSCP 26
inspect traffic class
60% / 40%
stage 6 · mode lossy-multi-tc · trust l3 · DSCP 26

Congestion response — which of the three actually fires

In lossy-multi-tc mode: PFC does nothing, ECN marks CE at the egress queue, trimming truncates to 256 bytes and forwards the header. RFC 3168: a router sets the CE codepoint only where it would otherwise have dropped the packet.

lossy-multi-tc: Trimming consumes one service port (default: the last available). No security, QoS, ACL, PTP, VRR, PBR or telemetry configuration is allowed on that port.
  • PFC XOFF pause upstream · ingress

    PFC is disabled in this mode — no XOFF is generated.

  • ECN CE mark signal end to end · egress

    The egress queue is past the ECN minimum threshold, so the switch flips the IP ECN field to CE (11) instead of dropping — RFC 3168 §5.

  • Packet trim → 256 B forward the header · Spectrum-4+

    lossy-multi-tc with packet trimming enabled: instead of discarding for want of buffer, the switch truncates to 256 bytes, remarks DSCP 11 and forwards the header so the receiver retransmits at once.

FAE angle Three loops, not one. PFC is layer 2, hop by hop, switch priority 3. ECN/DCQCN is layer 3, end to end, and on Spectrum-X only fires once adaptive routing has run out of paths. Spectrum-X CC proper is RTT probes plus in-band switch telemetry driving per-destination rate contexts on the SuperNIC. Climbing pause counters on a Spectrum-X fabric usually mean adaptive routing was never eligible for that traffic.

lossy-multi-tc — what the one command does

The Spectrum-X answer to pausing: spread RoCE over several traffic classes and, instead of dropping on a full buffer, trim the packet to its header and forward it so the receiver retransmits immediately.

nv set qos roce mode lossy-multi-tc
nv set system forwarding packet-trim state enabled
nv set system forwarding packet-trim remark dscp port-level
nv set interface swp1-16  qos remark profile lossy-multi-tc-host-group
nv set interface swp17-32 qos remark profile lossy-multi-tc-network-group
nv config apply
Commands for this stage
nv set qos congestion-control default-global traffic-class 3 ecn enabled
nv set qos congestion-control default-global traffic-class 3 min-threshold 150000
nv set qos congestion-control default-global traffic-class 3 max-threshold 1500000
nv set qos congestion-control default-global traffic-class 3 probability 100
nv show interface swp16 counters qos pfc-stats
  • Default ECN profile: enabled on egress queue 0, min threshold 150,000 bytes, max 1,500,000 bytes, probability 100%, RED disabled. ECN marking probability has 1% hardware granularity. source
  • ECN threshold on traffic class 3 is 1,501,500 bytes. ⚠ The published numbers disagree across pages (1,501,500 B on the RoCE page; 146.48 KB / 156 KB min and 1.43 MB max in the 5.18 extraction; 150,000 / 1,500,000 B on the QoS page). Teach the shape — min ≈ 150 KB, max ≈ 1.5 MB, probability 100% — and read `nv show qos roce` on the actual switch. source
  • PFC watchdog defaults: polling interval 100 ms, robustness 3 iterations; per-interface state defaults to disable. It operates only on lossless queues on physical swp interfaces. source
  • Link pause and PFC cannot coexist on the same port. source
  • Dynamic (percentage) ECN requires Spectrum-4 or later and reached GA in Cumulus Linux 5.18. ⚠ The NVUE reference lists the mode value as `remote` but its own example uses `relative`; verify on a running 5.18.1 switch. source
  • On Spectrum-X, switches generate ECN marks only when adaptive routing capacity is exhausted — ECN is a second-line signal, not the first tool. source
  • Predefined remark profiles: lossy-multi-tc-host-group = DSCP 21, lossy-multi-tc-network-group = DSCP 11. source
  • lossy-multi-tc was added in Cumulus Linux 5.14, the same release as packet trimming. source

RoCE (CL 5.18) · Quality of Service · Packet Trimming · NVUE QoS set

Mode is lossy-multi-tc with congestion on. Step the response stage, then switch to lossless and back to see the difference between pausing and trimming for the same congested queue.

2Eligibility: the four rules that decide whether it applies at all

Trimming is narrower than it first appears, and every constraint is a design question rather than a tuning question.

ASIC. “Cumulus Linux supports packet trimming on Spectrum-4 and later.”[1] A Spectrum-3 SN4700 will not trim on any release. This is the rule that ends most customer conversations, because it makes trimming a purchasing decision.

Traffic type. “Cumulus Linux supports packet trimming for known unicast IPv4 and IPv6 traffic. Packet trimming does not support ISSU, VXLAN packets or flooding and multicast packets.”[1] Read the VXLAN exclusion twice. A tenant fabric that carries RoCE inside a VXLAN overlay gets no trimming for that traffic, which puts trimming and EVPN-based multi-tenancy in tension on the same leaf.

Traffic class. Trimming is enabled per port per traffic class: nv set interface <ports> packet-trim egress-eligibility traffic-class <0-7>, and the default profile enables traffic classes 1, 2 and 3 on all ports.[1] Traffic class 0 is not in the default set, so bulk traffic is not trimmed unless you say so.

A port. Enabling trimming consumes one service port — the subject of Segment 5.[1]

Before promising trimming to a customer, ask four questions in this order: which ASIC, is the RoCE traffic encapsulated, which traffic classes carry it, and which port can you afford to give up. Three of those four are answered by the design, not by the switch.

3The command surface and the default profile

The profile that ships is packet-trim-default: DSCP remark 11, truncation size 256 bytes, switch priority 4, and eligibility on all ports for traffic classes 1, 2 and 3.[1] The configurable ranges are size 256-1024 bytes in multiples of 4, dscp 0-63, switch-priority 0-7 and egress-eligibility traffic-class 0-7.[1]

nv set system forwarding packet-trim state enabled
nv set system forwarding packet-trim profile packet-trim-default
nv set system forwarding packet-trim dscp <0-63>
nv set system forwarding packet-trim size <256-1024>
nv set system forwarding packet-trim switch-priority <0-7>
nv set interface <port> packet-trim egress-eligibility traffic-class <0-7>
nv config apply

[1] Monitoring and clearing:

nv show system forwarding packet-trim
nv show system forwarding packet-trim counters
nv show interface <port> counters packet-trim
nv action clear system forwarding packet-trim counters
nv action clear interface <port> packet-trim counters
[1]

Two of the default values are worth reasoning about rather than memorising. 256 bytes is enough for Ethernet, IP, UDP and the RoCE transport headers with room to spare, which is what the receiver needs to identify the flow and the sequence position; making it larger buys nothing for recovery and costs bandwidth on an already congested port. Switch priority 4 puts trimmed packets on a class of their own, away from both the untrimmed RoCE traffic on priority 3 and the CNP traffic on priority 6 — so a burst of trimmed headers cannot itself congest the class that produced them.[1][2]

4lossy-multi-tc: putting trimming in the RoCE path

lossy-multi-tc is the RoCE mode built for trimming. The documented Spectrum-X pattern from the 5.18 RoCE page:

nv set qos roce mode lossy-multi-tc
nv set system forwarding packet-trim remark dscp port-level
nv set interface swp1-16  qos remark profile lossy-multi-tc-host-group
nv set interface swp17-32 qos remark profile lossy-multi-tc-network-group
nv config apply

One thing the block does not show is an explicit enable, because it does not need one: NVIDIA states that the lossy multi TC profile “provides QoS settings for lossy RoCE traffic and enables Packet trimming with the default packet trimming profile settings”.[2] nv set system forwarding packet-trim state enabled before the mode is belt-and-braces, not a requirement — which is why the documented five-line set is the one to reproduce in an exam or a runbook.

[2] Read it as four decisions. The mode selects a lossy RoCE configuration with more than one traffic class in play. remark dscp port-level switches trimmed-packet remarking away from the single global DSCP value so that the per-interface profiles are consulted instead. Then two predefined profiles are applied to two port ranges: lossy-multi-tc-host-group sets DSCP 21 and lossy-multi-tc-network-group sets DSCP 11, both operating at switch priority 4 — re-verified on the Packet Trimming page at write time.[1]

The reason the two directions differ is topology. A trimmed packet heading toward a host must be recognisable to the receiving NIC as a trim notification; a trimmed packet heading deeper into the fabric must be recognisable to the next switch. Different consumers, different marking, hence a profile per port role rather than one switch-wide value. The port ranges in the example — swp1-16 host-facing, swp17-32 network-facing — are the example’s, not a rule; substitute the customer’s actual port roles.[2]

Note what lossy-multi-tc gives up: it is a lossy mode, so PFC is not pausing on switch priority 3 and the fabric relies on ECN plus trimming to keep flows recovering fast. That is the trade the mode exists to make. It is also worth checking what your validation tooling supports before committing to it: netq check roce test 0 checks “whether RoCE is configured for lossy or lossless mode” and test 1 checks classification consistency, so a mixed fleet where one leaf runs lossy-multi-tc and the rest run lossless will show up there as an inconsistency — which is what you want.[9]

5What it costs: a port and a counter you do not get

Enabling trimming consumes a physical port. NVIDIA states plainly: “When you enable packet trimming, one service port is used. By default, this is the last service port on the switch” — a designated port, not whichever port happens to be free — and it is movable with nv set system forwarding packet-trim service-port <interface-id>. NVIDIA lists what must not be configured on it: packet trimming port eligibility, port security, adaptive routing, QoS, ACLs, PTP, VRR, PBR, telemetry and histograms.[1] That list was re-read at write time and is longer than older summaries suggest: adaptive routing and port security are on it.

For a design review this is concrete. On an SN5600 the customer loses whichever port the switch designates as its service port — read the service-port field out of nv show system forwarding packet-trim rather than assuming it is the highest-numbered data port — and anything they had planned for it. If that port carried an uplink with adaptive routing enabled, or an ACL, or a PTP boundary clock, that configuration has to move somewhere else before trimming is enabled. Discovering it afterwards is a second maintenance window.

The counter limitation is the other half. “Spectrum-4 switches display only the total number of trimmed packets per port and do not provide counters for the number of trimmed packets that were sent successfully on a port.”[1] So nv show interface <port> counters packet-trim answers “how much congestion reached the trimming threshold on this port”, not “did the recovery mechanism work”. Proving recovery works is a host-side measurement — throughput held up, retransmission behaviour sane — not a switch counter.[4]

Finally the lab boundary. None of this is exercisable in simulation: a virtual Cumulus switch implements no QoS shaping, buffer management or packet marking, so a DSX Air node will accept the configuration and show it back to you without ever trimming anything.[7] That makes this lesson read-and-reason by design, and it is worth being explicit with a customer about which of your claims come from documentation and which from measurement. NCP-AIN objective 2.2 covers enabling and verifying QoS on Spectrum switches; trimming is inside that scope and the counter limitation is exactly the kind of detail that separates configuration from verification.[10]

lossy-multi-tc on a real leaf: worked → faded → problem

Scenario: SN5600 leaf, swp1-16 face GPU hosts, swp17-32 face spines, swp33-swp64 unused. The customer wants lossy-multi-tc with trimming.

Step 1 — check eligibility before typing anything. SN5600 is Spectrum-4, so trimming is supported. Confirm the RoCE traffic is native IPv4 or IPv6 and not VXLAN-encapsulated; if it is encapsulated, stop here and say so. Confirm which traffic classes carry the RoCE traffic — with the default RoCE mappings that is traffic class 3, which is inside the default eligibility set of 1 to 3.[1]

Step 2 — identify and clear the service port. Trimming will take the switch’s last service port, not merely the last unused one. Read the service-port field from nv show system forwarding packet-trim and check what is configured on that port; nv set system forwarding packet-trim service-port <interface-id> moves it if the default choice collides with something. Do not assume the unused swp33-swp64 range covers you. If the selected port had an ACL, PTP, adaptive routing or telemetry configured, that configuration must move first.[1]

Step 3 — configure trimming and the mode (the first nv set line is redundant — lossy-multi-tc enables trimming with the default profile on its own — but it makes the intent explicit in a change record):

nv set system forwarding packet-trim state enabled
nv set qos roce mode lossy-multi-tc
nv set system forwarding packet-trim remark dscp port-level
nv set interface swp1-16  qos remark profile lossy-multi-tc-host-group
nv set interface swp17-32 qos remark profile lossy-multi-tc-network-group
nv config diff
nv config apply --confirm 5m

Step 4 — verify: nv show system forwarding packet-trim for state and profile values (expect DSCP 11, size 256, switch priority 4, traffic classes 1-3); nv show qos roce for the mode; nv show interface swp1 qos roce status for the per-interface view.[1][4]

Step 5 — establish a baseline: nv action clear system forwarding packet-trim counters, then read nv show system forwarding packet-trim counters under load. Expect trimmed counts to rise on congested ports. Interpret that as “congestion reached the trim threshold here”, not as “recovery worked” — Spectrum-4 reports no successful-retransmission counter.[1]

Rollback: let the confirm timer expire, or nv set qos roce mode lossless plus nv set system forwarding packet-trim state disabled and apply. Note that a RoCE mode change rewrites the buffer pool allocation; NVIDIA publishes no hitlessness claim for it, so treat it as disruptive in either direction.

Case update — a different slide

How it ended

Tuesday turns into a hardware conversation. The native RoCE traffic on the Spectrum-4 leaves is eligible; the VXLAN-encapsulated tenant traffic on the same boxes never will be.[1] The service port collides with an adaptive-routing uplink, so something moves before anything is enabled. And whatever they turn on, the switch reports only the total number of trimmed packets per port, never whether recovery succeeded — proving that is a host-side measurement.[1]

What you say to the architect: “Where trimming does not apply, tuned PFC and ECN work on every Spectrum generation — and that is what acceptance runs on.” The SE deletes the Tuesday row. Two days out, a ticket arrives, escalated twice, three words long: RoCE is slow.

Lab

Goal: there is no host-side equivalent of trimming, so verify eligibility from the NIC end instead. Read-only on the Dell-lab hosts.

  1. Confirm the RDMA device and netdev: ibdev2netdev and ibstat. Expected: device Up with a link layer of Ethernet. If the link layer says InfiniBand, this fabric is out of scope for the whole module.
  2. Confirm the traffic is RoCEv2 over IP rather than RoCEv1 over Ethernet: check the GID table with show_gids (from the perftest/MFT tooling) or read /sys/class/infiniband/<dev>/ports/1/gid_attrs/types/<idx>. Expected: an entry of type RoCE v2. RoCEv1 has no IP header, so none of the DSCP or trimming machinery applies to it.
  3. Capture a live flow and prove it is native, not encapsulated. Receiver: sudo tcpdump -n -i <ifname> -c 50 udp port 4791. Sender: ib_write_bw -d <dev> -F <receiver-ip> --duration 10. Expected: packets with destination port 4791 and no outer UDP port 4789. If you see 4789, the RoCE traffic is inside VXLAN and is excluded from trimming.
  4. Confirm the traffic is known unicast: check that the destination MAC in the capture is the receiver’s NIC MAC and not a broadcast or multicast address (ip -br link show <ifname> for the local MAC). Expected: unicast. Flooded and multicast traffic is excluded.
  5. Record the DSCP the flow carries, as in lesson 3.1, and note which traffic class it maps to under the switch defaults. Expected: DSCP 26 to switch priority 3 to traffic class 3, which is inside the default trimming eligibility set of traffic classes 1 to 3.
  6. Write the eligibility verdict for this specific lab fabric in one line, naming the rule for each of the four checks. This is the artefact you would attach to a customer design review.

Optional (customer lab with a Spectrum-4 leaf, mutating, maintenance window only): enable trimming on a single test port with nv set system forwarding packet-trim state enabled and nv set interface <port> packet-trim egress-eligibility traffic-class 3, apply with nv config apply --confirm 5m, generate congestion with a many-to-one ib_write_bw, then read nv show interface <port> counters packet-trim. Clear with nv action clear system forwarding packet-trim counters. Rollback: let the confirm timer expire, or nv set system forwarding packet-trim state disabled and apply. Remember that enabling trimming consumes a service port on that switch — confirm which one and what is configured on it before the window opens.

Retrieval check

9 questions from memory. Answer before looking anything up; misses become flashcards.

Explain it to a Dell SE

Explain to a Dell storage architect, in five sentences, what packet trimming does and why NVIDIA offers it as an alternative to making the fabric lossless with PFC.

13 flashcards for this lesson — 0 in deck. Spaced review lives at /review.

Sources

Facts in this lesson were checked against Cumulus Linux 5.18 Packet Trimming and RoCE pages, NVUE 5.x QoS reference; re-fetched 2026-09-07. Dates are when each page was fetched.

  1. Packet Trimming | Cumulus Linux 5.18 · fetched 2026-09-07
  2. RDMA over Converged Ethernet - RoCE | Cumulus Linux 5.18 · fetched 2026-09-07
  3. NVUE Reference - QoS set/unset commands · fetched 2026-09-07
  4. NVUE Reference - QoS show commands · fetched 2026-09-07
  5. What's New | Cumulus Linux 5.14 · fetched 2026-09-07
  6. What's New | Cumulus Linux 5.18 · fetched 2026-09-07
  7. Cumulus Linux in a Virtual Environment | Cumulus Linux 5.18 · fetched 2026-09-07
  8. Giga-Scale AI and the Ethernet Evolution (NVIDIA Technical Blog) · fetched 2026-09-07
  9. Validation Tests Reference | Cumulus NetQ 5.1 · fetched 2026-09-07
  10. NVIDIA-Certified Professional: AI Networking (NCP-AIN) · fetched 2026-09-07

The same idea elsewhere

Other lessons that cover this ground, sometimes from another course's angle.