From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.138 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796060773; b=sM1gWgpXK05ekHFQUXiokjP+7dz2sahngMWeHEUQ24eRTA2SJxj7Xf3jn5pZqQqtMvgL lATpbxlfgF7V3/QesIrtC/ijAtamK7pPNBZXsGrgm4f8JeXCxUuLjeSvR2knROpuu+Rq5 Msz7k/hkYRcTV7yx7AKln+XqJAUB5aMAyo+LOilNNwYFUtAh68DU5e1EG+/ChL3JbouZz jmXUSV95P0dgxStA6MriKIE5gzrsOPRPny1q4ekcFKuQD68hWGj5sXuKU1g/2ao/tJ6Jo IVnj6TOyKF72bfELYMjgu7RvZtx7cVXjQg8R0e25IXs1ZOm1hX9yEr0bJ9N046orypg== 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=nMQ3iWogTbmVg0E2iGf5AKDu8uFxSdZ+L/iyUAHOmk3/8k99rfZ4c2KZUCHA5p21hfYN EQ3nO6yad1c3/wO2YuXUrFBNqWMJQIfMOG5aTa6Xdt4ojUx4sfXFzqBB/e6y0Va0apMyS 3wtulbWleJTTSFury5RdbKMpT7B58zzhzQycoGsHNs9WbH1B/8ueeKkQorpCjqL/JrWtn C8bJZZ5Dk78BQFZlHTMGc+ySIMu2cmlUtGFa+g+BSogHbnmy1o5NOU3xsLOkZSM9aXTzO 4gHZmyL5y18t2MIXNFGbhnXnZHuDsDMNiI9hEau9EV28pbTAbsqaZnrlFaaTu8Ul7/g== 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.138 Received: from mail-dl2-f10.google.com (mail-dl2-f10.google.com [74.125.229.138]) (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 9230C606A336 for ; Mon, 30 Nov 2026 17:46:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9230C606A336 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-f10.google.com with SMTP id a92af1059eb24-17c2de6994cso936954c88.0 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=DyBF+JgS7RroaiourmAvfOSZXtAtbGdJ9hxcJQqXTOatG1t2D2Q4Z/Gc1FVd4Illzk OtDCegUO44d0oGkkciXoZYcoIJcrHIJ3bz1alSoSWEgsmSvN5XpvBvPaom2h7mCRZI5g eZ4WItOPbU0a4Jyqtosnmb7b+ydh/LH5zfJ0yXLGUWTB90zxgCu+N67RXX/+TfZsRyyk AC9vpGpY56Ji0DsHLLq7rDwITC2s8sn2gOccfKOviVpidyu/8kz7DSmjVUdCLzEa0UJb ww+CiOJyuzOzacNNz9VUwT1Vt+i8l0fLW3A6GaCuAxLXUgt/Xw2bV71ZSA72ff6DSQvs H3aA== X-Forwarded-Encrypted: i=1; AL+hErHZ5WZvFbd/vYo4tQS/vDF0hpJ5rNU8hn80E8P906fDwzkNbfeNlSgajiX8D6rtVpKlWwHDgG5FL8jKP21m90k=@vger.kernel.org X-Gm-Message-State: APuU4Z+HnCnFNAt4j1SVPIPMCWg8D8jyPQlq5VCqJfx6KD51yu6Yns0A Y5dit/Wb90diC41/xzHRV6N8Ptxx49e4FFVtSkmq5dklUV+SnpQ98Ws4 X-Gm-Gg: AZFdTZcrPABgOI9ePCwZUjGvP7bJzcm2ThqfL3ChcDM/FGRin784NDlumh+mXgFxq/X HeqQ5uUlIxR+Mp1usH9fgHls6qGVGmsjAHG/5F74VvQHTiZJ8a2iPKUt/9mTsTcVi0Ijj2UeSEP Qg1gy0duZoBrz+burJ0a7HsinGaF+nIFvYkE+cgOozHgGvVwzV/5q5KrhUGIJmCY4sY4AKpvoP0 58cuIixtK3aiYoQ5O7PbxPq2az514iFmvbmUT7ksNXhwbqq6TbYE3WUMc6ipuJrZ49tuUPwRDxK HHYYbYLRjfpJc7r2CsTVTasm8SyooSq0ATR/p31bP0R2pN66I4NYc0vegoksT7hTjq6RcVsznuV t4bfuZPYl4jwcRPE4ElbSCM4pQ3gS08KdbUpDwo7oAr96khzIe+AAuI6zzuFcKLI/CZEW0iB/ws Y+aeK96KCfb8AsqEjmVU70lMHT7SA4E4ntKsUnZqIqEhORRCjBYO3cxro9lSEKDkcN+5+tBe+3q 9APoVttQKQ1qMh+zHFp2s3PDB4CpU9l+MafKJwOE6EjXcDTAZ992PVAmlXUpFtwwH2CGPIUIIeu DZD6PyR96u1kziwf 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-kselftest@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