🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19006

[PATCH net-next v3 2/2] selftests: drv-net: run tls_hw_offload on netdevsim

#19006
From: Jiayuan Chen
Date: Thu, 19 Nov 2026 06:48
58 lines
11119 bytes
Now that netdevsim offers kTLS device offload, let the test run on it
too: drop nsim_test=False so the default netdevsim pair is used when no
NETIF is set.

The only thing netdevsim can't give is ethtool -S: nsim_ethtool_ops in
drivers/net/netdevsim/ethtool.c has no get_sset_count or get_strings,
so the command fails and every case died taking the NIC counter
snapshot.  That is a gap in netdevsim itself, not in the TLS emulation,
and the NIC counters are optional in this test anyway, so skip the
snapshot on netdevsim instead of adding ethtool stats to the driver.
A netdevsim port passed in through NETIF still runs ethtool -S and fails,
that is not supported for now.

  # ./tls_hw_offload.py
  # Interface: eth1, driver: netdevsim
  TAP version 13
  1..8
  ok 1 tls_hw_offload.test_tls_offload.tls12_aes128
  ok 2 tls_hw_offload.test_tls_offload.tls12_aes256
  ok 3 tls_hw_offload.test_tls_offload.tls12_aes128_ip6
  ok 4 tls_hw_offload.test_tls_offload_sizes.small_buf
  ok 5 tls_hw_offload.test_tls_offload_sizes.large_buf
  ok 6 tls_hw_offload.test_tls_offload_sizes.random_buf
  ok 7 tls_hw_offload.test_tls_offload_record_type.handshake
  ok 8 tls_hw_offload.test_tls_offload_record_type.alert
  # Totals: pass:8 fail:0 xfail:0 xpass:0 skip:0 error:0

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
---
 tools/testing/selftests/drivers/net/hw/tls_hw_offload.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
index e720ce6547610..1197f17caa13c 100755
--- a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
+++ b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
@@ -125,6 +125,9 @@ def read_nic_stats(cfg):
     # before/after-delta caveat as read_tls_stats(): these are device-wide,
     # so concurrent kTLS traffic on this NIC would perturb the deltas.
     stats = defaultdict(int)
+    # netdevsim has no ethtool -S, and the NIC counters below are optional
+    if cfg.get_local_nsim_dev():
+        return stats
     output = cmd(f"ethtool -S {cfg.ifname}").stdout
     for line in output.strip().split('\n'):
         key, sep, val = line.partition(':')
@@ -307,7 +310,7 @@ def test_tls_offload_record_type(cfg, record_type):
 
 def main() -> None:
     """Set up the DUT/peer environment and run the offload test suites."""
-    with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
+    with NetDrvEpEnv(__file__) as cfg:
         cfg.bin_local = cfg.test_dir / "tls_hw_offload"
         cfg.bin_remote = None
         cfg.tls_skip_reason = None
-- 
2.43.0
Technical Details
Message-ID: <20261119064902.242502-3-jiayuan.chen@linux.dev>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366788-linux-kernel-netdev=dewy.ru
References: <20261119064902.242502-1-jiayuan.chen@linux.dev>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366788-linux-kernel-netdev=dewy.ru
From: jiayuan.chen@linux.dev (Jiayuan Chen)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 2/2] selftests: drv-net: run tls_hw_offload on netdevsim
Date: Thu, 19 Nov 2026 14:48:51 +0800
Organization: Usenet Network
Message-ID: <20261119064902.242502-3-jiayuan.chen@linux.dev>
References: <20261119064902.242502-1-jiayuan.chen@linux.dev>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2810868"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:BO1qKH3KYL+UOClTRRyU3CRNd2E= sha256:VJYa4BVGyxSMxk5qSbDjQxcTaueL/0Bn/VsHJAhvMA0=
	sha1:/Yo/48MlgpqMdgn3AAEahAwpiCs= sha256:RWMWuC8+51h5esElM12vxGL8tuOvaH0Gz6r/RZExnxs=
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 F2376115533; Thu, 19 Nov 2026 09:50:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.05
X-Spam-Status: No, score=-2.05 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	HK_RANDOM_FROM=1, 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 (1024-bit key)
	header.d=linux.dev
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 7QDSGlRl-rEh;
	Thu, 19 Nov 2026 09:50:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-366788-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 50E7B115525; Thu, 19 Nov 2026 09:50:10 +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 69717149AD1; Thu, 19 Nov 2026 06:50:00 +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=1795070993;
	b=p9ZOFb6j9OATb3P6hSTdbeQ11GNJsYfjstcgZs2YLPwgo238RL0wGwKRdH3qDOAydxQd
	 rztJP6xfpv0cfqpdiUA3JJQQLzkf6XGfnTV4lFhbLTlVRLCA+PLBYpQNzg4VimkEjhRV8
	 LiiYoD/FknkjIqhNKNVN9bUjSXM3NVS0lQz+4tWyFtX5IdtMz0hgtXaxtEVG1koiTTpm/
	 YEUjj5m+6BfyGctryW/WUaiIzjrhsw9VTGAVq5Uf06qDjZctmRr85BJhCJd8OkZtFcUeH
	 /YwON670Y7JTpLcrLG90thHnd59edD80ITnY87r/OLj333zUy9XaB/XONRleUe0nTvA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795070993;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:
	 Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=fFtNKWh5sCdTC+S0cGQWEyXMgW5g+xTd4hHCi9qN4EU=;
	b=B/bvBM1LNX4y7GgpKpoX7u+YUe/fXboqCmX8rGiv76FV3GdW67X9LY/d3A6JiO4ZDiBs
	 mS/rVS+s00GHXw7BoogcDSrYFy7Z7901p4VgS3lDhQyXfexEBLu58/mcMEGeRfHaifOU7
	 tjeo8iM6GXpIA9LP0XCXC0yv7XYTAmulpjdHDBY0pM5EztYR97pMSg2j1leXxIcMgGu9A
	 2n2R9L+DTve3JsJgnUzxBYTV2L6Sfdg3Lk34AwA+cpQHhIFpf5mWFLhlP0cOnwHFYy9PK
	 LLv1Cyao8LgVpL3/C2EL/P530GSjQ3iXl5HDBE5ccsVtUPoQHj/Tt+AUztRGu0kL4Wg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dhVp2N7C;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 D8DF8606A32F;
	Thu, 19 Nov 2026 06:49:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dhVp2N7C
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.113
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795070988;
	b=Rapvu9saIuXDuOAHDgyVPJW0X3D81H91L5jMRqsu40ndR/Bxx0wJ4epBfClTTqh5yp6Z
	 ON0HYI1EpQ0ciyZk8env++7NJ/sVLwUuqeKBvuTghfYJM9nxnMAWBPvRkL733rpOWNGrs
	 bSW32nBn9PrJodowdc9cFGtGjyvJQe6ULtp2MmMwmGa8YonqhmfATcLjKQuf42uYdBMLF
	 5AgFJ16qv29JZIvSY6zbAK7+m3Abg2JQLTdlqZ/Z3zYvlvtmFqjy1fwtJlgjybFkjpCE4
	 Y8Wguy1/TXv0PB2XWPVAoSo2v3iDMbD4j4VypZwxwLrUczrkojOg/gZlYiZc+EJHPAw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795070988;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=fFtNKWh5sCdTC+S0cGQWEyXMgW5g+xTd4hHCi9qN4EU=;
	b=j8yqSwytY/tqQmEiJjVIjungiVjSoaV+bc6mQeA2tt/wynjjb2/QEj5rEOh+QJjl6GMI
	 VnMQljynePzdo1JnvoPEVGAozWEDAKtqWRJMGKKFkwMcC+EVZrnmHv6mc/aThcbKpwpf6
	 6LFSiSn6LG9FK3uPqfqT0otJ33KAUcmoI7Dx4PshaFAH5ZdqAJtViECMN5nZEvujixS1q
	 AaPgQKxDmo7w3oozo/TK4hbpYKb71vh+hJOIGrlo8MWZsM2D/wLl4seC+yGWEBFlfR3Ej
	 vVqzbXN82xkdtwzuDJHeRuvpzxUPWLXPHWH78+AgjbhLbp4fWk4oOMeQh4aE0mEpAIg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dhVp2N7C;
	arc=none smtp.remote-ip=91.218.175.113
X-Received: from mta0.migadu.com (out-113.mta0.migadu.com [91.218.175.113])
	(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 66B8E606A33F
	for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 06:49:46 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66B8E606A33F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=/tGdPvwhxPFu63Kn0ZYWw898SW5K2Ud4dFBtURngO+c=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795070985; v=1; x=1795675785;
 b=dhVp2N7CMC5DV45klPqWj7NK3D85UeOJIFFLgAuSSwn8+UfK2D9tJnPbnIQKRrn0nT0lUBvx
 DJLfQ/gi89BOdPf1fQlR/NLbDjFVYbvDzYAJsxe25RiI+f34/S0E+gfa/xt34FS0McYpntl6zgZ
 f6cO8+RE1ijZTlUq2DD1on8w=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id a7cf3eda06a126e6;
	Thu, 19 Nov 2026 06:49:45 +0000
X-Mizu-Trace-ID: a7cf3eda06a126e6
X-Migadu-Flow: FLOW_OUT
X-Cc: Jiayuan Chen <jiayuan.chen@linux.dev>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <20261119064902.242502-1-jiayuan.chen@linux.dev>
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