From nobody Fri Oct 3 11:22:25 2025 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 DB92730148C for ; Tue, 2 Sep 2025 12:54:17 +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=1756817660; cv=none; b=LNuPKFOe3oNoXhR9Hkg/auw4WvGRoNGCTSdORqmL6WkhY84ul+0OIwVNGQuUXXB+q0dNDDJFvmTUsjUWTKZR5IJw0Ov04q8dUrvvD4TRAEkSMxRlP1hZRFFERgM3RSgJc1Eb/BMb9KGRAktSUKG+YNZ7+MXfBaVOEeWGUOOgkuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756817660; c=relaxed/simple; bh=f+PUXB48FO3f34mXIwurXdJAEg2KAeDvIh3cgkdjW24=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GfQDkmn3jDHYGZGEZjlqOo4soPLyosX5NvQtdE6ktYbxn/sL/X+cxsm2y4jxtvm4y0WQgSh1HPMfkt86hR5QIx12Ne4L0K1GCEP1rb2W39eAuVBcXkSDpKueAZaIZGrRNK99XaQYovpPAwmB2Ji5GF0KpSw2PuULdGttZ2ov1+o= 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=HvJ+J4ER; 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="HvJ+J4ER" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7F12E1A09D3; Tue, 2 Sep 2025 12:54:16 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5153660695; Tue, 2 Sep 2025 12:54:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7E08C1C22CD91; Tue, 2 Sep 2025 14:54:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1756817655; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=HYciB7DpQG/ZKZdVIJkDQBEkAOfPYSQPQ8fg/ov91R0=; b=HvJ+J4ERsnLYSLgVHTQcCc5RynNfI6hc8rm360HmqUNCG5k37Xmoa1uZr3JM0oy+Fe93Cq /SIEXJ2vxN34eb+1pncOh0h3oLKd3sNLR18ZZzdMbyfz//b+aVVW0fwlQPR+/BgcLvhKWM UrPp4etK8oRFrrUZbwLbt+DL8yP5k9O7SG/VxXGuV24LrAs/DqOczWbIuSsB2+nV3ovwGP F0iUyY6c0QwXPEsP26dhmj5FJOTFDHtkFh5VDIkm2loXTvOnU7MCdvVOnS6GDjbgUrzdgH YKQgMA1/2NIHUwu8jPy09FKsz/R1Js8j2pDhkG7Ycqf47Zj9deVNW4unC3+b9w== From: "Bastien Curutchet (eBPF Foundation)" Date: Tue, 02 Sep 2025 14:50:00 +0200 Subject: [PATCH bpf-next v2 10/14] selftests/bpf: test_xsk: Don't exit immediately if validate_traffic fails 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: <20250902-xsk-v2-10-17c6345d5215@bootlin.com> References: <20250902-xsk-v2-0-17c6345d5215@bootlin.com> In-Reply-To: <20250902-xsk-v2-0-17c6345d5215@bootlin.com> To: =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer Cc: Thomas Petazzoni , Alexis Lothore , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (eBPF Foundation)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 __testapp_validate_traffic() calls exit_with_error() on failures. This exits the program immediately. It prevents the following tests from running and isn't compliant with the CI. Return TEST_FAILURE instead of calling exit_with_error(). Release the resource of the 1st thread if a failure happens between its creation and the creation of the second thread. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/test_xsk.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/test_xsk.c b/tools/testing/selftes= ts/bpf/test_xsk.c index 516ebbf6248e4629acf69e9a16e2a46b19fdea81..b22b99f2e4acb528928654ec009= 95dc892487068 100644 --- a/tools/testing/selftests/bpf/test_xsk.c +++ b/tools/testing/selftests/bpf/test_xsk.c @@ -1782,12 +1782,12 @@ static int __testapp_validate_traffic(struct test_s= pec *test, struct ifobject *i err =3D test_spec_set_mtu(test, test->mtu); if (err) { ksft_print_msg("Error, could not set mtu.\n"); - exit_with_error(err); + return TEST_FAILURE; } =20 if (ifobj2) { if (pthread_barrier_init(&barr, NULL, 2)) - exit_with_error(errno); + return TEST_FAILURE; pkt_stream_reset(ifobj2->xsk->pkt_stream); } =20 @@ -1801,8 +1801,11 @@ static int __testapp_validate_traffic(struct test_sp= ec *test, struct ifobject *i =20 if (ifobj2) { pthread_barrier_wait(&barr); - if (pthread_barrier_destroy(&barr)) - exit_with_error(errno); + if (pthread_barrier_destroy(&barr)) { + clean_sockets(test, ifobj1); + clean_umem(test, ifobj1, NULL); + return TEST_FAILURE; + } =20 /*Spawn TX thread */ pthread_create(&t1, NULL, ifobj2->func_ptr, test); --=20 2.50.1