selftests: drv-net: Fix and clarify TC bandwidth split in devlink_rate_tc_bw.py

Correct the documented bandwidth distribution between TC3 and TC4
from 80/20 to 20/80. Update test descriptions and printed messages
to consistently reflect the intended split.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Link: https://patch.msgid.link/20251130091938.4109055-6-cjubran@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Carolina Jubran
2025-11-30 11:19:37 +02:00
committed by Jakub Kicinski
parent 3796e549e3
commit 9ecd05a2c8

View File

@@ -21,21 +21,21 @@ Test Cases:
----------
1. test_no_tc_mapping_bandwidth:
- Verifies that without TC mapping, bandwidth is NOT distributed according to
the configured 80/20 split between TC4 and TC3
- This test should fail if bandwidth matches the 80/20 split without TC
the configured 20/80 split between TC3 and TC4
- This test should fail if bandwidth matches the 20/80 split without TC
mapping
- Expected: Bandwidth should NOT be distributed as 80/20
- Expected: Bandwidth should NOT be distributed as 20/80
2. test_tc_mapping_bandwidth:
- Configures TC mapping using mqprio qdisc
- Verifies that with TC mapping, bandwidth IS distributed according to the
configured 80/20 split between TC3 and TC4
- Expected: Bandwidth should be distributed as 80/20
configured 20/80 split between TC3 and TC4
- Expected: Bandwidth should be distributed as 20/80
Bandwidth Distribution:
----------------------
- TC3 (VLAN 101): Configured for 80% of total bandwidth
- TC4 (VLAN 102): Configured for 20% of total bandwidth
- TC3 (VLAN 101): Configured for 20% of total bandwidth
- TC4 (VLAN 102): Configured for 80% of total bandwidth
- Total bandwidth: 1Gbps
- Tolerance: +-12%
@@ -402,10 +402,10 @@ def run_bandwidth_distribution_test(cfg, set_tc_mapping):
def test_no_tc_mapping_bandwidth(cfg):
"""
Verifies that bandwidth is not split 80/20 without traffic class mapping.
Verifies that bandwidth is not split 20/80 without traffic class mapping.
"""
pass_bw_msg = "Bandwidth is NOT distributed as 80/20 without TC mapping"
fail_bw_msg = "Bandwidth matched 80/20 split without TC mapping"
pass_bw_msg = "Bandwidth is NOT distributed as 20/80 without TC mapping"
fail_bw_msg = "Bandwidth matched 20/80 split without TC mapping"
is_mlx5 = "driver: mlx5" in ethtool(f"-i {cfg.ifname}").stdout
if run_bandwidth_distribution_test(cfg, set_tc_mapping=False):
@@ -419,13 +419,13 @@ def test_no_tc_mapping_bandwidth(cfg):
def test_tc_mapping_bandwidth(cfg):
"""
Verifies that bandwidth is correctly split 80/20 between TC3 and TC4
Verifies that bandwidth is correctly split 20/80 between TC3 and TC4
when traffic class mapping is set.
"""
if run_bandwidth_distribution_test(cfg, set_tc_mapping=True):
ksft_pr("Bandwidth is distributed as 80/20 with TC mapping")
ksft_pr("Bandwidth is distributed as 20/80 with TC mapping")
else:
raise KsftFailEx("Bandwidth did not match 80/20 split with TC mapping")
raise KsftFailEx("Bandwidth did not match 20/80 split with TC mapping")
def main() -> None: