[PATCH net-next 08/11] selftests: drv-net: tc_flower_police: Test rule removal
From: Mohsin Bashir
Date: Thu Dec 03 2026 - 19:05:52 EST
From: Mohsin Bashir <hmohsin@xxxxxxxx>
Removing a policing rule must also remove the rate limit in hardware.
Add police_delete to verify that a flow is no longer limited once its
rule is deleted.
Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
Signed-off-by: Mohsin Bashir <hmohsin@xxxxxxxx>
---
.../drivers/net/hw/tc_flower_police.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/hw/tc_flower_police.py b/tools/testing/selftests/drivers/net/hw/tc_flower_police.py
index bca1e324e69a..73162c31bd59 100755
--- a/tools/testing/selftests/drivers/net/hw/tc_flower_police.py
+++ b/tools/testing/selftests/drivers/net/hw/tc_flower_police.py
@@ -480,6 +480,21 @@ def police_priority(cfg, slow_pref, fast_pref, expect):
_check_rate(got, expect, "rule with the lower pref")
+def police_delete(cfg):
+ """
+ Check that deleting a rule removes the limit in hardware.
+ """
+ _setup_clsact(cfg)
+ rule, dst = _dst_ip_rule(cfg)
+
+ _check_baseline_rate(cfg)
+ _add_filter(cfg, rule, _police(RATE_MBIT), pref=10, dst=dst)
+
+ tc(f"filter del dev {cfg.ifname} ingress pref 10")
+ got = _iperf3(cfg, dst, OFFERED_MBIT)
+ _check_unpoliced(got, RATE_MBIT, "after delete")
+
+
def main() -> None:
"""Ksft boilerplate main."""
with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
@@ -493,7 +508,8 @@ def main() -> None:
police_params,
police_independent,
police_shared_action,
- police_priority],
+ police_priority,
+ police_delete],
args=(cfg,))
ksft_exit()
--
2.53.1-Meta