🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26614

[PATCH net-next 00/11] selftests: drv-net: Test tc-flower police offload

#26614
From: Mohsin Bashir
Date: Fri, 04 Dec 2026 00:05
79 lines
14468 bytes
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
Technical Details
Message-ID: <20261204000521.3396802-1-mohsin.bashr@gmail.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376917-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376917-linux-kernel-netdev=dewy.ru
From: mohsin.bashr@gmail.com (Mohsin Bashir)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 00/11] selftests: drv-net: Test tc-flower police offload
Date: Thu,  3 Dec 2026 16:05:10 -0800
Organization: Usenet Network
Message-ID: <20261204000521.3396802-1-mohsin.bashr@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2635046"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hXCWqBt260JOzJOGzUt95lSC+Lw= sha256:HH47RIBppohPyownVwy5++8eRyQfNn1Orc4NzpsrPEo=
	sha1:y6X71YltuXoEthgH9Py0oJUV4i8= sha256:e+ta3y/HoW2Z1pSuWKkUVKYrrY1jKKw/OX43McDFWkc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id DA734117A77; Fri,  4 Dec 2026 03:05:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.296
X-Spam-Status: No, score=-3.296 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id kmMr-C_u4D6g;
	Fri,  4 Dec 2026 03:05:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376917-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 09750117A26; Fri,  4 Dec 2026 03:05:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 10AA32E462; Fri,  4 Dec 2026 00:05:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796342726;
	b=Q8jDHXSq+PwJ9Q4LnlNRPPC8F9y4vItTWCM8uB9PQjZWCcaLIRAcl7nw7D5RdAoij1tN
	 Htr/VqzosFjh8WEhwmCwho2vNXLGxU/tufjnMbRRvQWDk3FEYkamF68w39wG82kNpYto0
	 IeiBuYuPlNqLSgRT/y3jTGhOOr4nQQB8RMCqAFtR1siOIohl/TNYo/nxH1v0bB2s8c2wJ
	 ppLde0IlbLp0QsdsyTWjTGaYzbukJdOelqZtkkwP6XOZEx+okIxAB2HC1vtmRAl4XHfKV
	 w4T1rNzWqXUbwpoFIG7zYf5QTAlKUDBR5LoYJYRo9udENmeT3JiGVON1R9ktxUi0xOw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796342726;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=0oyI4rT8TNlfPA4bK3+oB7TRaCml70yxWzywhLtXMaY=;
	b=LAjgig6KmbrSwRX8N7zWnUvUCRPLbFdQkjWfSvLpduxAiz72nH62x4mXSwhj1R14iUpo
	 +HwyMHPIjuygRgyog5ZzcgQqB3N8v01ZKz7UGGTsAstGfyycN71Ulp2vI61kUwkKVoDjI
	 spFvRHBdxOAoHzLEbsVHJ8f0CMedBJlms6yGWZgdLtSEbN+X5tzdoZzH73DmPPLW1K/Qc
	 RLTOZorwtIyDU9ZHZd9YGG5P/jEUxyrUWcuxZglNpx+DdHipfxVvDzMKhDRgwmKv2arMX
	 sVQVlfsyRKT77/r5UFPAKZWIuXRFReSOLKViJSD/GQwGyQ5+gzfCoEax8fLmPQL51Gw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="g/d4XX8n";
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0F2606A33B;
	Fri,  4 Dec 2026 00:05:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=g/d4XX8n
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.54
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796342725;
	b=Og9k0N1TdXPZRdMeXR3XQo+FSMzFSlnRVEHm1fYftWYEl7rCTb/WQ5n8XG68bDdohSyi
	 cwtndlSLJhLjrbkJLPKfVvGyEeR6j9RYFsk6sjA1bLGGizaH/rqmyCjUrWIcgrHnJTQeq
	 JsyARnKrbvvTX2mlRtQZLOOfsAWvMmS7ONrKW4LapaT5rnTZMG5hvX+xUIZI1sga/THgt
	 EOqigmMstWY9+ahGt2LfazwiuFaznJ1fxGQH/N48/eVRsaiM9kVjnVx9oOER/yUD8WPrB
	 A3GwnacghNR37HK5W5SY5XszKRnExZrIxpJ9ngDMRYbnfRjxro3b509oOVoTwwgrbbw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796342725;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=0oyI4rT8TNlfPA4bK3+oB7TRaCml70yxWzywhLtXMaY=;
	b=CG7oU+BcDzfvZj/JFgyHNhme6ZxmzSnFw9KCD4riRAG3cm4R+8VWS1sr9gQzBfvAN9IH
	 z0dB7TqvGndDsKvVp5LfD7Es/yQMyn2e84aN32Jybwwq1VTEo0x9W0Yl4eG7pVyGKFbw8
	 8ixlvdjIHOJbd80VdNtOgNgtQgRFy99g7CbuFZo6Xu7LQYIiG7iDUWkY6ZdtPA7ZktJFc
	 ewb0nwtOKQsdupU30695TDSb4Gqdyv2Rl7onQ9toCLHn7SaECiZJwgHtW4X2GH19vtr5I
	 7Z1RjQI+Ycy5gMvc0pBSXoU9CHTsy/OD4aY3c1vgl1NL6nN/I3WPAlt4kESEZU3axGA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="g/d4XX8n";
	arc=none smtp.remote-ip=209.85.128.54
X-Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D54BB606A32C
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 00:05:24 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D54BB606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4a214c5c4c0so2997755e9.3
        for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 16:05:24 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796342723; x=1796947523; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=0oyI4rT8TNlfPA4bK3+oB7TRaCml70yxWzywhLtXMaY=;
        b=g/d4XX8nQ69599RzVsnp+mcLtWdU87T5s4mOaCBIxE7dOsa0dVTZrlK7Zqg0VscBMI
         DUuf657+ri3e1mLYCM2TjS/4zsNZmER8OPqkLgRifFEk+63CkcJ/CrsgmoD3gGFsUlI5
         NdaFixlqYIGpbBxYzVxqsXKou8+NWPoKbirXK7e6v/2pKQ1HExfB124RXWxPmd4md7DU
         cZ9Fq6H32eMelD4O4gPAjsSayfh1bpLOQ7+brqKlOKnEJtOR1FXZSABn8g/oZl8D+Zfu
         1pwuCok72VqKqWzT2UjzC8ewWVz2EYguKfZlgIKqcJfgfM2j3GT0IFkJiKUycZbB3gsp
         wjVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796342723; x=1796947523;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=0oyI4rT8TNlfPA4bK3+oB7TRaCml70yxWzywhLtXMaY=;
        b=RZPw8aMHKKXOkopn0W3SRseoi6fHkip3o2HmTKwVMFQmXNUpfu9zxeCaiMAzyM0LEc
         icyWyj1umhdNDwOhsnGmdDtKxKLINIKeNA+osWe+scM13X+QS0mZlDIan4/iPhHmhFfY
         qlAj9TgRGt209YwX6pRpmpNupUmf0+HlXHiu9bgL0WZwrxEgA8/gRBt3INS7vGdVLk9I
         8JY/RtnqRdzzXs4k0lECjn5cMhGtqoSNtYD/TIjXhmyWvdbKAqZ6FzFhDIUN7rpS/PhZ
         yOg+VbIpM1rLSp0pGEIJYZbQkpKwBgOr+XKEMwVk3oNGq6SjkjDaueMX//AUYvVnkOxN
         aawA==
X-Gm-Message-State: APuU4Z/LbYfWKqST0bC5oRdUuQJPtMjGsaSApD7QX+cXTvk3jXUDGppU
	ZTjvdTgIGB73old0mo1GoWBe5t8TmF0EefoTu3XgbHxq2rr8Mdmd9CeFVFuboA==
X-Gm-Gg: AZFdTZdC1zMtHdtiOwJVBXaOs0j1mO38IevC30ntrnyu0Tl9HzH1qfO8E03d5wfkbCk
	+MQVD1UMh8o+SoX9lLeZdPet1hP19Jss8nlt44XpedEZKCH0kIcn2mEOM9RGsRdjy+UwyNANQor
	FGWqS6gdD0yJeTCHqR5jRPyr27csPZCfBUvw9c2cIk42pe/4VfUMpva1tZW0Z2c7bprNTFg5ssr
	lsWR8GNnO7QHeCaWxJn52BH+mgLRLFxMIdLbdziR8RLnV4qEc+mQ3TI+J295lQQ0ThwtTeCPhEj
	iHAM/VBPZSsoosl9el6sWaJec3q2pvZH7WBRhbLpmy+VYO9zUOs3dpTqdJNtPQv2dLHnNLObWpr
	mXzsFmERw5KQLZLxt1br8gMcBqe2TPOsnZ3gWsEXl+QNUid4InJRyW59aRCk4qDKER51aSYT/N5
	jgTWi9KIWm6AwTir4vYmk5Zsiun0E0enpTQXtzrqaE6Byw9rKNHsAXcWwHlBT5I7snec0W8QUxz
	8h6G8ssGZ80LCYM6B5Rl1Tt5y9ObIMOaz9HTWCPvN5zXVdlMlcoxroWi4j1F5m1vToPTNX6VnUc
	CvKl2tLHUPOZc0WJX5kcq5KAEII=
X-Received: by 2002:a05:600c:a085:b0:4bb:c0b7:6cbf with SMTP id 5b1f17b1804b1-4bbeb6eeddbmr5092575e9.2.1796342723143;
        Thu, 03 Dec 2026 16:05:23 -0800 (PST)
X-Received: from localhost ([2a03:2880:31ff:51::])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe008d0c8sm120376505e9.6.2026.12.03.16.05.22
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 03 Dec 2026 16:05:22 -0800 (PST)
X-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
X-Mailer: git-send-email 2.53.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list