add NIC_TRAFFIC_CLASS and NIC_SERVICE_LEVEL env vars for DSCP marking#315
Merged
Conversation
Adds support for marking RoCE/IB traffic with specific DSCP/QoS values. - NIC_TRAFFIC_CLASS (default=0): sets the DSCP/traffic class byte in the RoCE GRH (grh.traffic_class) when transitioning QPs to RTR state. - NIC_SERVICE_LEVEL (default=0): sets the IB service level (ah_attr.sl) on QPs. This applies to IB and RoCE connections. - NicOptions: I added uint8_t serviceLevel and uint8_t trafficClass fields - TransitionQpToRtr(): accepts trafficClass and serviceLevel as parameters; sets grh.traffic_class (RoCE only) and ah_attr.sl (all QP types)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds NIC QoS controls to TransferBench’s NIC executor by exposing DSCP/traffic class and IB service level configuration via environment variables and wiring them into QP transition to RTR.
Changes:
- Added
cfg.nic.serviceLevelandcfg.nic.trafficClassfields and included them in cross-rank NIC config consistency checks. - Added env var parsing + reporting for
NIC_SERVICE_LEVELandNIC_TRAFFIC_CLASS, and mapped them intoConfigOptions. - Extended
TransitionQpToRtr()to applygrh.traffic_class(RoCE) andah_attr.sl(all QPs).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/header/TransferBench.hpp | Adds NIC options fields and applies them during QP RTR transition. |
| src/client/EnvVars.hpp | Adds env vars to configure/report NIC service level and traffic class, and maps them into config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nileshnegi
approved these changes
May 26, 2026
gilbertlee-amd
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On the latest cluster, we need to specify the DSCP value for the network's QoS set on the NIC and switch.
Technical Details
Adds support for marking RoCE/IB traffic with specific DSCP/QoS values.
NIC_TRAFFIC_CLASS(default=0): sets the DSCP/traffic class byte in the RoCE GRH (grh.traffic_class) when transitioning QPs to RTR state. This option is like the equivalent toNCCL_IB_TCin NCCL/RCCL.NIC_SERVICE_LEVEL(default=0): sets the IB service level (ah_attr.sl) on QPs. This applies to IB and RoCE connections. This option is like the equivalent toNCCL_IB_SLin NCCL/RCCL.TransitionQpToRtr(): acceptstrafficClassandserviceLevelas parameters; setsgrh.traffic_class(RoCE only) and ah_attr.sl (all QP types)Test Plan
I tried to run using the
nicp2pas a testNIC_TRAFFIC_CLASS=128 ./TransferBench nicp2pTest Result
It appears to run using that traffic class as expected
Submission Checklist