From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.135 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796060773; b=F29Ko5Y0KeNUD0q6yymAVI+DVwL+fv+Y4/fB6nKKk6ChEG6VF774vhlfSPbVJrp2Lnr2 rdmsG/V+TSxe4kgaw022qEsLvXRWSlD99ruXybfJ+CtWUjznrvAJP+VuUEaSHrJOe0ECC NX7bg31ScaMycd5s0szj3pfT/RYvmEo1lR6+1gL8QXtri4sC+69zSgfUBP5ty+yCdrtXV IpK0khq641ffQinTl8XF2j1DH2vROjHE6GKPFWvF8FksBnAjbR6Z0iSJMQIMIMXIoyp24 bRPDatrytYEC1xDoilr0KRlFYrjbyh0XGgVkizA/gQP/Pwbmp+UYkRwpIVlmN/fPMGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796060773; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=LMl4Efjgkk5U0v3sBekesqZFR7BWP4VgMXemCls3tD4=; b=Ndo7r1sFLsqMZC59bk06dg+KWiwj/c8wlEvw5UnGLjEhV+qLvnXkAgW6Zf4FPArJAFvU qzvVfstrsh8Ozk7o7rIdvW86Bf7EC/ZQsbekLkkLXXwfaK3gLGiJOGoUoG54BsUxDrior eqjHkqd/J+YpA+tXonRs/tK+gH9N+IvyyOsJ2nI3eZTlT6pMBssoxUDLs0SSoSmXmc2Aq h2Ptzhke6wwMlpfAPg++peoeU0EHdXdjKJlmsDpMU2E2mPR0sGWz8kHj8DJ/3PPwpxmAD BgSYiqnjJ5+4JdIKRZxTnIGKXN959wUIuURX8kw4p/3ZamhEngoio7aGWeaAk0haI0A== 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=Nlk2ktlP; arc=none smtp.remote-ip=74.125.229.135 Received: from mail-dl2-f7.google.com (mail-dl2-f7.google.com [74.125.229.135]) (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 899A8606A32C for ; Mon, 30 Nov 2026 17:46:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 899A8606A32C 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=Nlk2ktlP Received: by mail-dl2-f7.google.com with SMTP id a92af1059eb24-14345ae29c5so1842451c88.1 for ; Mon, 30 Nov 2026 09:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796060773; x=1796665573; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LMl4Efjgkk5U0v3sBekesqZFR7BWP4VgMXemCls3tD4=; b=Nlk2ktlPS4PaghTKFohi0pgckGNXszKQ/RyZAHjTOEFvkWH5aZWXRiGVUTH7sxw/RU FLjDpEWuojMPR0lIV0PLpNI1UCJyW5p+yOKsANvl6c1qEjyOYBwtFeRj+eFDtkGvSJvY ecm5bFc4WI2T10pgBYu/VudIsSGxH71OoSELoGoTBll5EBikis+AHDEQdnCNaYmfcZAZ Lfk/fz+pt5wKspW318fiN6ozthhrJLvl0+B7fsZ7yh2i15Lu9z4KDkGL1a0zJVSHST3h AFtvyPmkCexda6SYKhxQ6y/xA7BHRcE3Zu0E/hglTuAdX0PS3sfL1lGiCH2RbF3wuN3+ y5dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796060773; x=1796665573; h=content-transfer-encoding:mime-version:references:in-reply-to :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=LMl4Efjgkk5U0v3sBekesqZFR7BWP4VgMXemCls3tD4=; b=vnNa5gVx9MVPpBloCbrbEPXowFSmMRo5QbQqNNNJXhQGYNE4n4SmvelfPcFvM68Z7z lE/oInf1ME6DgavyEUeoN0jwaTYZ1/uJF3SRTAYum9UxwBP8mdTqncD3ZF4ZmcKpWZ4Z wHeXQM4QudbgqEINC4Gn/oKnaMCW3OQoRVgNW7hVsU6YjqLfSdtEeI4SNfQbjsBCj65f LuVeeYRMjKTJZT3na7/bXl5ittxSc64rG8JDUjP2pmsn0vRO9GfPXto6NaR6kJM0PsCZ D4UQAJ7Gky0UCl5Sr/K5ffnbYqzv0ZTN1I0IF3+IgxtBf0xWF6s1OMYsAMFITl3KBW/a 5+Ew== X-Forwarded-Encrypted: i=1; AL+hErHRWorLq8PG0LmYuEh3/yomfZNEgUIlM7K6Wt5i+N1Wm72KoDh602Tcwwh8FQvm2CvyY504ZCBIkls5iPE=@vger.kernel.org X-Gm-Message-State: APuU4Z+KGvbhqiTmO40ziWw3VycEcOXFKD0KeuZJNwDj7S7bpi2U4/CT movX32HFfS8cNVo06r1hlj8qwPUy1hs2kD8Lb7Jsh44xc9I0kb28bd4X X-Gm-Gg: AZFdTZdfwfnL395L/FKw+ctaE/Ck3CmWhUXTIw0OLfrOSmfXRc/vNVpUdtdZcTlqrtT WrXDjOkWuC7XHU0V3N+QW+9l1z+x2gvg9MeQEEDtxCkONiAuOo48OT1JVxag84froDSYGeX1nSm o+A2GAM+C3bcrjho261VhUyIWB2xYPNzgCkwftwWvuX0Tf25d9v909jD/Hp8Lak5I4gySkOVR7q lm5ISdpNP4AD/b0kCXA3kM+PDTNVN4vczIeh6AIfH0jdIjsfaYt2HArncDYIACT4Ttr+1S/ngvd lJD9tlD9iLq/HnKhifvLnsS6HsqyoApziA3ztVTd6+k8LWZ5Ue3lws3R1Fl7AglzYnS9zkfcksG LRWJXxwqbRgrw0EBhs8DH65tdxKzZ3DXJS2m/0urq36FcszcljifsjQ6DTauwm177jAI6tX/paX ASJt/CaZilke0jrxLHBwjNZFpe31CZTEIq4hnxhyQQkg7CpoZ7rY4GP5vt1/Ef4+BVXQ7M1E0ae wCO2n4MX5dBme9c8Z4zjQp/uV8YDl3QLoglkE8v76VwcebKuv5t1OrWl7JIwNogEb3+bU50yT6M 1M5tIlegqlIIQ4nh X-Received: by 2002:a05:7022:1711:b0:1b3:aee5:20c5 with SMTP id a92af1059eb24-1b5568ac791mr29543426c88.22.1796060772539; Mon, 30 Nov 2026 09:46:12 -0800 (PST) Received: from localhost ([2a03:2880:9ff:6d::]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b56ef9fd16sm74669460c88.4.2026.11.30.09.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 09:46:12 -0800 (PST) From: Stanislav Fomichev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, edumazet@kernel.org, shuah@kernel.org, sdf@fomichev.me, bjorn@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net-next v2 2/4] selftests: drv-net: add a closed-loop request-response test Date: Mon, 30 Nov 2026 09:46:07 -0800 Message-ID: <20261130174609.314114-3-sdf.kernel@gmail.com> X-Mailer: git-send-email 2.53.1 In-Reply-To: <20261130174609.314114-1-sdf.kernel@gmail.com> References: <20261130174609.314114-1-sdf.kernel@gmail.com> X-Mailing-List: linux-kernel@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: Stanislav Fomichev Add rr.py, which measures back-to-back transactions of a kilobyte each way, which fits in a 1500 byte MTU, over one connection with kperf, and reports their rate and the latency percentiles and maximum which kperf reports. Signed-off-by: Stanislav Fomichev --- .../selftests/drivers/net/perf/Makefile | 1 + .../testing/selftests/drivers/net/perf/rr.py | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/perf/rr.py diff --git a/tools/testing/selftests/drivers/net/perf/Makefile b/tools/testing/selftests/drivers/net/perf/Makefile index 1a90537d2726..91feb0d62a7b 100644 --- a/tools/testing/selftests/drivers/net/perf/Makefile +++ b/tools/testing/selftests/drivers/net/perf/Makefile @@ -3,6 +3,7 @@ TEST_PROGS := \ devmem.py \ iperf.py \ + rr.py \ # end of TEST_PROGS TEST_INCLUDES := \ diff --git a/tools/testing/selftests/drivers/net/perf/rr.py b/tools/testing/selftests/drivers/net/perf/rr.py new file mode 100755 index 000000000000..1dff0c476390 --- /dev/null +++ b/tools/testing/selftests/drivers/net/perf/rr.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0 + +"""Measure TCP request-response performance with kperf.""" + +from lib.py import KperfRunner, NetDrvEpEnv, ksft_exit, ksft_metric, ksft_run + + +# One connection, a kilobyte each way, which fits in a 1500 byte MTU, and +# latency percentiles +RR_ARGS = [ + "--time", "10", + "--warmup", "100", + "--num-connections", "1", + "--req-size", "1024", + "--resp-size", "1024", + "--time-stats", "2", + "--validate", "no", +] + + +def _report(result) -> None: + ksft_metric("rate", result.rate, goal="higher") + ksft_metric("latency_p25", result.p25, goal="lower") + ksft_metric("latency_p50", result.p50, goal="lower") + ksft_metric("latency_p90", result.p90, goal="lower") + ksft_metric("latency_p99", result.p99, goal="lower") + ksft_metric("latency_p999", result.p999, goal="lower") + ksft_metric("latency_p9999", result.p9999, goal="lower") + ksft_metric("latency_max", result.lat_max, goal="lower") + + +def closed_loop(cfg) -> None: + """Measure back-to-back transactions.""" + with KperfRunner(cfg) as runner: + _report(runner.run(RR_ARGS)) + + +def main() -> None: + """Run the request-response performance tests.""" + with NetDrvEpEnv(__file__, nsim_test=False) as cfg: + ksft_run([closed_loop], args=(cfg,)) + ksft_exit() + + +if __name__ == "__main__": + main() -- 2.53.1-Meta