๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14331

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

#14331
From: Stanislav Fomichev
Date: Wed, 11 Nov 2026 00:02
93 lines
14814 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 right away as JSON:

  # 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

v4:
- print metrics right away (Jakub)
- mark the exit code of the perf lib/py on import failures as KSFT_SKIP
  (Bjรถrn)
- let kperf-server --kill wait for the sessions of the server, drop the
  pgrep loop (Jakub):
  https://github.com/facebookexperimental/kperf/pull/47

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  |  16 ++
 .../selftests/drivers/net/lib/py/__init__.py  |   4 +-
 .../selftests/drivers/net/lib/py/kperf.py     | 157 ++++++++++++++++++
 .../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    |  20 +++
 13 files changed, 414 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: <20261111000246.962871-1-sdf@fomichev.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360752-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360752-linux-kernel-netdev=dewy.ru
From: sdf.kernel@gmail.com (Stanislav Fomichev)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v4 0/4] selftests: net: add performance metric reporting
Date: Tue, 10 Nov 2026 16:02:42 -0800
Organization: Usenet Network
Message-ID: <20261111000246.962871-1-sdf@fomichev.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="735423"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8K05obt3pG8Pe0wX02vNNUZv+2E= sha256:xeTEfC3QVEWc7KUkhWNoSX6P2lTVO0UgL/ogyoDsHLw=
	sha1:fdOnSiYT4lAwkSa/UdugzZkPxeo= sha256:Kpop+PWDZgVB2IxTt2O9DBDPwvnUfIujvgW7d95QtSk=
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 2DF46113DD3; Wed, 11 Nov 2026 03:05:48 +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 oQsN0zpFhjld;
	Wed, 11 Nov 2026 03:05:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360752-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 2A33D113D98; Wed, 11 Nov 2026 03:05:36 +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 52235651B3; Wed, 11 Nov 2026 00:02:50 +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=1794355370;
	b=5mdCaCPkGGQpYVHX25y4G4/DeeTSGNB87/0wfYh+lS7cczHqnbcYfIZjjfXLsL+0Lfc/
	 bvS+G6EiNVxHZnaqDXG4wPwJ7o4mbC9uUcBFwfgC+x2MRnGJmCN+/PINj+TXabVH4YTLy
	 C7X/Tjx32dyl84p1QFcgzByL0oDHU9e6J+bJIlpoh+MKvT78BOz0ZKrolnY6IRaG6lRxJ
	 pTCNUpveiAo9ABDw6f8ZRicC/zJC5mq85SgtsNfpMsq794EG6i2lIng1Nd40pTwSpPbB1
	 qoCfPulgoPll7L1Lx+d+NBAQ+4cHNQl032zgWyyRdhG7dAVZv8aySUIP8YuleP6apCQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794355370;
	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-Type:
	 Content-Transfer-Encoding;
	bh=7ZZ/OFN0ufJbb8Tmi6kc1Fvy321WkMZjqWXL4JlnW4A=;
	b=xorumG1BFvwcT8WeKb6wHRtNij25pHkbXk5N4F5gmDKUo/cTa5gedJ3NIEppx8Vn3lrU
	 THJIBx0NJVN79ieaE7kC9+IFmLQPk57bNX6fjTMFrTgpT6IcxpiLfL3vl2C6QNQcDM4x+
	 KK0S3xPn0KBlaaldxQGPStF0e6hg2zWy2fx65QnFH6gvpOKN/VQloW44VfcY6p6CG65Ob
	 hMs1BdCL1LQTFWCLCwDuAD6OGi88WN6v12tVoUyXJk2uHQakNwbwL77/9lkR/qIpjAXMR
	 N/u+yMFNVWDYOdjob0c02yhx+N0LPjfvHbpy2UAgxcTXVY37k+NAX5R3XrcW+HiRopQ==
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=Em7NERXb;
	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 288E6606A327;
	Wed, 11 Nov 2026 00:02:50 +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=Em7NERXb
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.4
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794355369;
	b=2E3eRBmN/XKYzPxIKVeOHS6lanzPIVg4KK2RCsITeQySlWeSE2tVrM9VgGMHDV79kiRZ
	 avTIYdt67/7/QVAgGJiDKiSOHkFosWsO2o4JcNur5VJxcPQyIVxhO111zTsjNGCjo7kMC
	 em+k8cCKuvQisUkXjjDkeC/Vcl1DTe9mjDiGbujcgMlANBoJER8p/ZAoapET/A/2WnnTr
	 TiQRN5ROEdMr6OvmEnI+dBpcY0rfEvQsSMDJK2WDJ48DMWjW1Cgz3Ar74VFq1cxTnIreV
	 ICulk2+cK4CEHDA/3rPxC9ztNfIhupgCjG7Ow+TG6c2bOjrr92s7r8U4rPqDBJan6oQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794355369;
	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-Type:Content-Transfer-Encoding;
	bh=7ZZ/OFN0ufJbb8Tmi6kc1Fvy321WkMZjqWXL4JlnW4A=;
	b=BgM9wmlmH02X0EGIOEEeAqTyaVBNs8nxYarRiPUBRwK82atDZ0HnsIygm4WpaUDwbGGa
	 8n44n/8X8IQ1a1EhcBBHrfdm8Aakn/XgRYzUd5MoTEoO34frBgKIKFqkSR7UkfoN/mAnN
	 noV7gq8Ny+hdSXy6OILI1fyoiioIUDONaQccoSKmHDf+5ZFeysHDjc6Fwjp1Tr8excAsT
	 KqiZ/5+ZuBdcPJXhRuHGSFWCOZfjVshz9Vb2UNGEr9j40ygfaIBVTyHrdn1wod0SGEQ1U
	 /LSTacxZpqw9kBQ2K7h+DdDsaOUBK4jGi8Zupq9pSEuqARfK7TbMpRJqWrYH9svndcw==
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=Em7NERXb;
	arc=none smtp.remote-ip=74.125.229.4
X-Received: from mail-dy2-f4.google.com (mail-dy2-f4.google.com [74.125.229.4])
	(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 DE365606A321
	for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 00:02:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE365606A321
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-dy2-f4.google.com with SMTP id 5a478bee46e88-36e06480786so1084693eec.1
        for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 16:02:48 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1794355368; x=1794960168; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=7ZZ/OFN0ufJbb8Tmi6kc1Fvy321WkMZjqWXL4JlnW4A=;
        b=Em7NERXbOQDdoDGQ4771cf98rPsDTeIWpb4qzIWGSKJmuk/ibMdqFATa+f09MW1bZU
         WwzhuqlJnBnN3YlF5Lg3k8WqFavghHbIjoZaqxeCjgxIqpGm3HQoeTllxImzj8TffxaM
         giOK5kGQEUxWtuxmxIaBW+drmsy9677e7DLeizy+plenTAx/xT/fWPMgxvMItskN7MOr
         TdzezpO6ocBD60UaL/OD6SMXga/ewi5IuroWFKov70I0JLGIlL2qH1KMSkfmRI+JmR9k
         dAseQJfzZrkky0PKGDJBG6B7mJBnmDLm/1MxecDj2TWZ/EgaZG+ni3LOkR4g6eTVH//O
         XL0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794355368; x=1794960168;
        h=content-transfer-encoding:content-type: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=7ZZ/OFN0ufJbb8Tmi6kc1Fvy321WkMZjqWXL4JlnW4A=;
        b=NepTz7dBjqdBNK30yRgoiATg2j1IWhMG1OS/tu7xPMjlMuy3WNXQmG188ranap86zG
         mGdiPz9i4scoliCdaLtbS5qEGulKsxS0FiiC+osTDWh6tS4idhaQAT5CJLmQoH1chU0s
         GBXSc5M50ck+UyjJgrp1istllIodpDCUK6Ta518I68apHuv2DWSmtZRx+2hVJQjKYW7O
         tOGlYVbN3kWhs1pmshIkw178UGE8XSZlcC4zEBzVqE+OTZ6T2Z3owyatB+L/wmzyDHRz
         OUHF4TUa8JIS7DKuELdOb9RZtCJhff4iKUwKMhGzSDP5fZ1PH0AK4IsvQCBiKybkhJs8
         r/qw==
X-Gm-Message-State: APuU4Z/0syjF5Q7ob48YI16KpHC2xATxtd5XtaQE5sM0oaaFkMFGn/Pe
	8iDlbgEvED9t5pW50YoQw3a2mrWiD0/mhBnbrFXYqUjU1/zPV9FqxvxtN/9c0hDcbPI=
X-Gm-Gg: AYBFou3LW8xxZbhIeWwebhzkLXik9XbOpD25gAJ/bJ/9mz6iz5ARb4sYiZO5dVpwhuZ
	Lu7Py6qSJK9eVb4EoHCFO7X9kXcaMyZoA0PmwwOLFHkzUIsgsQSo+gJ7YjfSfrQZM59ayPF2yWr
	EJ0oZnD0NECrqlpMO7dma2+4c08GhLqXszgwc1tNBUFwjh/AHr5TCzd/Wvt/enaMJrcMwmVOeLZ
	mD2wb8kyG85cq8X6x3Q6WhiXQPtc8rCyjT576dygePHUixyXlBeTbDkorkP5ArN9XoMqeoBNz60
	oTb8pVJuLNoiVElc6PNULu6MK6mLC+fKgOXPmmBdOaJSKpWuaQ9TI2ETNDIpWnY9sgJH5JCqNu0
	uv4lwk2zchw5ncB2NO2+irUeWBUxhdbZ9I3vy92FtjCJzKHU77rLXQv9LyNaw4JJIeczoUxAI9n
	LFUGNBqGiYCWqkerHzevhfVQkSIS5j5EUC+yhlaMW4MasTkhXvLLjb4FwekwdTntpGkgDcetWgT
	EUsv1LA5BgUoE2TcKgucOv3saYiL56hFI3axjnHUdltPpkcnZTk9s+WRqI1WZeD9L7FKiasfEG4
	8r7DRSISfwkuc+E3v6BXTcg=
X-Received: by 2002:a05:693c:895b:10b0:36f:be1f:1191 with SMTP id 5a478bee46e88-37686d329d5mr1337679eec.29.1794355367890;
        Tue, 10 Nov 2026 16:02:47 -0800 (PST)
X-Received: from localhost ([2a03:2880:9ff:64::])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3751d9f135asm10112195eec.2.2026.11.10.16.02.46
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 10 Nov 2026 16:02:46 -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