🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9914

[PATCH net-next v3 0/4] selftests: net: add performance metric reporting

#9914
From: Stanislav Fomichev
Date: Mon, 02 Nov 2026 19:08
85 lines
14434 bytes
Let Python selftests report numeric measurements, so that CI can track
the performance of drivers over time, and add two performance tests.

ksft_metric() reports a measurement of the current test case, which is
printed as JSON right before the test result:

  # ktap-metric-json: {"goal":"higher","name":"throughput","value":389.127}

The goal tells a performance metric, which is better higher or lower,
from an error metric, which must be zero. Everything else, such as
units, history and regression thresholds, is up to the consumer.

The tests are in a new drivers/net/perf target, apart from the
functional tests: they need real hardware, take a while, and make no
sense on debug kernels. iperf.py measures single-stream TCP throughput
with iperf3, devmem.py the throughput of udmabuf-backed devmem TCP with
kperf [1].

System monitoring stays in NIPA, which runs each case of the perf tests
in a process of its own and attaches CPU and NIC metrics to its results.
The NIPA changes are at [2]; git clone & ./nipa local view starts an
http server on :44109 with two sample runs.

[1] https://github.com/facebookexperimental/kperf
[2] https://github.com/fomichev/nipa/tree/nipa-local-hw-metrics

v3:
- drop the timestamp of metrics (Jakub)
- drop the note on nested output from the docs (Jakub)
- report plain numbers, drop kind/type (Jakub)
- replace ksft_metric_policy() with a goal per metric: higher, lower
  or zero (Jakub)
- move the tests to drivers/net/perf, with a lib/py of their own (Jakub)
- fix the format of the Makefile lists (Jakub)
- report metrics from the tests rather than the runners (Jakub)
- drop the kperf section of the README (Jakub)
- stop reporting TCP retransmits
- drop the metric labels, report the throughput of the receiver only

v2:
- move system monitoring to NIPA (Jakub)
- move performance tests to drivers/net/hw/performance (Jakub)
- rename metric shape to type and document supported types (Paolo);
  kind= instead of type= (type shadows a builtin)
- remove direction from the metric example (Paolo)
- document policy processing order (Paolo)
- support producer-selected summary operations, including arbitrary pXX
- label throughput metrics in Gbps
- do not mark the iperf benchmark disruptive
- use 2 GiB udmabuf buffers for kperf devmem
- drop the ncdevmem devmem probe
- use a random kperf control port
- report kperf server cleanup failures

Stanislav Fomichev (4):
  selftests: net: py: add metric output
  selftests: drv-net: add an iperf performance test
  selftests: drv-net: add a kperf runner
  selftests: drv-net: measure devmem performance with kperf

 tools/testing/selftests/Makefile              |   2 +-
 .../testing/selftests/drivers/net/README.rst  |  17 ++
 .../selftests/drivers/net/lib/py/__init__.py  |   4 +-
 .../selftests/drivers/net/lib/py/kperf.py     | 181 ++++++++++++++++++
 .../selftests/drivers/net/lib/py/load.py      |  20 +-
 .../selftests/drivers/net/perf/Makefile       |  12 ++
 .../testing/selftests/drivers/net/perf/config |   4 +
 .../selftests/drivers/net/perf/devmem.py      |  96 ++++++++++
 .../selftests/drivers/net/perf/iperf.py       |  23 +++
 .../drivers/net/perf/lib/py/__init__.py       |  59 ++++++
 .../selftests/drivers/net/perf/settings       |   1 +
 .../testing/selftests/net/lib/py/__init__.py  |   9 +-
 tools/testing/selftests/net/lib/py/ksft.py    |  28 +++
 13 files changed, 447 insertions(+), 9 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/lib/py/kperf.py
 create mode 100644 tools/testing/selftests/drivers/net/perf/Makefile
 create mode 100644 tools/testing/selftests/drivers/net/perf/config
 create mode 100755 tools/testing/selftests/drivers/net/perf/devmem.py
 create mode 100755 tools/testing/selftests/drivers/net/perf/iperf.py
 create mode 100644 tools/testing/selftests/drivers/net/perf/lib/py/__init__.py
 create mode 100644 tools/testing/selftests/drivers/net/perf/settings

-- 
2.53.0-Meta
Technical Details
Message-ID: <20261102190827.989117-1-sdf@fomichev.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355000-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355000-linux-kernel-netdev=dewy.ru
From: sdf.kernel@gmail.com (Stanislav Fomichev)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 0/4] selftests: net: add performance metric reporting
Date: Mon,  2 Nov 2026 11:08:23 -0800
Organization: Usenet Network
Message-ID: <20261102190827.989117-1-sdf@fomichev.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3020719"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uoBc1h/+d0wXPay6aGiIADPBbis= sha256:5OtrsmMfD/6eLbRz+PIZhpQXunB/oZs9lTlEAs/qA24=
	sha1:10lvtQXOQca4TCriu0sZuoVH2QE= sha256:8EHYgU5qkKPzxfEDw+wuh+tY50jXfHlFZmdJQX6pOA0=
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 E6D8F112031; Mon,  2 Nov 2026 23:14:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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.249,
	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 50Ol05czdjpZ;
	Mon,  2 Nov 2026 23:14:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-355000-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id C60BD112657; Mon,  2 Nov 2026 23:13:49 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 4D7F4804B1; Mon,  2 Nov 2026 19:09:49 +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=1793646510;
	b=2ZFMfjicxWVIHi4JAGqVhRAGDRddpwPL+Bbdcf2SswoIsVx67Mv4jjVTKQwDUm/b0JPE
	 XBrp0ht2Iyh4joyydC3MmG79+RY5VTtnigAptondSz6uqzIbZCXCWJtkI00b+oJPoTZx7
	 nIToOfHFslTnv29neaDTYoUrZoBWNdBWix5+Z4R4cSisArLfv7qzbjpBYmewL/BiyEBTb
	 kVjoYFYcTNngVVSFBg8LSM/aUgcaVjy+bY87ICs/6clnbyJcVVjzd4yMqTQXb8iy529nf
	 KroPANY832xj36G/1LUcJ3zzNQi+KJcXV2waHiz2szDcw5niD06D4s+S4VaNKXiGyMQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793646510;
	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:X-Google-Original-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=ikw8gEVhvcjahIQQLACyYzboGdzTL6Z1+RtVZ9m3bts=;
	b=l9NSRV4unqL3Xx6PyFhE4PKpXhxDJjekqNf3vAaxVpR/eKn+jRPG8NtU36Gtvfj+vzEN
	 vLQQgwIkmt2DjzFUKzck5EJmoNBSYGz2FrLIGZ5i/4MtU2oCt/cdPRVh43DmgZRdG5ukA
	 cv0Ootxdm91HbAw3T0aYMRZWGerfTWVTxxwfVzwL3cB3xGcD3tbFaoXo8aCYqoVx4QBwt
	 bHqLZjsDb3Hhhc/76s3Voi7Au30l8u9zBoogEIy8Nx0LrqaY3wGdci29G1SfE8xCyt2aS
	 tLSOhOO94hi48SWWUHzOL6HG+9H+0fAijppZ1A0gNK52EIAT0SVemsldoI8TiOijMlg==
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=fpO41EqL;
	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 AA515606D82D;
	Mon,  2 Nov 2026 19:08:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=fpO41EqL
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.133
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793646509;
	b=kHkPrU/d9NLYgLxNG6ZxEaSRCe/ywAyux2Zkl2WETavhOMtd06oW0j7t8VUfc64E9VEt
	 aH2ikFLjyA2vN9qxyQOblpCT1gzna4B1Y+9zzoHepVsnOrGl/0LP6KTLrqrjLsrnORcB0
	 qAbuCcuZ9mZkmKUiWuaqZdj82HCoccWeHho2rpGawLTK89u5h7gFz4ngon9GWrGA/1jJQ
	 T3jjA/8BwzDDRf7GfOy1627c7a7JX+zp6bH8FGvMgMrnl7Bpu8admpoiyAl3IqUA5dbXD
	 EX7fOBTEJL6rGDIsOqRf9shzemQfn0g5QelKhCcZj7WMEaOeUhPcRkZUGe7ijq0G8/w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793646509;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:
	 X-Google-Original-From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Transfer-Encoding;
	bh=ikw8gEVhvcjahIQQLACyYzboGdzTL6Z1+RtVZ9m3bts=;
	b=I/fT47g58zS4Ug+cTRhFFluL/1NJA/Y4HwnFFpH/vT6RM7oTy+ko037kSXHXjkT84zT2
	 8NyojbeZAk/UEYzcbMKEY4gwHsFZEv9CXmRPOw8xACqHz5P158ddv5pFlqHRoIkf8GrH4
	 euAEjEBMpHeTjEpEzYWg5QhjpCc3bXG/j+gBLAePURFzJ0hA7iLz/4ij8uhm1rJLPteJR
	 3gCGQGLSAxfssbxIKH3mmYboPhMg+iMLl8SGd45O5dVMaWbE79SpZhja6pnzrQNQvtoXw
	 z624/DDKxjZw/lADm5+YT4PBhJ2PlL8hF/4Jdd+AfBHjD5jQq5JHoZnJcqSYNxhkLgA==
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=fpO41EqL;
	arc=none smtp.remote-ip=74.125.229.133
X-Received: from mail-dl2-f5.google.com (mail-dl2-f5.google.com [74.125.229.133])
	(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 72649606A327
	for <netdev@vger.kernel.org>; Mon,  2 Nov 2026 19:08:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 72649606A327
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-dl2-f5.google.com with SMTP id a92af1059eb24-1ac216daf7dso1357031c88.1
        for <netdev@vger.kernel.org>; Mon, 02 Nov 2026 11:08:29 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793646508; x=1794251308; 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=ikw8gEVhvcjahIQQLACyYzboGdzTL6Z1+RtVZ9m3bts=;
        b=fpO41EqLCKOu2SNqwmu/JyFzQI1ucLgXgpFjhAgLmMRYqiH54Kshy7G73e9KYODIXh
         YsocpqpeFK3iMEAMh0hAAilDhMuJpjO2CySqjm0OGRgTiJGD/PE1y4VgsntAFQIc+aas
         MfFyYGbvCRHxABZmC+UYASCEB4ie1hENiympS/hUXwwvkBP/bRjjQfRRlrr4wDcE4KIs
         Jb9XJwmEElb9rzeTfYgA4Ji30U4V2IHmt4PDPGoyS4h5BYd0ydq2aic/J7i1vF7DNKUT
         4FCLjZogDxkY6EgTJZLcTVXVdKMNTvj5B7xIH+cN7tdaqtqakUAkTt4C0al0FJmzaB4N
         XbXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793646508; x=1794251308;
        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=ikw8gEVhvcjahIQQLACyYzboGdzTL6Z1+RtVZ9m3bts=;
        b=WGc6TglcAHh+T9RXxsFriObF8StYX/ea7I9tp+EMbTu+F89yl3F2XpHVOjQRokyKJO
         ygXnx+Z+01khmzWu/HSamU6sdv46HBCGVPIqO16FYEMOzpzzhUVIVnv5RXDGCzxn4NWH
         dQKC2+wkucInvPFwnwTXf4IUFjCJjPP+tEpI5tgKvXcAn7gFY4GqdaJDNywbslkEc+YI
         CWC4Rj/Q9v0SA6RQ8Q5pUzOVshK/2dP037kGNz6BCpu+hHZmHEQoaO0+kZywc7w9S5Ml
         CjyvnoW9j1j1hwLXgHsTid9CuNQd4p9y6Jv4ydKVm0/8OZxNDVSbrkHv96YbtrVl1QnJ
         eX1Q==
X-Gm-Message-State: AFq9FYJAcZ0+5rn98GTx1lrcaq3ASXM6RtGxanj1qy3E0ypBKsqqo3Dy
	Av0FgNLRmjy/S0a93AlBhHr8UxFkuG4v6LOXe29uny9ttv+NjajrWK0Q5diy3nPv
X-Gm-Gg: AYBFou1FWEH+eaAhTTu7IaU+ZP53bX1CYDHt9bFXrtU8+eTx+sDJyEE++lfJzOkuVyV
	kpF6H1URlSMxP2C+L9tp9CkbMehBcfDqpvSbDa2IMv4xU11VtoXBsf0EuvaCFDdOereYZIHp+xD
	fmfAgjhVznPQDBVvVgI5trO43ZAYL+Qg+FQUyFGAPBLzZ+aJjTzbCtxjmD2WOfMiupEC+NgZSWJ
	nuQh1zyw7t+2hKQ1eLe5rgHREaU3psjtSfy/hUMDhjuNf0HeKyoLRs1zE76sGtzOdK0/gznTNHi
	VptuiL1kzRyGTAzmOaFcBxjFh1nquhpBusfeU0OzzJy/VEw9G6C/zO3KVooJHYUARer1yevErlG
	WqO9M98Vn2aE2dJ2/4VJIPKJGicr2GPynRApQXt78Pl5+9AQf4EsxcId8+HHQ83EF6ryDHhLMlS
	hWoqs8PpsIapdSRuWZm/1f0TiKG1ybKPQEERcPXJEk2sGPKqADus/lMUmB72yPlTDq83Bc5zFxG
	PbUAEhXqetDuLthBnGRj4Qi6MGzaGbKqOyobvcvvGFKAlC3qUKA9JpI+n+H7DgFYtPfOfHQb7f+
	dAmnG2BrHBwqUEAU9d3BfDs=
X-Received: by 2002:a05:7022:120c:b0:15a:4155:3d9a with SMTP id a92af1059eb24-1ac609808c6mr14709933c88.47.1793646508204;
        Mon, 02 Nov 2026 11:08:28 -0800 (PST)
X-Received: from localhost ([2a03:2880:9ff:67::])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1ac1a9e2ed3sm34320847c88.19.2026.11.02.11.08.27
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 02 Nov 2026 11:08:27 -0800 (PST)
X-Google-Original-From: Stanislav Fomichev <sdf@fomichev.me>
X-Cc: davem@davemloft.net,
	edumazet@google.com,
	kuba@kernel.org,
	pabeni@redhat.com
X-Mailer: git-send-email 2.53.0
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