From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.54 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== 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== 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 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 ; Fri, 4 Dec 2026 00:05:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D54BB606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4a214c5c4c0so2997755e9.3 for ; Thu, 03 Dec 2026 16:05:24 -0800 (PST) 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) 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) From: Mohsin Bashir 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 Message-ID: <20261204000521.3396802-1-mohsin.bashr@gmail.com> X-Mailer: git-send-email 2.53.1 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Mohsin Bashir 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