The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mohsin Bashir <mohsin.bashr@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 00/11] selftests: drv-net: Test tc-flower police offload
Date: Thu,  3 Dec 2026 16:05:10 -0800	[thread overview]
Message-ID: <20261204000521.3396802-1-mohsin.bashr@gmail.com> (raw)

From: Mohsin Bashir <hmohsin@meta.com>

At Meta, we intend to use tc-flower ingress rate limiting to limit the
ingress rate of containers. Each container has its own IPv6 address,
and a tc-flower rule on that destination address with a police action
limits the traffic the NIC delivers to it. This series adds
tc_flower_police.py, a drv-net test that covers this use case on any
device that offloads it. The existing police tests either need a switch
topology, only cover the software action, or are tied to a single
driver.

Patch 1 extends Iperf3Runner to send UDP at a given rate and read the
results on the receiver. Patches 2-8 cover the offload itself. and the
last 3 patches check that policing keeps working across channel and ring
changes and a link flap, and next to ntuple steering and RSS contexts.

The series was tested on mlx5 (ConnectX-7) in switchdev mode, with the
fix that allows police as the last action of a TC rule [1]. mlx5 does
not offload peakrate and overhead and has no ntuple filters in
switchdev mode, so those tests skip. police_no_leak skips because the
device accepts all 1025 rules.

[1] https://lore.kernel.org/all/20261201212455.2836814-1-mohsin.bashr@gmail.com/

# TAP version 13
# 1..22
# ok 1 tc_flower_police.offload_flags
# ok 2 tc_flower_police.police_no_leak # SKIP Device accepted all 1025 rules, cannot fill it
# # Unpoliced UDP rate 200 Mbit/s
# ok 3 tc_flower_police.link_baseline
# ok 4 tc_flower_police.police_rate
# ok 5 tc_flower_police.police_isolation
# ok 6 tc_flower_police.police_dst_prefix
# ok 7 tc_flower_police.police_params.exceed_pipe
# ok 8 tc_flower_police.police_params.peakrate # SKIP Not offloaded: Error: mlx5_core: Offload not supported when peakrate/avrate/overhead is configured.
# ok 9 tc_flower_police.police_params.overhead # SKIP Not offloaded: Error: mlx5_core: Offload not supported when peakrate/avrate/overhead is configured.
# ok 10 tc_flower_police.police_params.pkts_rate
# ok 11 tc_flower_police.police_independent
# ok 12 tc_flower_police.police_shared_action
# ok 13 tc_flower_police.police_priority.slow_first
# ok 14 tc_flower_police.police_priority.fast_first
# ok 15 tc_flower_police.police_delete
# ok 16 tc_flower_police.police_channels
# ok 17 tc_flower_police.police_ring_size
# ok 18 tc_flower_police.police_with_ntuple.ntuple_first # SKIP Device does not support ntuple-filters
# ok 19 tc_flower_police.police_with_ntuple.police_first # SKIP Device does not support ntuple-filters
# ok 20 tc_flower_police.police_rss_ctx # SKIP Device does not support ntuple-filters
# ok 21 tc_flower_police.police_link_flap
# ok 22 tc_flower_police.police_add_while_down
# # Totals: pass:16 fail:0 xfail:0 xpass:0 skip:6 error:0
ok 1 selftests: drivers/net/hw: tc_flower_police.py

Mohsin Bashir (11):
  selftests: drv-net: Iperf3Runner: Support UDP and server side results
  selftests: drv-net: Add tc-flower police offload test
  selftests: drv-net: tc_flower_police: Test that rules do not leak
  selftests: drv-net: tc_flower_police: Test the policed rate and its
    scope
  selftests: drv-net: tc_flower_police: Test destination prefix rules
  selftests: drv-net: tc_flower_police: Test police parameters
  selftests: drv-net: tc_flower_police: Test multiple policers
  selftests: drv-net: tc_flower_police: Test rule removal
  selftests: drv-net: tc_flower_police: Test policing across
    reconfiguration
  selftests: drv-net: tc_flower_police: Test policing with ntuple
    steering
  selftests: drv-net: tc_flower_police: Test policing with RSS contexts

 .../testing/selftests/drivers/net/hw/Makefile |   1 +
 tools/testing/selftests/drivers/net/hw/config |   2 +
 .../drivers/net/hw/lib/py/__init__.py         |   4 +-
 .../drivers/net/hw/tc_flower_police.py        | 833 ++++++++++++++++++
 .../selftests/drivers/net/lib/py/load.py      |  49 +-
 5 files changed, 874 insertions(+), 15 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/hw/tc_flower_police.py

-- 
2.53.1-Meta


             reply	other threads:[~2026-12-04  0:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  0:05 Mohsin Bashir [this message]
2026-12-04  0:05 ` [PATCH net-next 01/11] selftests: drv-net: Iperf3Runner: Support UDP and server side results Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 02/11] selftests: drv-net: Add tc-flower police offload test Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 03/11] selftests: drv-net: tc_flower_police: Test that rules do not leak Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 04/11] selftests: drv-net: tc_flower_police: Test the policed rate and its scope Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 05/11] selftests: drv-net: tc_flower_police: Test destination prefix rules Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 06/11] selftests: drv-net: tc_flower_police: Test police parameters Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 07/11] selftests: drv-net: tc_flower_police: Test multiple policers Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 08/11] selftests: drv-net: tc_flower_police: Test rule removal Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 09/11] selftests: drv-net: tc_flower_police: Test policing across reconfiguration Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 10/11] selftests: drv-net: tc_flower_police: Test policing with ntuple steering Mohsin Bashir
2026-12-04  0:05 ` [PATCH net-next 11/11] selftests: drv-net: tc_flower_police: Test policing with RSS contexts Mohsin Bashir

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=20261204000521.3396802-1-mohsin.bashr@gmail.com \
    --to=mohsin.bashr@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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