From: Carolina Jubran <cjubran@nvidia.com>
To: Shuah Khan <shuah@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Gal Pressman <gal@nvidia.com>, Tariq Toukan <tariqt@nvidia.com>,
"Cosmin Ratiu" <cratiu@nvidia.com>,
Nimrod Oren <noren@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<netdev@vger.kernel.org>
Subject: [PATCH 3/3] selftests: drv-net: Relax total BW check in devlink_rate_tc_bw.py
Date: Sun, 31 Aug 2025 11:06:41 +0300 [thread overview]
Message-ID: <20250831080641.1828455-4-cjubran@nvidia.com> (raw)
In-Reply-To: <20250831080641.1828455-1-cjubran@nvidia.com>
This test is meant to check TC bandwidth distribution, not the tx_max
of the VF. The total bandwidth check is only there to make sure that FW
tokens limit traffic, because the per-TC share is only meaningful when
the link is fully saturated.
Because the measured total is the sum of two iperf3 streams that do not
always start or stop at the same time, using a strict 1 Gbps target
caused random failures. This change adds a tolerance parameter to
BandwidthValidator, keeps per-TC checks tight at +-12%, and relaxes the
total bandwidth check to +-25% around 1 Gbps.
This avoids false failures while still confirming that the TC share
validation is meaningful.
Fixes: 23ca32e4ead4 ("selftests: drv-net: Add test for devlink-rate traffic class bandwidth distribution")
Tested-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
---
.../selftests/drivers/net/hw/devlink_rate_tc_bw.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/devlink_rate_tc_bw.py b/tools/testing/selftests/drivers/net/hw/devlink_rate_tc_bw.py
index abc20bc4a34a..1713ca11f845 100755
--- a/tools/testing/selftests/drivers/net/hw/devlink_rate_tc_bw.py
+++ b/tools/testing/selftests/drivers/net/hw/devlink_rate_tc_bw.py
@@ -72,8 +72,8 @@ class BandwidthValidator:
relative to the overall total.
"""
- def __init__(self, shares):
- self.tolerance_percent = 12
+ def __init__(self, shares, tolerance):
+ self.tolerance_percent = tolerance
self.expected_total = sum(shares.values())
self.bounds = {}
@@ -438,8 +438,8 @@ def main() -> None:
raise KsftSkipEx("Could not get PCI address of the interface")
cfg.require_cmd("iperf3", local=True, remote=True)
- cfg.traffic_bw_validator = BandwidthValidator({"total": 1})
- cfg.tc_bw_validator = BandwidthValidator({"tc3": 20, "tc4": 80})
+ cfg.traffic_bw_validator = BandwidthValidator({"total": 1}, 25)
+ cfg.tc_bw_validator = BandwidthValidator({"tc3": 20, "tc4": 80}, 12)
cases = [test_no_tc_mapping_bandwidth, test_tc_mapping_bandwidth]
--
2.38.1
next prev parent reply other threads:[~2025-08-31 8:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-31 8:06 [PATCH 0/3] selftests: drv-net: Fix issues " Carolina Jubran
2025-08-31 8:06 ` [PATCH 1/3] selftests: drv-net: Fix and clarify TC bandwidth split " Carolina Jubran
2025-09-01 15:45 ` Simon Horman
2025-08-31 8:06 ` [PATCH 2/3] selftests: drv-net: Fix tolerance calculation " Carolina Jubran
2025-09-01 15:45 ` Simon Horman
2025-08-31 8:06 ` Carolina Jubran [this message]
2025-09-01 15:46 ` [PATCH 3/3] selftests: drv-net: Relax total BW check " Simon Horman
2025-09-02 23:21 ` Jakub Kicinski
2025-09-05 22:32 ` Jakub Kicinski
2025-09-08 19:16 ` Carolina Jubran
2025-09-08 20:19 ` Jakub Kicinski
2025-09-09 10:06 ` Carolina Jubran
2025-09-09 21:04 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250831080641.1828455-4-cjubran@nvidia.com \
--to=cjubran@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=noren@nvidia.com \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®