From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-a3-smtp.messagingengine.com (flow-a3-smtp.messagingengine.com [103.168.172.138]) (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 9CDC347427C for ; Tue, 4 Aug 2026 16:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785860942; cv=none; b=UdzrrbtYm6SYZmHWRTLMEZirnE4+qiCqqK8jrkueaKwWdcinnayIAsyIXk5OdU46S6MkP1ci5C/t6hYUEWa0GY/JSjizxsP+ER7UjOh5hTtksxtZ0e6rwjcQ5bz0KWGhlTobtS5y5sxJ0TEEZNbFR5CefkBfLfYZReRIaluTfI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785860942; c=relaxed/simple; bh=+27Vj7ECPpTn/COujroRuTfhnd0Q1dG7F8MYQFfM3+k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YABZ+m/VwF5q4HIPRJfkMgwb5xfVp5zA4AYS5XVpVjejqLecAqDJahDyENLps7xn/B5+AMwo43x2BvcDlUJNIALWxFB4MsSRZOvpElQ0dSqe5Oy9ynaGWODpG+GGegikfPjVkeMqkjkzVEReDw/5RRg9uTl7Ql/ASpJ09/siUNY= 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=cO4RLz5u; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OlloxurV; arc=none smtp.client-ip=103.168.172.138 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="cO4RLz5u"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OlloxurV" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailflow.phl.internal (Postfix) with ESMTP id 90E001380372; Tue, 4 Aug 2026 12:28:59 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 04 Aug 2026 12:28:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc: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=fm3; t=1785860939; x=1785868139; bh=vGQ9aTJvph JrV6ZBYhomn2DAFIInsouYHFNO8U7YiAY=; b=cO4RLz5u3cPKiuzPerNSvoIjWl i9UTGWvR61D+PU+T7PzhWWtbLSgVI4XTmmr/R7CC46ZNKjJ41uJwNEhImIiACDPL 5Rgcwh6mjMvOiu3MRphyA64gGbALSzu6gyM1bq+sasuqPKpm1cukYcJZWx3VDsMR Dg3maZ1eExs4TpNAvCoaEoz5WGJXNKMHgpcyWeSGHNuekoQAtg/E38xnds4KJGB9 75dWl2sJPWXvrtza71j1st9BCnrcYY8TuNA+X2qO7pQ2XBueGt/TN+FecOYzmhbu ED4PHPux+L3g/3WN5e/vTlDWiWVK3R0ayrCMbNqh2vmoo8w17Izd2hboPcGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm3; t= 1785860939; x=1785868139; bh=vGQ9aTJvphJrV6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rZLRvBjHyx26hP33+5/DuqdA X-ME-Proxy: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Aug 2026 12:28:59 -0400 (EDT) Date: Tue, 4 Aug 2026 11:28:58 -0500 From: Juanlu Herrero To: David Wei Cc: netdev@vger.kernel.org, Jakub Kicinski , Pavel Begunkov Subject: Re: [PATCH net-next v4 4/6] selftests: net: add multithread client support to iou-zcrx Message-ID: References: <20260729221825.42773-1-juanlu@fastmail.com> <20260729221825.42773-5-juanlu@fastmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Aug 04, 2026 at 08:47:33AM -0600, David Wei wrote: > On 2026-07-29 15:18, Juanlu Herrero wrote: > > 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 > > Signed-off-by: Juanlu Herrero > > --- > > .../testing/selftests/drivers/net/hw/Makefile | 2 +- > > .../selftests/drivers/net/hw/iou-zcrx.c | 38 +++++++++++++++++-- > > 2 files changed, 36 insertions(+), 4 deletions(-) > > > > diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile > > index 234db5c2c90cc..3cab3b4adbb2e 100644 > > --- a/tools/testing/selftests/drivers/net/hw/Makefile > > +++ b/tools/testing/selftests/drivers/net/hw/Makefile > > @@ -88,5 +88,5 @@ include ../../../net/ynl.mk > > include ../../../net/bpf.mk > > ifeq ($(HAS_IOURING_ZCRX),y) > > -$(OUTPUT)/iou-zcrx: LDLIBS += -luring > > +$(OUTPUT)/iou-zcrx: LDLIBS += -luring -lpthread > > endif > > diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c > > index 9b62fd0703e61..7bc61f3b70ca6 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,9 +86,12 @@ static int cfg_send_size = 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 = 1; > > static char *payload; > > +#define CONNS_PER_THREAD 4 > > + > > struct thread_ctx { > > struct io_uring ring; > > void *area_ptr; > > @@ -379,7 +383,7 @@ static void run_server(void) > > error(1, 0, "test failed\n"); > > } > > -static void run_client(void) > > +static void *client_worker(void *arg) > > { > > ssize_t to_send = cfg_send_size; > > ssize_t sent = 0; > > @@ -405,12 +409,37 @@ static void run_client(void) > > } > > close(fd); > > + return NULL; > > +} > > + > > +static void run_client(void) > > +{ > > + int conns_per_thread = cfg_num_threads > 1 ? CONNS_PER_THREAD : 1; > > Make cfg_num_threads the default value you want, then you can remove > CONNS_PER_THREAD and this ternary. seems cleaner, I will fix that in v5 and thanks for the review. Best, Juanlu