From nobody Fri Sep 25 18:24:29 2026 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C6B73B5841; Wed, 9 Sep 2026 19:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983499; cv=none; b=KjSDCRnHuu2Q3jb+rw0kJNKtwvqgo0cf2S1rLJUuyINqBNwCx5+W1h6P/WlAKV6TrK2dRFSAIAIjS3qm9WHh+fUiAjdpWeBjLDygdfqKsKVNQiw9L5tVSIXYETagof+bpRG6T3402AbGvPzEowg0mdXWMIRITIHzK3jxZfopcsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983499; c=relaxed/simple; bh=2H4gOkjbkosuL2QTSh2px1EMOkBL4zBojeBjpxfKbQg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=isMkUP0ZVVoGyOXwc1A7USWkpy1E18n95/AmetIMm8SCKS2a6GI7HdPyzKKLYtkI/7IrGsrrD3KfUgO0+n5dlVSnYY3DNEUoWgMYZdUmEpMeXShlhR/q0Z/HAoBTDl667ZQdFaycn0UIhx9oNRLc0ZqsBUFLJVIQAcGKAGxsBWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=GfhL+6OO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kndtWAKo; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="GfhL+6OO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kndtWAKo" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id D45F41D00067; Wed, 9 Sep 2026 15:51:35 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 09 Sep 2026 15:51:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983495; x=1789069895; bh=8FtdEuSSYu8b/97OkZPFPpyvwZMNqivkR7IA8HKt3VE=; b= GfhL+6OOUIDqTAACZjPVwgvWDW9C3+DWhXMuBiGwmGha65Sp8Kjc59YBFpJAxk08 si2NchbK4ju/OxEHzYjwwGrLW1AJm2klw7XR3ouKbjPNuecdNDGnmCHDc77leG/r c34jYUK2rGpH+Hh0wByObIbR/3dYIyZ1a3LdDLEksH6SsVEwvm9U1uw4VYofKhjj kHd4aUL8dCfnXnqba5vR1kuhElkhtrjpdyilb0Ji0y8ujKmKO/XIGRByO/7a/Bjd cWEUcwJTaYOVnfLqC/WWD6uXq2YSwCcg+LnEzcUcy/jIkDaXXw9QfZVBLtTAHMEg 1v+a6XZIt0i14nghXVjGaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983495; x= 1789069895; bh=8FtdEuSSYu8b/97OkZPFPpyvwZMNqivkR7IA8HKt3VE=; b=k ndtWAKoCa110jgsSBKU3s5SECmYikPOd5LpNwWlczoFJSI4l9peU7sx66IC0SywN vR309rHhYc1C5M88EXLQDP/tlUMMNFyug9qdSto6PTDGOxi/HyTA1HDvCz9VL69p TgBZNKAWahAzSVwRCoIFw/9/od99B7lCbqu8MtzsHQwQdColJ39qvL/QTObYEQaH cVxjBUrint+PbthFEbZtqa1QC9mmdOodX9z9AglrRpACpSRDIrLkjyHG8RQt6WrI wOhm7IPHMy2+W9o3pKvDzxaypjxV+2x7JZAbdC6pRcd2TOLP15ilukHl9RIjlCMi zNMK7VvNSeZuK9/O8prtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEgBr+UJG89vIfJp3eQOegU3abk3SipRx//dlEx5Pv0zLrGXPfJ9IBXN0E87On8Ye z0b3cKtfB3klUda7Mj3cH2iCccpqYnm+PsLIznAVjMTUzxmmX29UZV5X3+pqBCTmneZ3La cE7GZ4rYM5l73vV08VLI/qgOvOOK55AR7OHp5+/hTo0G22PafnlI1GqnNZa7i328kRBmGn WjUSDfW4Id4zkv/vUzeNS4l8a8vAqw5GvzRR8dwbm7I2nBj517HQuhREGyLpnXGKzNXZH9 G/pWlMYRg3JqYwwLAVlwLVXlLjCBkLNT7/Qv1sRLzHHrIOswiOMQ+Q/wYFVsP0Ne9bO1k1 C/PqLeoc9vkr70Fq56Yrq1UxeoOhKfHMAvOcxa/MCN8UMf/uoz2H1CPpJvkVNQFteBGVVo YHsAC9hjNhkx4hGBFGGc3XLu5APgsqKWyaljb3QSSIzXazZz/U9NHkplzrA0v3GJMpCR7s BBswy8m1OFVbqm9bOgjn8xE1eDcuGR+8CsA39zwzUrvN0WxHlmUgeze9nIDUKarkAXnOZ6 pw/SsARQ28s2FtRVAxF9lhrdLArJrnf8ttpios+OLBbi4/DGrrd7B9JHmnEU3eBdj0uIJq 7ouSB6FGeIBPe54j1TDw6LqnjdC3VYLTTjM0d+C99CUCk/4PrZNhRf5u3d5w X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:35 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:23 -0500 Subject: [PATCH net-next v7 1/6] selftests: net: fix get_refill_ring_size() to use its local variable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-1-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1129; i=juanlu@fastmail.com; h=from:subject:message-id; bh=2H4gOkjbkosuL2QTSh2px1EMOkBL4zBojeBjpxfKbQg=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxzRmDx70nP+WaVZBQuWttWIpsolvDHjeZn14MiJh MoYJ/3QjoksDGJcDJZiiiweL0VaNKZWNN5VjRCEmcPKBDJEWqSBAQhYGPhyE/NKjXSM9Ey1DfUM jXQMdIwZuDgFYKptEhj+GR+0+Df//VT+e2dkPPN3LfsV8PmOn+7nim1ya71zVqz+coHhf5Tp7T9 ngreJRu3dc0qw20h8iUcl79OHW1ht9q548O3VRjYA X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 In preparation for multi-threaded rss selftests, fix get_refill_ring_size() to use its local `size` variable instead of assigning to the file-global `ring_size`. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/test= ing/selftests/drivers/net/hw/iou-zcrx.c index f6a8fc5fac24..df6b62204343 100644 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c @@ -132,10 +132,10 @@ static inline size_t get_refill_ring_size(unsigned in= t rq_entries) { size_t size; =20 - ring_size =3D rq_entries * sizeof(struct io_uring_zcrx_rqe); + size =3D rq_entries * sizeof(struct io_uring_zcrx_rqe); /* add space for the header (head/tail/etc.) */ - ring_size +=3D page_size; - return ALIGN_UP(ring_size, page_size); + size +=3D page_size; + return ALIGN_UP(size, page_size); } =20 static void setup_zcrx(struct io_uring *ring) --=20 2.50.1 From nobody Fri Sep 25 18:24:29 2026 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D51D3CAA54; Wed, 9 Sep 2026 19:51:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983499; cv=none; b=E2nJ6Rxb420Vcec+JORdGxrujQYB/sf/CkYbF1BEkXe5e8TcNqfOTRrFhh3ewZIcZsU2e/hoJQtBhY7tTf5FHbs+A6iQAFiXCQW/luolCjCuX8c85bDj0RZQLX/9Kal8OU04oIk+N/oTxEac118JMDEqBfjltUZmvvG2d2afXEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983499; c=relaxed/simple; bh=DEZX7yB5hvGm3kzuhsLGPVm3T+hGf3MNeV/sibLg9bo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G3+CDydSC48m4/Mh63tLV9UA5W1so9MYqzFWkIDy+zdjHLGq+J5MiBl80pqu2vqHlTceW+N2RuVxjTXbOAcWzeQF4EJPSL2h5MWJQu9t3wRzWxydoZv2vjAsEp6T9AYsUS2Epd54fA9v++Je0VSextIVrZaz16O3i/m/9d8OCsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=Mu3yInhg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=R75cZC3y; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="Mu3yInhg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="R75cZC3y" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 424821D0006B; Wed, 9 Sep 2026 15:51:37 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 09 Sep 2026 15:51:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983497; x=1789069897; bh=yqUaOTYpRUdIsvweYNWO62QWWSoFqMe5Y9Qks7f38qE=; b= Mu3yInhgGL1ZzvtTXp/8Ygiz+HkAs5O26j5Qty7QNlPTsQZtyGjgsayaYXwundVd 5C9V7Uuy/syV+NqT83JeQVbkFiCjVGB6O/Oxq6CNTTzk1OcPv2HsCx0q8EiXT8mp IJNBqS7rHItvUizdU1ulYh+8w5huRm43jU9HrnG8ozLV1qMT/BKqDWHg8txI1ByN 16KjuqyIVU7SygL38wCtYmLrI6ezzg/gB+5kycKOE3qQGCAE7mG3ZmNkK2bLpDWi lZvGNcjxyM8vzIQG1dYS5dfzrFulqcYhlMPAS3UHrjU9xFH/upc+5/0TEei1YTcO naw67yW5Q0i6aY4KrzCjKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983497; x= 1789069897; bh=yqUaOTYpRUdIsvweYNWO62QWWSoFqMe5Y9Qks7f38qE=; b=R 75cZC3yAvX5sgg9+QgMEf/sxEY1PcBDGqG5StcEBWJJW3WXNpPcrpldlV2JshU9K e1ctlYhXqfloW0jZg+qG2f9sSqURnoPp/xagr4qtmBEKiRnguwajOU+pL3FgfHzk 8ZbST+oS4Q7Elk97QdacSkCe7PTXFlSOy5/3ytueHYT02QE154h5pH3Zq5kP8KWT av3CYRWtFkiSyqP2whpba2nHZ979Uh8cIATX2WtgDWM19/aONpx63BqUc8iBhEq6 KR06bZRohDG00TY9igcO2VlbewCFwcqPCpDSy5nIkk5EgUy3BIVT8IocB/9OThtG 6/BUcKRXoDIVFTPjAlBzg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEFYHVvCfwx4U8YgfEMH7BMorVr8L3QnVJJv9/D+0cn8YaEFJEd9DvtB2eKhSnml2 r1D4RAmLjpVhD2pdi5C/LqxCwGeSFV/6uvRt+FDpgJInpteK7lX7NH3zL9mFMl9RWk29g9 z0BgnWdxt5b9tLr864MkzteR+YtZ17YAh/GPMuSAZJGVOzLKb1GhmO4hFwcYwbqAVUxUfT KixY5MutYW7h2xjR37QK+GPpi+YUwaS1njB+2XEffZuAgWY2q0jKqBXmXe5zJO8n+eCOe3 7qQqNNGfoDtPGVKwCBfkUdDMMx59hcSY5ovdOo4PjUcIBCt1hPaxUWwhL/GeYi3dXaY5CR qgivfGxRrCzZjZcQ7SGqsVk6oSHaMqsRy4BAZEK/EdguEw4bgeho4Wr56xqNpGHYvouN8Y wUDW1zdLOB1E4/BpxwvUBb4PE0ziYo2N5RuqfEzFd2/0JKGFASv9EF6HleMcZLOgGDq6ea T79RIuWKTzjGTuQCNPt7FMx7c9KVyKtyCtYkmgRap9ZDK1cFyO8Rfb+zAxqensxAZzc9D5 C9viY9ZaFCVWLX7wnB6cIa7eWxD9xh/ZcN7UhBYhv2VhsB8FHNb9oHKPJPeTQsI5M/c2Zi yKIprEDeS6s1c5eLbFSwbFwbsIF3DDlnBUP3cUjFWj/AUWF+5kOqGykE4JCA X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:36 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:24 -0500 Subject: [PATCH net-next v7 2/6] selftests: net: remove unused variable in process_recvzc() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-2-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=901; i=juanlu@fastmail.com; h=from:subject:message-id; bh=DEZX7yB5hvGm3kzuhsLGPVm3T+hGf3MNeV/sibLg9bo=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxzZNimMf9OaSdbpn35WyS64aqbNk2Jz57xDhdW37 X+Z6u/t65jIwiDGxWAppsji8VKkRWNqReNd1QhBmDmsTCBDpEUaGICAhYEvNzGv1EjHSM9U21DP 0EjHQMeYgYtTAKb60CeG/zGTlwpN+LI/3DfU61mzHOMaZa6w8phtql71XHGr1hoFrWT4X9Olu7e t0l1OfkKEruAi4T261jdP74/ebuO6orU5Pz+EAQA= X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 Remove the unused `sqe` variable in preparation for the multiqueue rss selftest changes to process_recvzc() in the following commits. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/test= ing/selftests/drivers/net/hw/iou-zcrx.c index df6b62204343..c6dbd0ad5368 100644 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c @@ -269,7 +269,6 @@ static void process_recvzc(struct io_uring *ring, struc= t io_uring_cqe *cqe) unsigned rq_mask =3D rq_ring.ring_entries - 1; struct io_uring_zcrx_cqe *rcqe; struct io_uring_zcrx_rqe *rqe; - struct io_uring_sqe *sqe; uint64_t mask; char *data; ssize_t n; --=20 2.50.1 From nobody Fri Sep 25 18:24:29 2026 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A10E3CD8C9; Wed, 9 Sep 2026 19:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983502; cv=none; b=dWt1iJu7+dxDH1CG1NOCd8oglcudgtSmNKt2Kkh6k+utVZ+EIKdULBiOaB0P9ThCfdEYYE322zk9Um4zxy0ME9fyR4iHnCL8oLBx5pU9hYXTaNJgx84wIGdNKQVCxhxWDbHKSJ1DTeZdOlNnOwTMcTJ7YnewouaKMmm6mZYHjRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983502; c=relaxed/simple; bh=V5x5X2nHvvvZQCsSoOWemQ5m72sWuJ8qNxbbVbklroY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=REutB05lCeNVHFtrOG0qV6ZgLefVJgws/ccuccoCZzJgeP+Uo5g2rm27oQd1tZm1JlxPxaS4FPH+CYxz0tvHwo8aGY0aqjbrU5vCQEVIHQxh8oufNy9q1lDf4jmPiirKKi3wvmtOcqsQQ5uYe6WZ1v1Tebcvo/4bFJCVWqBs2gE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=eQqZmVKJ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AtU1WJDp; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="eQqZmVKJ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AtU1WJDp" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 978851D000D6; Wed, 9 Sep 2026 15:51:38 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 09 Sep 2026 15:51:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983498; x=1789069898; bh=Tny55NvM/7lMtt+PbOywShwYrqDkMtQcT8Jq6pCvGAE=; b= eQqZmVKJrFFoUUsnX0QaC4ZbVJ6b6TMVqOdHc6vGW927czX0cZ6THU+RcbZp9Koq NbemItWJ3LCmaHXgfajCZX/tWnf2gAemSliEOYg+BYi1us9CiQK4QGD8tlhEWUYQ DZ8aXBO13UCLrWb7GArhStUCXNVUVJs9jY1xyQa6RMwzBzeg88Cr/LQdm5SSedgK So+gRxxOfCLCj1tlwUaUsnlX+kbaHhKxJ/b6mH8cwtU4GHMZEapV8nsQ1yd7Cdt5 cEWocKtBoBD+3tzitPtDEFEJJmCOUPSbSj8KqkkJ/So210sWG7lNBu5N/5jRhB1b Fiuy/yWnBeNS7H5aopfrbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983498; x= 1789069898; bh=Tny55NvM/7lMtt+PbOywShwYrqDkMtQcT8Jq6pCvGAE=; b=A tU1WJDpsEBNoFYd11uPLANdZzUnF4QWLwvTMxSTxBSwUJgzKv+eqaHpzkAo3lEpf 86KBMr8qQM33aPkXd34r8nFC7uKK2R94ZY5MTTdKL4FFsHyOXYWDpjKkf0G7r2/+ vPv0MGcf7VI0XmsBZG2sDyHaTThEzq/CvppGk9xBcH6HrZanW/esA8LUPgqKipHG J0c1E1Vlw5KGuDltFu+ZdDi2vI/k8PYxn2P4htOGWgUQt0GtEtxKiratsQfPvVTG iJ4ygSHcyjNG+tZ1C52VqIGB9CLQrlY7OVToqur3Wwrfo2E9q0+Uec+ahqEuMR4n oEdUfqVORB8ZKvECdMSYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTErJXQT89xdNSpbfG162S52xmEnv9hkTSgvQMpTW0DT7OWpo1xulYU1WJr+H/t/6c YxU8mCV7tzNTPWCtrK+C0aefe9D+fIiG8Zwe3e5360Kmzo6PwgnF4zLkhYIqtiFcLHNz8k 8kG/AdTFqH4mn1i25MWHJD6Y7FW4VS4FnquBG5AbU1b3tpmwsfwuSnobwaN1Xelf708tGu KesOufeEfTmdIFrM5T122D4yfOMT2EDLVwpbyJSpx2lsVxxQ6YIaPR83tP7tJog5tFdC3x 3PPTA3Dgs+0xXrQrjzcZsH/7nbizYjypIVUt9+dLhSQqBsJNdG+VtoaGxFw6+6Yqq+AbbX YN7nioXxXtKm4B180V3G0w8CulK+WBz0AXXk75T0dDqzj5kzkKv+dSOxZOXJAEUm9QV/E6 F8GA1kWWdrAS6WV8gsnfQNY7zoN762HIkD/fE4xv67zZOAeHH+zLzQV6IJEI32ODSRfmmF fvZkKRHTt/P5tp138KNLG78kPrQAABSD50SJm+Zi4q272ur1cAUaFCmqA2iSVpetymZQqM zv3dnvXl1L3od0Ukk4nVRZqwGZ9f6ScHKrHsnxStK96CVlHyPjgrkgo9fLqZEiy2aFE74n CrxBpoU4jrBU/8ltvJL5NqbDDgb3/LB8mytT1X8whqsEV8+GVo0eYJyb7YiA X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:37 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:25 -0500 Subject: [PATCH net-next v7 3/6] selftests: net: refactor server state into struct thread_ctx Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-3-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10208; i=juanlu@fastmail.com; h=from:subject:message-id; bh=V5x5X2nHvvvZQCsSoOWemQ5m72sWuJ8qNxbbVbklroY=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxx57TUtNi4m23fP60c83TzfT3ssXvH/c/QFb7sS6 yMdZ/86dUxkYRDjYrAUU2TxeCnSojG1ovGuaoQgzBxWJpAh0iINDEDAwsCXm5hXaqRjpGeqbahn aKRjoGPMwMUpAFP9O52R4X6/6o3CnU9iNdMnaVjZXbl0b1+f66RJ5yR6Pxf9PBnNncHwz27nXY3 uze/NlF9+/nGCL9Vi8uEFswLivyXMS9ZdtOf4Vh4A X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 Move server-side state (io_uring ring, zcrx area, refill ring, receive tracking) from global variables into a local struct thread_ctx. This is a pure refactor with no behavior change: run_server still allocates a single context on the stack and runs single-threaded, using io_uring accept and recvzc as before. This prepares the ground for the multithread server support in the following commits, which spawns N worker threads each with their own struct thread_ctx. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: David Wei Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 156 +++++++++++-------= ---- 1 file changed, 80 insertions(+), 76 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/test= ing/selftests/drivers/net/hw/iou-zcrx.c index c6dbd0ad5368..9b62fd0703e6 100644 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c @@ -87,14 +87,18 @@ static unsigned int cfg_rx_buf_len; static bool cfg_dry_run; =20 static char *payload; -static void *area_ptr; -static void *ring_ptr; -static size_t ring_size; -static struct io_uring_zcrx_rq rq_ring; -static unsigned long area_token; -static int connfd; -static bool stop; -static size_t received; + +struct thread_ctx { + struct io_uring ring; + void *area_ptr; + void *ring_ptr; + size_t ring_size; + struct io_uring_zcrx_rq rq_ring; + unsigned long area_token; + int connfd; + bool stop; + size_t received; +}; =20 static unsigned long gettimeofday_ms(void) { @@ -138,7 +142,7 @@ static inline size_t get_refill_ring_size(unsigned int = rq_entries) return ALIGN_UP(size, page_size); } =20 -static void setup_zcrx(struct io_uring *ring) +static void setup_zcrx(struct thread_ctx *ctx) { unsigned int ifindex; unsigned int rq_entries =3D 4096; @@ -149,44 +153,44 @@ static void setup_zcrx(struct io_uring *ring) error(1, 0, "bad interface name: %s", cfg_ifname); =20 if (cfg_rx_buf_len && cfg_rx_buf_len !=3D page_size) { - area_ptr =3D mmap(NULL, - AREA_SIZE, - PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE | - MAP_HUGETLB | MAP_HUGE_2MB, - -1, - 0); - if (area_ptr =3D=3D MAP_FAILED) { + ctx->area_ptr =3D mmap(NULL, + AREA_SIZE, + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE | + MAP_HUGETLB | MAP_HUGE_2MB, + -1, + 0); + if (ctx->area_ptr =3D=3D MAP_FAILED) { printf("Can't allocate huge pages\n"); exit(SKIP_CODE); } } else { - area_ptr =3D mmap(NULL, - AREA_SIZE, - PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE, - 0, - 0); - if (area_ptr =3D=3D MAP_FAILED) + ctx->area_ptr =3D mmap(NULL, + AREA_SIZE, + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, + 0, + 0); + if (ctx->area_ptr =3D=3D MAP_FAILED) error(1, 0, "mmap(): zero copy area"); } =20 - ring_size =3D get_refill_ring_size(rq_entries); - ring_ptr =3D mmap(NULL, - ring_size, - PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE, - 0, - 0); + ctx->ring_size =3D get_refill_ring_size(rq_entries); + ctx->ring_ptr =3D mmap(NULL, + ctx->ring_size, + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, + 0, + 0); =20 struct io_uring_region_desc region_reg =3D { - .size =3D ring_size, - .user_addr =3D (__u64)(unsigned long)ring_ptr, + .size =3D ctx->ring_size, + .user_addr =3D (__u64)(unsigned long)ctx->ring_ptr, .flags =3D IORING_MEM_REGION_TYPE_USER, }; =20 struct io_uring_zcrx_area_reg area_reg =3D { - .addr =3D (__u64)(unsigned long)area_ptr, + .addr =3D (__u64)(unsigned long)ctx->area_ptr, .len =3D AREA_SIZE, .flags =3D 0, }; @@ -200,7 +204,7 @@ static void setup_zcrx(struct io_uring *ring) .rx_buf_len =3D cfg_rx_buf_len, }; =20 - ret =3D io_uring_register_ifq(ring, (void *)®); + ret =3D io_uring_register_ifq(&ctx->ring, (void *)®); if (cfg_rx_buf_len && (ret =3D=3D -EINVAL || ret =3D=3D -EOPNOTSUPP || ret =3D=3D -ERANGE)) { printf("Large chunks are not supported %i\n", ret); @@ -209,64 +213,64 @@ static void setup_zcrx(struct io_uring *ring) error(1, 0, "io_uring_register_ifq(): %d", ret); } =20 - rq_ring.khead =3D (unsigned int *)((char *)ring_ptr + reg.offsets.head); - rq_ring.ktail =3D (unsigned int *)((char *)ring_ptr + reg.offsets.tail); - rq_ring.rqes =3D (struct io_uring_zcrx_rqe *)((char *)ring_ptr + reg.offs= ets.rqes); - rq_ring.rq_tail =3D 0; - rq_ring.ring_entries =3D reg.rq_entries; + ctx->rq_ring.khead =3D (unsigned int *)((char *)ctx->ring_ptr + reg.offse= ts.head); + ctx->rq_ring.ktail =3D (unsigned int *)((char *)ctx->ring_ptr + reg.offse= ts.tail); + ctx->rq_ring.rqes =3D (struct io_uring_zcrx_rqe *)((char *)ctx->ring_ptr = + reg.offsets.rqes); + ctx->rq_ring.rq_tail =3D 0; + ctx->rq_ring.ring_entries =3D reg.rq_entries; =20 - area_token =3D area_reg.rq_area_token; + ctx->area_token =3D area_reg.rq_area_token; } =20 -static void add_accept(struct io_uring *ring, int sockfd) +static void add_accept(struct thread_ctx *ctx, int sockfd) { struct io_uring_sqe *sqe; =20 - sqe =3D io_uring_get_sqe(ring); + sqe =3D io_uring_get_sqe(&ctx->ring); =20 io_uring_prep_accept(sqe, sockfd, NULL, NULL, 0); sqe->user_data =3D 1; } =20 -static void add_recvzc(struct io_uring *ring, int sockfd) +static void add_recvzc(struct thread_ctx *ctx, int sockfd) { struct io_uring_sqe *sqe; =20 - sqe =3D io_uring_get_sqe(ring); + sqe =3D io_uring_get_sqe(&ctx->ring); =20 io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, 0, 0); sqe->ioprio |=3D IORING_RECV_MULTISHOT; sqe->user_data =3D 2; } =20 -static void add_recvzc_oneshot(struct io_uring *ring, int sockfd, size_t l= en) +static void add_recvzc_oneshot(struct thread_ctx *ctx, int sockfd, size_t = len) { struct io_uring_sqe *sqe; =20 - sqe =3D io_uring_get_sqe(ring); + sqe =3D io_uring_get_sqe(&ctx->ring); =20 io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, len, 0); sqe->ioprio |=3D IORING_RECV_MULTISHOT; sqe->user_data =3D 2; } =20 -static void process_accept(struct io_uring *ring, struct io_uring_cqe *cqe) +static void process_accept(struct thread_ctx *ctx, struct io_uring_cqe *cq= e) { if (cqe->res < 0) error(1, 0, "accept()"); - if (connfd) + if (ctx->connfd) error(1, 0, "Unexpected second connection"); =20 - connfd =3D cqe->res; + ctx->connfd =3D cqe->res; if (cfg_oneshot) - add_recvzc_oneshot(ring, connfd, page_size); + add_recvzc_oneshot(ctx, ctx->connfd, page_size); else - add_recvzc(ring, connfd); + add_recvzc(ctx, ctx->connfd); } =20 -static void process_recvzc(struct io_uring *ring, struct io_uring_cqe *cqe) +static void process_recvzc(struct thread_ctx *ctx, struct io_uring_cqe *cq= e) { - unsigned rq_mask =3D rq_ring.ring_entries - 1; + unsigned int rq_mask =3D ctx->rq_ring.ring_entries - 1; struct io_uring_zcrx_cqe *rcqe; struct io_uring_zcrx_rqe *rqe; uint64_t mask; @@ -275,7 +279,7 @@ static void process_recvzc(struct io_uring *ring, struc= t io_uring_cqe *cqe) int i; =20 if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && cfg_oneshot_recvs =3D=3D = 0) { - stop =3D true; + ctx->stop =3D true; return; } =20 @@ -284,56 +288,56 @@ static void process_recvzc(struct io_uring *ring, str= uct io_uring_cqe *cqe) =20 if (cfg_oneshot) { if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && cfg_oneshot_recvs) { - add_recvzc_oneshot(ring, connfd, page_size); + add_recvzc_oneshot(ctx, ctx->connfd, page_size); cfg_oneshot_recvs--; } } else if (!(cqe->flags & IORING_CQE_F_MORE)) { - add_recvzc(ring, connfd); + add_recvzc(ctx, ctx->connfd); } =20 rcqe =3D (struct io_uring_zcrx_cqe *)(cqe + 1); =20 n =3D cqe->res; mask =3D (1ULL << IORING_ZCRX_AREA_SHIFT) - 1; - data =3D (char *)area_ptr + (rcqe->off & mask); + data =3D (char *)ctx->area_ptr + (rcqe->off & mask); =20 for (i =3D 0; i < n; i++) { - if (*(data + i) !=3D payload[(received + i)]) + if (*(data + i) !=3D payload[(ctx->received + i)]) error(1, 0, "payload mismatch at %d", i); } - received +=3D n; + ctx->received +=3D n; =20 - rqe =3D &rq_ring.rqes[(rq_ring.rq_tail & rq_mask)]; - rqe->off =3D (rcqe->off & ~IORING_ZCRX_AREA_MASK) | area_token; + rqe =3D &ctx->rq_ring.rqes[(ctx->rq_ring.rq_tail & rq_mask)]; + rqe->off =3D (rcqe->off & ~IORING_ZCRX_AREA_MASK) | ctx->area_token; rqe->len =3D cqe->res; - io_uring_smp_store_release(rq_ring.ktail, ++rq_ring.rq_tail); + io_uring_smp_store_release(ctx->rq_ring.ktail, ++ctx->rq_ring.rq_tail); } =20 -static void server_loop(struct io_uring *ring) +static void server_loop(struct thread_ctx *ctx) { struct io_uring_cqe *cqe; unsigned int count =3D 0; unsigned int head; int i, ret; =20 - io_uring_submit_and_wait(ring, 1); + io_uring_submit_and_wait(&ctx->ring, 1); =20 - io_uring_for_each_cqe(ring, head, cqe) { + io_uring_for_each_cqe(&ctx->ring, head, cqe) { if (cqe->user_data =3D=3D 1) - process_accept(ring, cqe); + process_accept(ctx, cqe); else if (cqe->user_data =3D=3D 2) - process_recvzc(ring, cqe); + process_recvzc(ctx, cqe); else error(1, 0, "unknown cqe"); count++; } - io_uring_cq_advance(ring, count); + io_uring_cq_advance(&ctx->ring, count); } =20 static void run_server(void) { + struct thread_ctx ctx =3D {}; unsigned int flags =3D 0; - struct io_uring ring; int fd, enable, ret; uint64_t tstop; =20 @@ -356,22 +360,22 @@ static void run_server(void) flags |=3D IORING_SETUP_SUBMIT_ALL; flags |=3D IORING_SETUP_CQE32; =20 - io_uring_queue_init(512, &ring, flags); + io_uring_queue_init(512, &ctx.ring, flags); =20 - setup_zcrx(&ring); + setup_zcrx(&ctx); if (cfg_dry_run) return; =20 if (listen(fd, 1024) < 0) error(1, 0, "listen()"); =20 - add_accept(&ring, fd); + add_accept(&ctx, fd); =20 tstop =3D gettimeofday_ms() + 5000; - while (!stop && gettimeofday_ms() < tstop) - server_loop(&ring); + while (!ctx.stop && gettimeofday_ms() < tstop) + server_loop(&ctx); =20 - if (!stop) + if (!ctx.stop) error(1, 0, "test failed\n"); } =20 --=20 2.50.1 From nobody Fri Sep 25 18:24:29 2026 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFDE93CFF6A; Wed, 9 Sep 2026 19:51:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983504; cv=none; b=oELZ0jMzOVDadZLXZMnYWoBrOmsLQuFgEQLKWIgPgap629Wbmp1pIbFZHmZkk2FddPI+2H/qnaZWSxSwBom4PSmTMSAYXFb16vv+OLS8y7dp+neY+AjjP8ivOwrgyVFTEWE1kjfdo6dro0b7K5j3HGw3HZO8e6iMrA26mbW0mQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983504; c=relaxed/simple; bh=n5X3NrCeblxlM4cRe2Sh01teMU9r2Vw+FZMMsZ9rUJo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ka80EiIa1atoZB/wlbwa9WOL1Rw9YYy3kVdjM49HjXQNtsYzbrInG88jrEZ3xZ9iop3lPds+mxwuLeVzgze4VsblftNxmHoUApsRDYSCR4QghkiBY8+b1PQWHE6jq8Ed6Z7WGFeQPV1gjfexJ7metOcPvIgHEN0/W/3SGKMZR8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=SKdtBmsE; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gsm1NLd1; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="SKdtBmsE"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gsm1NLd1" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id D472C1D0005F; Wed, 9 Sep 2026 15:51:39 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 09 Sep 2026 15:51:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983499; x=1789069899; bh=uHN8MmMii1bFhhJmK5NBxpCQ2Ex26UEj9yicFGS6wx0=; b= SKdtBmsEY3YzQ8jVmKU7/OFPSjpyofOqY3QIz/Px6UVC5g5yKalKRto7bUHju6XQ 7Y0mUNIvUFoN0KZUm8yslw9VZGOWd3LkMjis7XOWlEAhYCJwRwLpN5XNcfQYlycE kPixRStnl/0kJMokB6yMR6rDb8lMUPXFhFMJlasbCS/AorM4nrU1yDtIypZ8LSgC VSc1c++XS91p6exgKHj128Z30tSZx+WxLDDJdteIbbk5uSidA38HmkqyEGZKhxJd yAz321DaJswNBMC/DmaSR6KxUkqssmUw+sQBdaT712FrSvKwheQa9j4KcCPZK/eQ adtKjXAWI0F6Qe25F2r1og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983499; x= 1789069899; bh=uHN8MmMii1bFhhJmK5NBxpCQ2Ex26UEj9yicFGS6wx0=; b=g sm1NLd1StgMOSSK9JCB8u1dggqMEFv7y//5ZJcMLY5wFEYha60qJmpjSZ5LKXrU/ pUUfB0+NblOW+xTPl7PnYMz5KPiO3XncX6zg5nOSSiHDcM2/U3V2JrCwAATJBlkQ O+WKylGYoOjHzg1tT1vaRNxGRu+3GYe0FDUbeWMZNzz9Ze1qaz3+uLBEKA8LANq4 veDnghDxx1mlIh56b+xiR8Up2GisbmFoOJSztdCcJfcweaxbVScitzPKV/y0x6Nj 2fi2MzxgNVbH4npObcJ5fKCVNVBpNsF5zpXxu3bGxrE32brVw8uCuLsfZfBqasTx EfHnvYI/cizIKAkWQczmA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEnhrolNfQ4AYw8TgLeB94Mda0JkhAUpDCtNqjs3dVrNQ1Y3y24lWMKgZmP8M95oP 2gJq/DMxnaGsu+6QjX7RRo3FHFhH6qoL0nA6qxBJ/BKeCqKtSa8UiT1st0s+WommnsIVhR zrryFxfOfOJ0iCZOrtpYmWbPt77+adxEoHzrpoW7jaVPoJlPv6OXuqYmf4qa4Y1qM+8fCm eYhl3u7jduesafENw0QWE6trJLZ5Zoi4rrkrILiuRWncZXKRmZFbqyobdaP73cf8kUgU+Q MkXKfM/U7z0W4xl9fkxpVSW9Mi2tlQIyMy71z6GBm7ROkMxBwnd0DjX6DU3w6BN8RSa0hd xtZURV5WjGsEJgHmiouJuYbPPHi/a7iQExxm9ZyzIIJRXZZczVfg38/BCIlLsqJeqr/3B/ wXBEooCHb4K6O4ARe3AhUYMZj7yP6kGrBu+VKdBozWT0Vgn+e3bvTb/TxbjqqabwQYzl42 dIG+6+Ekfqdr2wUmRNg81uUBcWU6e2XJ8IHZ/VVhJUwRM0nZQ7wl7xWj2TbbaH27wn1XXE JVcwd0pbWfU+Bt54f/ISKVnw64ownyeQ58Mv2h4gJIGW00T0xxzZvqe+TR+Y/jyAT3NBAh R8FfbjVtxjJ9xH/qAdVh6HKzxHMtMJ0EbQuKVxpa5No8fuv3PtQinqnApGNg X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:38 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:26 -0500 Subject: [PATCH net-next v7 4/6] selftests: net: add multithread client support to iou-zcrx Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-4-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3455; i=juanlu@fastmail.com; h=from:subject:message-id; bh=n5X3NrCeblxlM4cRe2Sh01teMU9r2Vw+FZMMsZ9rUJo=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxx5/f/Vztq6ntWpG7q6+Sazf/gY8P+YzrwzSjGyl j/fLjfi6ZjIwiDGxWAppsji8VKkRWNqReNd1QhBmDmsTCBDpEUaGICAhYEvNzGv1EjHSM9U21DP 0EjHQMeYgYtTAKb6Qxkjw+KVDc2NIl2WbdJnltfsWvlZv7X2p5bYlYlBS0qvxt5UfcPwT+8eZ9C 59fqOSxIbeeKqtgtss1QpWTtRN6WpPLVcqNKMBQA= X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 Add pthreads to the iou-zcrx client so that multiple connections can be established simultaneously. Each client thread connects to the server and sends its payload independently. Introduce the -t option to control the number of threads (default 1), preserving backwards compatibility with existing tests. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: David Wei Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/Makefile | 2 +- tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 35 +++++++++++++++++++= ++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testin= g/selftests/drivers/net/hw/Makefile index bd3b8d2fa47e..69be4d052ef5 100644 --- a/tools/testing/selftests/drivers/net/hw/Makefile +++ b/tools/testing/selftests/drivers/net/hw/Makefile @@ -97,5 +97,5 @@ include ../../../net/ynl.mk include ../../../net/bpf.mk =20 ifeq ($(HAS_IOURING_ZCRX),y) -$(OUTPUT)/iou-zcrx: LDLIBS +=3D -luring +$(OUTPUT)/iou-zcrx: LDLIBS +=3D -luring -lpthread endif diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/test= ing/selftests/drivers/net/hw/iou-zcrx.c index 9b62fd0703e6..f793a6c04e41 100644 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,7 @@ static int cfg_send_size =3D SEND_SIZE; static struct sockaddr_in6 cfg_addr; static unsigned int cfg_rx_buf_len; static bool cfg_dry_run; +static int cfg_num_threads =3D 1; =20 static char *payload; =20 @@ -379,7 +381,7 @@ static void run_server(void) error(1, 0, "test failed\n"); } =20 -static void run_client(void) +static void *client_worker(void *arg) { ssize_t to_send =3D cfg_send_size; ssize_t sent =3D 0; @@ -405,12 +407,36 @@ static void run_client(void) } =20 close(fd); + return NULL; +} + +static void run_client(void) +{ + int total_conns =3D cfg_num_threads * cfg_num_threads; + pthread_t *threads; + int i, ret; + + threads =3D calloc(total_conns, sizeof(*threads)); + if (!threads) + error(1, 0, "calloc()"); + + for (i =3D 0; i < total_conns; i++) { + ret =3D pthread_create(&threads[i], NULL, client_worker, NULL); + if (ret) + error(1, ret, "pthread_create()"); + } + + for (i =3D 0; i < total_conns; i++) + pthread_join(threads[i], NULL); + + free(threads); } =20 static void usage(const char *filepath) { error(1, 0, "Usage: %s (-4|-6) (-s|-c) -h -p " - "-l -i -q", filepath); + "-l -i -q -t", + filepath); } =20 static void parse_opts(int argc, char **argv) @@ -428,7 +454,7 @@ static void parse_opts(int argc, char **argv) usage(argv[0]); cfg_payload_len =3D max_payload_len; =20 - while ((c =3D getopt(argc, argv, "sch:p:l:i:q:o:z:x:d")) !=3D -1) { + while ((c =3D getopt(argc, argv, "sch:p:l:i:q:o:z:x:dt:")) !=3D -1) { switch (c) { case 's': if (cfg_client) @@ -469,6 +495,9 @@ static void parse_opts(int argc, char **argv) case 'd': cfg_dry_run =3D true; break; + case 't': + cfg_num_threads =3D strtoul(optarg, NULL, 0); + break; } } =20 --=20 2.50.1 From nobody Fri Sep 25 18:24:29 2026 Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DA023CBE74; Wed, 9 Sep 2026 19:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.152 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983505; cv=none; b=JDsf+88m2AMg6qznIcyFD8L+u27MBJeW5M9zlfGccc2Vu6Q/1qRxiP04hu4FEasreyL2BFL9BkiPEA5myIwG6PbJFtA83f83AT0AhLwjyTLYo+/XSHborzd3h32wtLaGUe8L3VOoxI+lG2GCKvkCrtu56tkwhdCM8Y2a5QofFok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983505; c=relaxed/simple; bh=TnGOTeHOpQnlOMbnZeMUyzEkwl71yr/clWBahcf36xk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CcrCpYQrl6JkM0xY3uEcVOqtAe7R1LLo8kNk4YeMRqV+tMgAWFiv3VaoqJPMzTRj8Ra/q9w3MQjE2UQZg7oLfiR7Ilk3QNCwHvll8Nm8hHjX7LwJhnroAAan6OXA0u236DefzqkOfqE+T4YQ6pGd0Dira9PSgu+WHobmwWLaiFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=awt0HPSw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Oo5YhAaL; arc=none smtp.client-ip=202.12.124.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="awt0HPSw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Oo5YhAaL" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 358C87A0071; Wed, 9 Sep 2026 15:51:41 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 09 Sep 2026 15:51:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983501; x=1789069901; bh=xzwIf4EWiDNrEYqQJEMyFEKaTAoeALpkRpyeCr/FZBs=; b= awt0HPSwJ785qJVgKxy8KourgSOqMK1be/6o3t1vhY4/4ZWD6JXmkqKLnNcBGkqs cBok1u8C0Z7SZv6Lhsg8zzdWxfJEYpiiiVSDYkPz+cXwEqr6bXmuX2nMJi31SoQM yllWybDUs+9WEMCoFSD0kuHBy30eTYBD9TH9Ui4gPWE51O4YrSgbw+NEu7OX3a+P UXjRAMFu+CfSzu5o2KddvcSGE3aqFBwavUr8pHGKN7Jyu4bEZ5AJADh8xVZrtE4+ Bj67dx4QiobiXh+w2NBKTuI+RE/gWYtxk7Uc+ZMwmgisVrMNHeKE0uBrpkhbiMQ1 GMKwzrf4BQRCV21cF6a9PQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983501; x= 1789069901; bh=xzwIf4EWiDNrEYqQJEMyFEKaTAoeALpkRpyeCr/FZBs=; b=O o5YhAaLNJv3OOLuCG7NMjDxvq/mnfq6B8L+Adetk7zIJ/QZvvw/yBcXjzHmyxRG7 u0ZwfDOjoLKkP36rXlR3DiJIbPjURhmcom5PYjM3y7JRdYXC8V4FVNWJMykvfv/S TKJnAR+r3IeQhfwrpSeLHutQfdMCV7PjrUn1JNpmWKzRpHOmR167i6KBk/JCYifv x1QSwvNRFzXZgLZGSUPofufHLXa3AQ0kvmvEVdH0Y2qkO/n+qsa/G/JF4g3nMv31 xAHQM12tB5UPSaf0B65o8Jvpk1kjvEPhYWuoYO8S6TDXAFZRvmDGV0Z/n9n5JLAs +/frrRMBDgcqoKPIe6Tfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEnhrolNfQ4AYw8TgLeB94Mda0JkhAUpDCtNqjs3dVrNQ1Y3y24lWMKgZmP8M95oP 2gJq/DMxnaGsu+6QjX7RRo3FHFhH6qoL0nA6qxBJ/BKeCqKtSa8UiT1st0s+WommnsIVhR zrryFxfOfOJ0iCZOrtpYmWbPt77+adxEoHzrpoW7jaVPoJlPv6OXuqYmf4qa4Y1qM+8fCm eYhl3u7jduesafENw0QWE6trJLZ5Zoi4rrkrILiuRWncZXKRmZFbqyobdaP73cf8kUgU+Q MkXKfM/U7z0W4xl9fkxpVSW9Mi2tlQIyMy71z6GBm7ROkMxBwnd0DjX6DU3w6BN8RSa0K7 jovXoWPLuKAGaRp8xVUci6UkQ85w3GH+Ral1izHPJsm1UOAoKxOD1xmIC+YBVPSJdOVQqX iRAfnAAfoj+BxDNRvTILQlrS5BZQYu/FKgaSLLRGGnU69Dn3G8sWLBv8UoAOn7KBVCfkao WQ3k03UQHvXbpbWaXZ8G3NTdW+3W5k3Pub22u+7y2+tjEYTFnTC5asu58vuG/189eo6Grl seKYqn6LIn22m75+kw+Sk6OC1A5/32Yj1mCOQ3mY8HUZfMn6UVQlN/8aTyRv9HNXMqw/JW Y1+ArUBCXAbRxhB4DdfIsJ/POh5ZR9IvkiPPKZXxZ8c7EXYGzjGSp2w8znCA X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:40 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:27 -0500 Subject: [PATCH net-next v7 5/6] selftests: net: add multithread server support to iou-zcrx Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-5-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=12887; i=juanlu@fastmail.com; h=from:subject:message-id; bh=TnGOTeHOpQnlOMbnZeMUyzEkwl71yr/clWBahcf36xk=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxz1Clj778B19yZpNrU7KmnHey7bazgyPjas0+At5 LDjS3neMZGFQYyLwVJMkcXjpUiLxtSKxruqEYIwc1iZQIZIizQwAAELA19uYl6pkY6Rnqm2oZ6h kY6BjjEDF6cATPUkToa/gjPXTXo+P2y9vfxWzin9SaL/9nr8i/d6WDXBv3KzytWPhgz/cw+wr4t JepF3bE3Hdc1/eh7LWmMOq8yXO7hsomVj875EbgA= X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 Run the iou-zcrx server as N worker threads, each owning one receive queue with its own io_uring and zero-copy receive (zcrx) ifq, so the test can exercise multi-queue zero-copy receive. The main thread owns the listening socket, accepts connections, and dispatches each to the worker owning the queue it landed on by matching SO_INCOMING_NAPI_ID against per-queue NAPI IDs. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/Makefile | 5 +- tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 278 ++++++++++++++++--= ---- 2 files changed, 210 insertions(+), 73 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testin= g/selftests/drivers/net/hw/Makefile index 69be4d052ef5..8aebdc6feb17 100644 --- a/tools/testing/selftests/drivers/net/hw/Makefile +++ b/tools/testing/selftests/drivers/net/hw/Makefile @@ -18,10 +18,6 @@ else $(warning excluding iouring tests, liburing not installed or too old) endif =20 -TEST_GEN_FILES :=3D \ - $(COND_GEN_FILES) \ -# end of TEST_GEN_FILES - TEST_PROGS =3D \ csum.py \ devlink_rate_cross_esw.py \ @@ -80,6 +76,7 @@ TEST_INCLUDES :=3D \ YNL_GEN_FILES :=3D \ ncdevmem \ toeplitz \ + $(COND_GEN_FILES) \ # end of YNL_GEN_FILES TEST_GEN_FILES +=3D $(YNL_GEN_FILES) TEST_GEN_FILES +=3D $(patsubst %.c,%.o,$(wildcard *.bpf.c)) diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/test= ing/selftests/drivers/net/hw/iou-zcrx.c index f793a6c04e41..91b025a8771e 100644 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c @@ -38,6 +38,8 @@ #include =20 #include +#include +#include "netdev-user.h" =20 #define SKIP_CODE 42 =20 @@ -90,6 +92,8 @@ static int cfg_num_threads =3D 1; =20 static char *payload; =20 +#define MAX_CONNS_PER_THREAD 64 + struct thread_ctx { struct io_uring ring; void *area_ptr; @@ -97,9 +101,15 @@ struct thread_ctx { size_t ring_size; struct io_uring_zcrx_rq rq_ring; unsigned long area_token; - int connfd; - bool stop; - size_t received; + int queue_id; + int napi_id; + pthread_barrier_t *setup_done; + pthread_barrier_t *dispatch_done; + + int connfds[MAX_CONNS_PER_THREAD]; + size_t received[MAX_CONNS_PER_THREAD]; + int oneshot_recvs[MAX_CONNS_PER_THREAD]; + int nr_conns; }; =20 static unsigned long gettimeofday_ms(void) @@ -146,8 +156,8 @@ static inline size_t get_refill_ring_size(unsigned int = rq_entries) =20 static void setup_zcrx(struct thread_ctx *ctx) { + unsigned int rq_entries =3D AREA_SIZE / page_size; unsigned int ifindex; - unsigned int rq_entries =3D 4096; int ret; =20 ifindex =3D if_nametoindex(cfg_ifname); @@ -199,7 +209,7 @@ static void setup_zcrx(struct thread_ctx *ctx) =20 struct t_io_uring_zcrx_ifq_reg reg =3D { .if_idx =3D ifindex, - .if_rxq =3D cfg_queue_id, + .if_rxq =3D ctx->queue_id, .rq_entries =3D rq_entries, .area_ptr =3D (__u64)(unsigned long)&area_reg, .region_ptr =3D (__u64)(unsigned long)®ion_reg, @@ -224,53 +234,32 @@ static void setup_zcrx(struct thread_ctx *ctx) ctx->area_token =3D area_reg.rq_area_token; } =20 -static void add_accept(struct thread_ctx *ctx, int sockfd) +static void add_recvzc(struct thread_ctx *ctx, int conn_idx) { struct io_uring_sqe *sqe; =20 sqe =3D io_uring_get_sqe(&ctx->ring); =20 - io_uring_prep_accept(sqe, sockfd, NULL, NULL, 0); - sqe->user_data =3D 1; -} - -static void add_recvzc(struct thread_ctx *ctx, int sockfd) -{ - struct io_uring_sqe *sqe; - - sqe =3D io_uring_get_sqe(&ctx->ring); - - io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, 0, 0); + io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, ctx->connfds[conn_idx], + NULL, 0, 0); sqe->ioprio |=3D IORING_RECV_MULTISHOT; - sqe->user_data =3D 2; + sqe->user_data =3D conn_idx; } =20 -static void add_recvzc_oneshot(struct thread_ctx *ctx, int sockfd, size_t = len) +static void add_recvzc_oneshot(struct thread_ctx *ctx, int conn_idx, size_= t len) { struct io_uring_sqe *sqe; =20 sqe =3D io_uring_get_sqe(&ctx->ring); =20 - io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, sockfd, NULL, len, 0); + io_uring_prep_rw(IORING_OP_RECV_ZC, sqe, ctx->connfds[conn_idx], + NULL, len, 0); sqe->ioprio |=3D IORING_RECV_MULTISHOT; - sqe->user_data =3D 2; + sqe->user_data =3D conn_idx; } =20 -static void process_accept(struct thread_ctx *ctx, struct io_uring_cqe *cq= e) -{ - if (cqe->res < 0) - error(1, 0, "accept()"); - if (ctx->connfd) - error(1, 0, "Unexpected second connection"); - - ctx->connfd =3D cqe->res; - if (cfg_oneshot) - add_recvzc_oneshot(ctx, ctx->connfd, page_size); - else - add_recvzc(ctx, ctx->connfd); -} - -static void process_recvzc(struct thread_ctx *ctx, struct io_uring_cqe *cq= e) +static void process_recvzc(struct thread_ctx *ctx, struct io_uring_cqe *cq= e, + int conn_idx) { unsigned int rq_mask =3D ctx->rq_ring.ring_entries - 1; struct io_uring_zcrx_cqe *rcqe; @@ -280,8 +269,9 @@ static void process_recvzc(struct thread_ctx *ctx, stru= ct io_uring_cqe *cqe) ssize_t n; int i; =20 - if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && cfg_oneshot_recvs =3D=3D = 0) { - ctx->stop =3D true; + if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && + ctx->oneshot_recvs[conn_idx] =3D=3D 0) { + ctx->nr_conns--; return; } =20 @@ -289,12 +279,14 @@ static void process_recvzc(struct thread_ctx *ctx, st= ruct io_uring_cqe *cqe) error(1, 0, "recvzc(): %d", cqe->res); =20 if (cfg_oneshot) { - if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && cfg_oneshot_recvs) { - add_recvzc_oneshot(ctx, ctx->connfd, page_size); - cfg_oneshot_recvs--; + if (cqe->res =3D=3D 0 && cqe->flags =3D=3D 0 && + ctx->oneshot_recvs[conn_idx]) { + add_recvzc_oneshot(ctx, conn_idx, page_size); + ctx->oneshot_recvs[conn_idx]--; + return; } } else if (!(cqe->flags & IORING_CQE_F_MORE)) { - add_recvzc(ctx, ctx->connfd); + add_recvzc(ctx, conn_idx); } =20 rcqe =3D (struct io_uring_zcrx_cqe *)(cqe + 1); @@ -304,10 +296,10 @@ static void process_recvzc(struct thread_ctx *ctx, st= ruct io_uring_cqe *cqe) data =3D (char *)ctx->area_ptr + (rcqe->off & mask); =20 for (i =3D 0; i < n; i++) { - if (*(data + i) !=3D payload[(ctx->received + i)]) + if (*(data + i) !=3D payload[(ctx->received[conn_idx] + i)]) error(1, 0, "payload mismatch at %d", i); } - ctx->received +=3D n; + ctx->received[conn_idx] +=3D n; =20 rqe =3D &ctx->rq_ring.rqes[(ctx->rq_ring.rq_tail & rq_mask)]; rqe->off =3D (rcqe->off & ~IORING_ZCRX_AREA_MASK) | ctx->area_token; @@ -320,28 +312,137 @@ static void server_loop(struct thread_ctx *ctx) struct io_uring_cqe *cqe; unsigned int count =3D 0; unsigned int head; - int i, ret; =20 io_uring_submit_and_wait(&ctx->ring, 1); =20 io_uring_for_each_cqe(&ctx->ring, head, cqe) { - if (cqe->user_data =3D=3D 1) - process_accept(ctx, cqe); - else if (cqe->user_data =3D=3D 2) - process_recvzc(ctx, cqe); - else - error(1, 0, "unknown cqe"); + process_recvzc(ctx, cqe, cqe->user_data); count++; } io_uring_cq_advance(&ctx->ring, count); } =20 -static void run_server(void) +static void *server_worker(void *arg) { - struct thread_ctx ctx =3D {}; - unsigned int flags =3D 0; - int fd, enable, ret; + struct io_uring_params params =3D { }; + struct thread_ctx *ctx =3D arg; uint64_t tstop; + int nr_conns; + int i; + + params.flags |=3D IORING_SETUP_COOP_TASKRUN; + params.flags |=3D IORING_SETUP_SINGLE_ISSUER; + params.flags |=3D IORING_SETUP_DEFER_TASKRUN; + params.flags |=3D IORING_SETUP_SUBMIT_ALL; + params.flags |=3D IORING_SETUP_CQE32; + params.flags |=3D IORING_SETUP_CQSIZE; + params.cq_entries =3D AREA_SIZE / page_size; + + io_uring_queue_init_params(512, &ctx->ring, ¶ms); + setup_zcrx(ctx); + + if (cfg_dry_run) + return NULL; + + pthread_barrier_wait(ctx->setup_done); + pthread_barrier_wait(ctx->dispatch_done); + + nr_conns =3D ctx->nr_conns; + + for (i =3D 0; i < ctx->nr_conns; i++) { + if (cfg_oneshot) { + ctx->oneshot_recvs[i] =3D cfg_oneshot_recvs; + add_recvzc_oneshot(ctx, i, page_size); + } else { + add_recvzc(ctx, i); + } + } + + tstop =3D gettimeofday_ms() + 5000; + while (ctx->nr_conns > 0 && gettimeofday_ms() < tstop) + server_loop(ctx); + + if (ctx->nr_conns !=3D 0) + error(1, 0, "test failed: %d connections incomplete", + ctx->nr_conns); + + for (i =3D 0; i < nr_conns; i++) { + if (cfg_oneshot) { + if (!ctx->received[i]) + error(1, 0, "connection %d received no data", i); + } else if (ctx->received[i] !=3D (size_t)cfg_send_size) { + error(1, 0, "connection %d received %zu of %d bytes", + i, ctx->received[i], cfg_send_size); + } + } + + return NULL; +} + +static int query_napi_id(unsigned int ifindex, int queue_id) +{ + struct netdev_queue_get_req *req; + struct netdev_queue_get_rsp *rsp; + struct ynl_error yerr; + struct ynl_sock *ys; + int napi_id; + + ys =3D ynl_sock_create(&ynl_netdev_family, &yerr); + if (!ys) + error(1, 0, "ynl_sock_create: %s", yerr.msg); + + req =3D netdev_queue_get_req_alloc(); + netdev_queue_get_req_set_ifindex(req, ifindex); + netdev_queue_get_req_set_type(req, NETDEV_QUEUE_TYPE_RX); + netdev_queue_get_req_set_id(req, queue_id); + + rsp =3D netdev_queue_get(ys, req); + if (!rsp) + error(1, 0, "netdev_queue_get(q=3D%d): %s", queue_id, + ys->err.msg); + if (!rsp->_present.napi_id) + error(1, 0, "netdev_queue_get(q=3D%d): napi_id not present", + queue_id); + + napi_id =3D rsp->napi_id; + + netdev_queue_get_req_free(req); + netdev_queue_get_rsp_free(rsp); + ynl_sock_destroy(ys); + + return napi_id; +} + +static int find_thread_by_conn(struct thread_ctx *ctxs, int connfd) +{ + socklen_t len =3D sizeof(int); + int napi_id, i; + + if (getsockopt(connfd, SOL_SOCKET, SO_INCOMING_NAPI_ID, &napi_id, &len)) + error(1, errno, "getsockopt(SO_INCOMING_NAPI_ID)"); + + for (i =3D 0; i < cfg_num_threads; i++) { + if (ctxs[i].napi_id =3D=3D napi_id) + return i; + } + + error(1, 0, "unknown NAPI ID: %d", napi_id); + return -1; +} + +static void run_server(void) +{ + pthread_barrier_t setup_done, dispatch_done; + int total_conns, accepted =3D 0, connfd; + struct thread_ctx *ctxs; + int fd, ret, enable, i; + unsigned int ifindex; + pthread_t *threads; + + ctxs =3D calloc(cfg_num_threads, sizeof(*ctxs)); + threads =3D calloc(cfg_num_threads, sizeof(*threads)); + if (!ctxs || !threads) + error(1, 0, "calloc()"); =20 fd =3D socket(AF_INET6, SOCK_STREAM, 0); if (fd =3D=3D -1) @@ -356,29 +457,68 @@ static void run_server(void) if (ret < 0) error(1, 0, "bind()"); =20 - flags |=3D IORING_SETUP_COOP_TASKRUN; - flags |=3D IORING_SETUP_SINGLE_ISSUER; - flags |=3D IORING_SETUP_DEFER_TASKRUN; - flags |=3D IORING_SETUP_SUBMIT_ALL; - flags |=3D IORING_SETUP_CQE32; + pthread_barrier_init(&setup_done, NULL, cfg_num_threads + 1); + pthread_barrier_init(&dispatch_done, NULL, cfg_num_threads + 1); =20 - io_uring_queue_init(512, &ctx.ring, flags); + for (i =3D 0; i < cfg_num_threads; i++) { + ctxs[i].queue_id =3D cfg_queue_id + i; + ctxs[i].setup_done =3D &setup_done; + ctxs[i].dispatch_done =3D &dispatch_done; + } + + for (i =3D 0; i < cfg_num_threads; i++) { + ret =3D pthread_create(&threads[i], NULL, + server_worker, &ctxs[i]); + if (ret) + error(1, ret, "pthread_create()"); + } =20 - setup_zcrx(&ctx); if (cfg_dry_run) - return; + goto join; + + pthread_barrier_wait(&setup_done); =20 if (listen(fd, 1024) < 0) error(1, 0, "listen()"); =20 - add_accept(&ctx, fd); + if (cfg_num_threads > 1) { + ifindex =3D if_nametoindex(cfg_ifname); + if (!ifindex) + error(1, 0, "bad interface name: %s", cfg_ifname); + for (i =3D 0; i < cfg_num_threads; i++) + ctxs[i].napi_id =3D query_napi_id(ifindex, + ctxs[i].queue_id); + } =20 - tstop =3D gettimeofday_ms() + 5000; - while (!ctx.stop && gettimeofday_ms() < tstop) - server_loop(&ctx); + total_conns =3D cfg_num_threads * cfg_num_threads; + + while (accepted < total_conns) { + int idx =3D 0; + + connfd =3D accept(fd, NULL, NULL); + if (connfd < 0) + error(1, errno, "accept()"); =20 - if (!ctx.stop) - error(1, 0, "test failed\n"); + if (cfg_num_threads > 1) + idx =3D find_thread_by_conn(ctxs, connfd); + + if (ctxs[idx].nr_conns >=3D MAX_CONNS_PER_THREAD) + error(1, 0, "worker %d connection overflow", idx); + ctxs[idx].connfds[ctxs[idx].nr_conns++] =3D connfd; + accepted++; + } + + pthread_barrier_wait(&dispatch_done); + +join: + for (i =3D 0; i < cfg_num_threads; i++) + pthread_join(threads[i], NULL); + + pthread_barrier_destroy(&setup_done); + pthread_barrier_destroy(&dispatch_done); + close(fd); + free(threads); + free(ctxs); } =20 static void *client_worker(void *arg) --=20 2.50.1 From nobody Fri Sep 25 18:24:29 2026 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E63633D3D18; Wed, 9 Sep 2026 19:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983506; cv=none; b=FjiMNHU6rbRbB7BD/4YEEnDcVzyxZMbCVD9RlbdcQRpskPIcCQYAIJqsQvWxeMCzHaGJw+VEzIxc1PQgPfNpTPh/E+l55b7f1TqXupHDpjJQA2hEuvnLzvXBIl9jQYudz7iIo6xp3D2RnWRzstzlNCH77iBiAtS7JO8popL73Lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788983506; c=relaxed/simple; bh=bb5BYgKa09OW6lhhuFRqBlw0NXbM/PKnsSXjhp92tdg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HHA1u1R45oLv2Tg171QWC/092oUpfL/svBk4LG5mLjF4M501Q1nUHB7mNivdFUHYPSDW+9+0LQS9wgpM8Sr4Ghktzllocs5lhIqVSQni2t/TWZ+d1pU8dByNfxt2fMuqBudrDtnuxhElqmV2HtAqKoikbCuCBJJ5hDoqKj0J+Ug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=iKkzZ0GA; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VCUdXAc5; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="iKkzZ0GA"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VCUdXAc5" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 8418D1D00067; Wed, 9 Sep 2026 15:51:42 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 09 Sep 2026 15:51:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1788983502; x=1789069902; bh=zoVUj5F+8FVqGG22Q1uCXrQ58eGyDtPNSPzvgjqr55k=; b= iKkzZ0GAa0tVpMJLSOh2lOPXkLWsxrh9U2OTl1ZMajYtCfbsgJrXtRs6zjDS0ZoN 7z5ESUatQacKIHQDngIe9sOlInIwpiCQiesR/2hnEN5rAkVh1PGEFPWxnjQTu5Ah sRgVTXWbtqh3WuLDcSoMiiorPg8Wh19sLIq5PJTqarzTdVX7RGl8O8XvEAg1uuXX DcKcdhV9OlOpgFuEMdqaChlIRXJI0dLBj41fsIqxyoibNQibMgQWPfEJrJIti9xu vAKd1FpIa6wC0AxbXzMbPF1FLAX4q5laDy1G1sbl8AEgn5YASaRssx6+VYhUreNT BpcZlFnr6FDh93dkn6JR+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788983502; x= 1789069902; bh=zoVUj5F+8FVqGG22Q1uCXrQ58eGyDtPNSPzvgjqr55k=; b=V CUdXAc5+khVbRGY1tm6UYOBJwBgGaRGM7QxpkVBV1sdXkVTLahHtGJGZ/Qmi2C1s H3wUWl1Se5qlu7NrUw2/jkFiudcHaEslxcZS8q7f/ML37mLUGPNRqS63s0JZV46O Qs9vMKKG+iz8+Rncn8L4+1Ywl869zl4Qb4cyARJzGuc20+sRfa2VYjzOxr095Ki0 XXrJ+TZBW7fHgvyELdPAXB/H+bhW7F3LwmMBwU4H7/PZPVujzXnPkbevK7HK3nRm HBy/8sseMuEpMiEfghz3TEo+KEAiDNfxHkAg+fPjP3Y5LYdI8krZaaegtCdoxJCd ePWoRmX7v99xEA2dXk46g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTErJXQT89xdNSpbfG162S52xmEnv9hkTSgvQMpTW0DT7OWpo1xulYU1WJr+H/t/6c YxU8mCV7tzNTPWCtrK+C0aefe9D+fIiG8Zwe3e5360Kmzo6PwgnF4zLkhYIqtiFcLHNz8k 8kG/AdTFqH4mn1i25MWHJD6Y7FW4VS4FnquBG5AbU1b3tpmwsfwuSnobwaN1Xelf708tGu KesOufeEfTmdIFrM5T122D4yfOMT2EDLVwpbyJSpx2lsVxxQ6YIaPR83tP7tJog5tFdC3x 3PPTA3Dgs+0xXrQrjzcZsH/7nbizYjypIVUt9+dLhSQqBsJNdG+VtoaGxFw6+6Yqq+Abit T7QBif/3DwoCkHLfp8iQFZzwHyixolWPR9ssTSv60r72xXIvGY1KF0jZ5A5UST654bSvYf zknMdCeL8/rsARrlz631r4oTVDutf9kvWSjxR3GYXJEW/yuQ1FRBwYUBTc/SDs3ByKt5YW lNxrGbrjtY81iSjb6e4Mpq0wAyQY3TFsRjmX8PZZy0fxXZoXkhDSXMvPJNsrd88Q9897qa yW5ihAsgCsI2pli9iVSnnkVvWuhG+rwQw/SDpK7dkpvA5XjrYQHZCfTmxyLRlPqpE7+8ZX uv1GJ6pHixu5VYXnddqI0FVGeyBGkxQ/jYdB3EDsTbzMaUUJl4JARkPhngDw X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 15:51:41 -0400 (EDT) From: Juanlu Herrero Date: Wed, 09 Sep 2026 14:51:28 -0500 Subject: [PATCH net-next v7 6/6] selftests: net: add rss_multiqueue test variant to iou-zcrx Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260909-iou-zcrx-v7-6-6b5d48a2a922@fastmail.com> References: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> In-Reply-To: <20260909-iou-zcrx-v7-0-6b5d48a2a922@fastmail.com> To: dw@davidwei.uk, netdev@vger.kernel.org Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org, juanlu@fastmail.com X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3662; i=juanlu@fastmail.com; h=from:subject:message-id; bh=bb5BYgKa09OW6lhhuFRqBlw0NXbM/PKnsSXjhp92tdg=; b=owGbwMvMwCWW/91SPSt7w03G02pJDFkLdxx9oXFTMcwwr7cl9K1X3hIDtc89t/1UTrAn2ybtX X7z5csXHRNZGMS4GCzFFFk8Xoq0aEytaLyrGiEIM4eVCWSItEgDAxCwMPDlJuaVGukY6ZlqG+oZ GukY6BgzcHEKwFRL1TAyLH3RE96s6iDLuUyvcLrBX+UZD6N/ri3jt1p4tn/Z6ZY5powMWz6cbzw muPPF4gkhatcWyjMYt3zud81eZLJu09IV4u22TAA= X-Developer-Key: i=juanlu@fastmail.com; a=openpgp; fpr=48E9148428957881DD2558116FF739276A6BB0D9 Add a rss_multiqueue Python test variant that exercises multi-queue zero-copy receive on a single listening socket. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: David Wei Signed-off-by: Juanlu Herrero --- tools/testing/selftests/drivers/net/hw/iou-zcrx.py | 50 ++++++++++++++++++= +++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py b/tools/tes= ting/selftests/drivers/net/hw/iou-zcrx.py index b7a225fe4bea..c833535d8a03 100755 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py @@ -30,6 +30,13 @@ def create_rss_ctx(cfg): return int(values) =20 =20 +def create_rss_ctx_multi(cfg, start, count): + """Create an RSS context spanning count queues from start, return its = ID.""" + output =3D ethtool(f"-X {cfg.ifname} context new start {start} equal {= count}").stdout + values =3D re.search(r'New RSS context is (\d+)', output).group(1) + return int(values) + + def set_flow_rule(cfg): output =3D ethtool(f"-N {cfg.ifname} flow-type tcp6 dst-port {cfg.port= } action {cfg.target}").stdout values =3D re.search(r'ID (\d+)', output).group(1) @@ -127,17 +134,56 @@ def _require_ntuple(cfg): defer(ethtool, f"-K {cfg.ifname} ntuple-filters off") =20 =20 +def rss_multiqueue(cfg): + """Steer the test flow to a multi-queue RSS context for multi-thread z= crx.""" + channels =3D cfg.ethnl.channels_get({'header': {'dev-index': cfg.ifind= ex}}) + channels =3D channels['combined-count'] + if channels < 3: + raise KsftSkipEx('Test requires NETIF with at least 3 combined cha= nnels') + + rings =3D cfg.ethnl.rings_get({'header': {'dev-index': cfg.ifindex}}) + rx_rings =3D rings['rx'] + hds_thresh =3D rings.get('hds-thresh', 0) + + cfg.ethnl.rings_set({'header': {'dev-index': cfg.ifindex}, + 'tcp-data-split': 'enabled', + 'hds-thresh': 0, + 'rx': 64}) + defer(cfg.ethnl.rings_set, {'header': {'dev-index': cfg.ifindex}, + 'tcp-data-split': 'unknown', + 'hds-thresh': hds_thresh, + 'rx': rx_rings}) + defer(mp_clear_wait, cfg) + + cfg.num_threads =3D 2 + cfg.target =3D channels - cfg.num_threads + ethtool(f"-X {cfg.ifname} equal {cfg.target}") + defer(ethtool, f"-X {cfg.ifname} default") + + rss_ctx_id =3D create_rss_ctx_multi(cfg, cfg.target, cfg.num_threads) + defer(ethtool, f"-X {cfg.ifname} delete context {rss_ctx_id}") + + flow_rule_id =3D set_flow_rule_rss(cfg, rss_ctx_id) + defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}") + + @ksft_variants([ KsftNamedVariant("single", single), KsftNamedVariant("rss", rss), + KsftNamedVariant("rss_multiqueue", rss_multiqueue), ]) def test_zcrx(cfg, setup) -> None: cfg.require_ipver('6') _require_ntuple(cfg) =20 + cfg.num_threads =3D 1 + setup(cfg) - rx_cmd =3D f"{cfg.bin_local} -s -p {cfg.port} -i {cfg.ifname} -q {cfg.= target}" - tx_cmd =3D f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {cfg.port} -l= 12840" + + rx_cmd =3D (f"{cfg.bin_local} -s -p {cfg.port} -i {cfg.ifname} " + f"-q {cfg.target} -t {cfg.num_threads}") + tx_cmd =3D (f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {cfg.port} " + f"-l 12840 -t {cfg.num_threads}") with bkg(rx_cmd, exit_wait=3DTrue): wait_port_listen(cfg.port, proto=3D"tcp") cmd(tx_cmd, host=3Dcfg.remote) --=20 2.50.1