From nobody Tue Aug 25 14:35:34 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 3F95B3E63AC; Fri, 14 Aug 2026 07:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786691601; cv=none; b=dnApK1aIWb8cmj2bdMTx6hXg7D4L+vpLT9h+/tdLoj0yqCkVXxrmzsopDWKLFkyksmuMRn+9WH2J4CdKVISt4gOIM4voOJ9rs1UMykb6oih2XeRiiDp1la2DiZJ38gSgzBsIy/9mbCkAjIHcs8l7u4wBOTDgVLDszV3BAgbjoNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786691601; c=relaxed/simple; bh=zFtNcngtFWoMnpccDfuSCQkGbVwc6Ii4mKhnjDMpm5s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L5D5GgxzU8Gfj+upk08HljKEXcR5qEv2mjABw028oOYDDFwwB61PYkcO8gOqUJ7XQFr2vg5f9qykv7lkX2OmzWYpQf4iI5xeA58u5ftiz+vDzuhXPHk1yR8e+W7zyg0S0oOTfBo8yTPRnuAFiqUuM7xcPoB5eRtlEcaYHKOUlm4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=y/EZvdlJ; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="y/EZvdlJ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E95B04E41221; Fri, 14 Aug 2026 07:13:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BDA866046D; Fri, 14 Aug 2026 07:13:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8CBEF11C4E891; Fri, 14 Aug 2026 09:13:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1786691585; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=kRgIOpocXmWDCj9+e0CmpJoX72P3XcDuoAlPjTPqyK4=; b=y/EZvdlJUc0MpNB4aB73uMu6uXZx0cx6WV3f5WG9knOzgolkkU4/xi29bqDXhkSI6evopp T3FhkQiNASrrfdYnSasAYAEZLMNs42mettBgMqhkzkHSGhhxpRoQDD9X9CAcVNGsp9emqX +yvkaR51r4f/Jb4AVDGzoxJKM6LxAgFbwTLVfwitrLFY2rPYZr83nf5OFZEYIMVAAMmhCW mDfxctDrr3vhcKPP+KtZDQvQfyE7hCmSW2zeBhw5QYyAgVwnk6rJ4HQHRHMb4djhvFOg1L 6xBbDG8hMtgdyshBEoz+r5T2lsD7M+6/i+10ZI9ZEq/j5GvKSCHRwQ2yqF7x6A== From: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= Date: Fri, 14 Aug 2026 09:11:27 +0200 Subject: [PATCH bpf v5 1/2] bpf/selftests: fix comment style in network_helpers.c 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: <20260814-tc_tunnel_flaky-v5-1-5b93d030c42c@bootlin.com> References: <20260814-tc_tunnel_flaky-v5-0-5b93d030c42c@bootlin.com> In-Reply-To: <20260814-tc_tunnel_flaky-v5-0-5b93d030c42c@bootlin.com> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Shuah Khan , Ihor Solodrai Cc: ebpf@linuxfoundation.org, Bastien Curutchet , Thomas Petazzoni , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Mailer: b4 0.15.2 X-Last-TLS-Session-Version: TLSv1.3 BPF subsystem requires multi-line comments to have the opening /* start on its own line. Update multi-line comments in network_helpers.c to follow this requirement. Signed-off-by: Alexis Lothor=C3=A9 (eBPF Foundation) --- tools/testing/selftests/bpf/network_helpers.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/= selftests/bpf/network_helpers.c index db935a9d9fc1..cdf2d7d3ab32 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -424,7 +424,8 @@ int make_sockaddr(int family, const char *addr_str, __u= 16 port, *len =3D sizeof(*sin6); return 0; } else if (family =3D=3D AF_UNIX) { - /* Note that we always use abstract unix sockets to avoid having + /* + * Note that we always use abstract unix sockets to avoid having * to clean up leftover files. */ struct sockaddr_un *sun =3D (void *)addr; @@ -865,7 +866,8 @@ static bool is_ethernet(const u_char *packet) memcpy(&arphdr_type, packet + 8, 2); arphdr_type =3D ntohs(arphdr_type); =20 - /* Except the following cases, the protocol type contains the + /* + * Except the following cases, the protocol type contains the * Ethernet protocol type for the packet. * * https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL2.html @@ -1033,19 +1035,22 @@ static void *traffic_monitor_thread(void *arg) if (!packet) continue; =20 - /* According to the man page of pcap_dump(), first argument + /* + * According to the man page of pcap_dump(), first argument * is the pcap_dumper_t pointer even it's argument type is * u_char *. */ pcap_dump((u_char *)dumper, &header, packet); =20 - /* Not sure what other types of packets look like. Here, we + /* + * Not sure what other types of packets look like. Here, we * parse only Ethernet and compatible packets. */ if (!is_ethernet(packet)) continue; =20 - /* Skip SLL2 header + /* + * Skip SLL2 header * https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL2.html * * Although the document doesn't mention that, the payload @@ -1079,7 +1084,8 @@ static void *traffic_monitor_thread(void *arg) return NULL; } =20 -/* Prepare the pcap handle to capture packets. +/* + * Prepare the pcap handle to capture packets. * * This pcap is non-blocking and immediate mode is enabled to receive * captured packets as soon as possible. The snaplen is set to 1024 bytes @@ -1150,7 +1156,8 @@ static void encode_test_name(char *buf, size_t len, c= onst char *test_name, const =20 #define PCAP_DIR "/tmp/tmon_pcap" =20 -/* Start to monitor the network traffic in the given network namespace. +/* + * Start to monitor the network traffic in the given network namespace. * * netns: the name of the network namespace to monitor. If NULL, the * current network namespace is monitored. @@ -1255,7 +1262,8 @@ static void traffic_monitor_release(struct tmonitor_c= tx *ctx) free(ctx); } =20 -/* Stop the network traffic monitor. +/* + * Stop the network traffic monitor. * * ctx: the context returned by traffic_monitor_start() */ --=20 2.55.0 From nobody Tue Aug 25 14:35:34 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 3C2363E9C18; Fri, 14 Aug 2026 07:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786691611; cv=none; b=hGu7sPaqfu4plXay1sKOgDj/y7PgZk3SOaVjmRNbTKTQkL79jhKIvsNGJdmdsr5St5u3Nidj84l4HF+tHuoHnmQVM20YOIqjBlkGWEhw//A6f2YuFOWVaATA64vuFAfX3E+i7j++VEkHHLkGw3jT58E7nSj8rljMNi5aagUIAu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786691611; c=relaxed/simple; bh=o3/AKJ1BkfhYXq+Dg59HF5Hxq3bczX2JLmtlREB/jpc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QxjC2xd31LKCYev+4l1n8KumHFwrp0HIVI/1QGU9S201LABo8P0BI90NsPGR2J6YLqWXTLJq1UjcYCHaZXZKDAGYx46KgNpeyD3337H0EZp5MEpcKCTRieZ4iVudbl1X61Lcd0N+HQiML5vyRbfIOJTjcD920N1c0VdQsRJMXPU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=wrFIonor; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="wrFIonor" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 194F51A162B; Fri, 14 Aug 2026 07:13:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DFD636046D; Fri, 14 Aug 2026 07:13:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 07EE211C4E895; Fri, 14 Aug 2026 09:13:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1786691591; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=YiK4yiTW2Lx/mwsS/lDLH9lOApYiCd32mWNiNG38Bxw=; b=wrFIonorpQUlxtkTaSaqE554IeXUFP0EHNrxaINcgSXFTfzWUOSBk2Pp6xSwiGPMZUu7I9 7FnisLw605/ywpnmVwnf/34em421xMvrZd1kdckg5Ge1BwO5xUlKZSq/Y7lyQbOyjJWAqy B+iTx+HPsY1G4WE7tM/q9c2QGAGK8+cCyCkQrwFegV1UkKwOkL9Gm2/+hVS1ZJlx2YSOYJ CsRuZp9rLyxDBsl5fsJ2molFKDM7iw+Dy79yOQ3TL+eEEEVcBYY40XymJ1a1TsMZ19s0TT qZbL2qHaBv2me+YTRuhkecLnlWcCiDjIl8UbHFmfmJwWpZ0v1u9KPqsjKw2joA== From: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= Date: Fri, 14 Aug 2026 09:11:28 +0200 Subject: [PATCH bpf v5 2/2] selftests/bpf: allocate a larger timeout for connection 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: <20260814-tc_tunnel_flaky-v5-2-5b93d030c42c@bootlin.com> References: <20260814-tc_tunnel_flaky-v5-0-5b93d030c42c@bootlin.com> In-Reply-To: <20260814-tc_tunnel_flaky-v5-0-5b93d030c42c@bootlin.com> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Shuah Khan , Ihor Solodrai Cc: ebpf@linuxfoundation.org, Bastien Curutchet , Thomas Petazzoni , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Mailer: b4 0.15.2 X-Last-TLS-Session-Version: TLSv1.3 Some tests, like tc_tunnel or tc_edt, sporadically fail in CI with the following logs: (network_helpers.c:309: errno: Operation now in progress) \ Failed to connect to server send_and_test_data:FAIL:connect to server unexpected error: -115 This is due to SO_RCVTIMEO and SO_SNDTIMEO being set on the client socket (see settimeo() in client_socket()), allowing connect() to return an error and to set errno to EINPROGRESS instead of ETIMEDOUT. Increasing the timeout value for those tests is likely not a good solution (and it has already been done by commit 2790db208b44 ("selftests/bpf: Improve tc_tunnel test reliability")): some tests expect some data transfer to fail, and so the timeout value would increase overall test execution duration again (not only the connection, but any socket operation). Another solution is to allocate a timeout budget specific to the connection: we can apply a larger timeout only for connections, and once the connection is established, set back the timeout configured through opts->timeout_ms; this would allow connection to succeed under heavy CI load, while keeping timeout reasonable for the rest of the test traffic. Set a larger SO_SNDTIMEO/SO_RCVTIMEO for the connection step, and reset it back to the timeout configured by the test once the connection has succeeded. Fixes: 99126abec5e5 ("bpf: selftests: A few improvements to network_helpers= .c") Acked-by: Ihor Solodrai Signed-off-by: Alexis Lothor=C3=A9 (eBPF Foundation) --- tools/testing/selftests/bpf/network_helpers.c | 36 +++++++++++++++++++++++= +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/= selftests/bpf/network_helpers.c index cdf2d7d3ab32..8c9236c0a5a5 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -49,6 +49,8 @@ errno =3D __save; \ }) =20 +#define CONNECT_MIN_TIMEOUT_MS 5000 + struct ipv4_packet pkt_v4 =3D { .eth.h_proto =3D __bpf_constant_htons(ETH_P_IP), .iph.ihl =3D 5, @@ -291,6 +293,12 @@ int client_socket(int family, int type, return -1; } =20 +static int connect_timeout_ms(const struct network_helper_opts *opts) +{ + /* Enforce a minimum connect timeout value */ + return MAX(opts->timeout_ms, CONNECT_MIN_TIMEOUT_MS); +} + int connect_to_addr(int type, const struct sockaddr_storage *addr, socklen= _t addrlen, const struct network_helper_opts *opts) { @@ -305,13 +313,35 @@ int connect_to_addr(int type, const struct sockaddr_s= torage *addr, socklen_t add return -1; } =20 + /* + * Override timeout configuration with a larger value for the + * connection + */ + if (settimeo(fd, connect_timeout_ms(opts))) { + log_err("Failed to set connect timeout"); + goto close; + } + if (connect(fd, (const struct sockaddr *)addr, addrlen)) { - log_err("Failed to connect to server"); - save_errno_close(fd); - return -1; + log_err("Failed to connect"); + goto close; + } + + /* + * If the timeout configured by the test is different from the + * connect timeout, restore it + */ + if (opts->timeout_ms !=3D CONNECT_MIN_TIMEOUT_MS && + settimeo(fd, opts->timeout_ms)) { + log_err("Failed to set timeout for connected socket"); + goto close; } =20 return fd; + +close: + save_errno_close(fd); + return -1; } =20 int connect_to_addr_str(int family, int type, const char *addr_str, __u16 = port, --=20 2.55.0