From nobody Mon Feb 9 15:08:54 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 51443350A14; Wed, 29 Oct 2025 13:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761745994; cv=none; b=MBuyKXg16fhTa1++mOAPgpLTeXPlHFNgmxmo3GYMFdCbdN8lCdkbH2E7xR69ddTdmdzNCNlXG0lVNYW+MF4ei/aMMz3m48cJ6F3SCWAGEJIwiggaSjEcrlKZzee4a1rCEc9+FjZhEGnWHTcfUgXqa/elXjU14/PdZl9EojTHL9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761745994; c=relaxed/simple; bh=i6tvyT3HeQHgZFGaqaMNEa+sxOzLO4PwlSxdaTbHzYw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=byGLW3Mfv3UeAkl5kkz47dUlOGBEWkwQ1AjENw0vvlzVnXY1WOTSpMGw6dXlHK8X+3j3dLSC21OfzNSLak0knXc7HIuKDGzIbQSfdBHv2DrtUB6uRXdkDNofkTPISGtN8P6fm11MZ4iSi3HM+zJ02swywv5nstzIEtnAxH8A5wU= 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=KLDapSPL; arc=none smtp.client-ip=185.171.202.116 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="KLDapSPL" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id C242AC0DBC3; Wed, 29 Oct 2025 13:52:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 237EE606E8; Wed, 29 Oct 2025 13:53:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 86192117F80F6; Wed, 29 Oct 2025 14:53:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761745989; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=QiRKufBHvQpmJwKLnrkextSnGSsnCJs7BLMNg+4LYZU=; b=KLDapSPLDC8T97IxfY2RfqV/UGpZoYNgAriC29HDhZ7YYyOLgpIZxzBPfs21Qpy194Rint AtRnq3oJdLE4C5YYdxYTw42O/5HyqKvTpybgfXJ4fAtm2G10vCDpDflLSfIcSw1+pUnUOt dg1vd5mOGxETMoiQZAbXIPt5q9nGc4I5jAAWMeXEv9JL9ojf7cdXQWsmVWH+9zbSXH/Xwg IAq0wfN9slY0kNYYa/mX0W85ufLlCVQc8PWloOVRDbZmYyMGRQ5r6ytzwURBgVE+JwepM9 4u7lkhmUPNlDQn4Mms6Mhd4WKp0dGLrirkcKpfcTRiWw81Bb6bdKZlkVFu1UkQ== From: "Bastien Curutchet (eBPF Foundation)" Date: Wed, 29 Oct 2025 14:52:33 +0100 Subject: [PATCH bpf-next v6 12/15] 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: <20251029-xsk-v6-12-5a63a64dff98@bootlin.com> References: <20251029-xsk-v6-0-5a63a64dff98@bootlin.com> In-Reply-To: <20251029-xsk-v6-0-5a63a64dff98@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. Reviewed-by: Maciej Fijalkowski 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 2c392d5b9f30145cf7b0ea8a49990f1673bef6c9..18a6ce648461de1975aa25997a2= 2c77cecb97a76 100644 --- a/tools/testing/selftests/bpf/test_xsk.c +++ b/tools/testing/selftests/bpf/test_xsk.c @@ -1772,12 +1772,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 @@ -1791,8 +1791,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.51.0